<DIV>Hi Friends,</DIV>
<DIV> </DIV>
<DIV> I was unable to write the volume which has more than one slice using VTKSTLWriter. But I was able to write .stl file for the volume which has one slice.Can any body help me !.Program follows....</DIV>
<DIV> </DIV>
<DIV>//Console Program</DIV>
<DIV> </DIV>
<DIV>void convert1::image(CS_Volume* vol1,LPCTSTR Out_path2)<BR>{<BR> <BR> <BR>BYTE* buffer=(BYTE*)vol1->Mem;<BR> <BR> vtkImageImport* importer = vtkImageImport::New();<BR> <BR> importer->SetImportVoidPointer(buffer);<BR> importer->SetDataExtent(0,vol1->Width-1,0,vol1->Height-1,0,vol1->Depth-1);<BR> importer->SetWholeExtent(0,vol1->Width-1,0,vol1->Height-1,0,vol1->Depth-1);<BR> importer->SetDataSpacing(vol1->voxelWidth,vol1->voxelHeight,vol1->voxelDepth);<BR> importer->SetDataOrigin(0.0,0.0,0.0);<BR> if (vol1->DataType == 1 || vol1->DataType ==128 || vol1->DataType == 2) <BR> importer->SetDataScalarTypeToUnsignedChar();<BR> <BR> else if (vol1->DataType == 4
)<BR> importer->SetDataScalarTypeToUnsignedShort();<BR> else if (vol1->DataType == 8)<BR> importer->SetDataScalarTypeToShort();<BR> else if (vol1->DataType == 16 )<BR> importer->SetDataScalarTypeToInt();<BR> else if (vol1->DataType == 32)<BR> importer->SetDataScalarTypeToInt();<BR> else if (vol1->DataType == 64)<BR> importer->SetDataScalarTypeToFloat();</DIV>
<DIV> vtkImageDataGeometryFilter* gfil=vtkImageDataGeometryFilter::New();<BR> gfil->SetInput(importer->GetOutput());</DIV>
<DIV> </DIV>
<DIV>vtkSTLWriter* stl=vtkSTLWriter::New();<BR> <BR> ofstream ofile2;<BR> ofile2.open(Out_path2,ios::in | ios::out | ios::binary);<BR> stl->SetInput(gfil->GetOutput());<BR> stl->SetFileName(Out_path2);<BR> stl->SetFileTypeToBinary();<BR> stl->Write();</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV>Sindhu..</DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com