<DIV> </DIV>
<DIV>Hi Friends,</DIV>
<DIV> </DIV>
<DIV>I wanted to read a volume and save it as vtk and stl files.In the following application while I was debugging while setting the output of ImageImport to the input of ImageDataGeometryFilter ,I was not getting anything to the i/p of imagedatageometry filter.And while writing to vtk and stk I was getting access violation problem.Please help?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>void convert1::image(CS_Volume* vol1,LPCTSTR Out_path1,LPCTSTR Out_path2)<BR>{<BR> <BR> vtkImageImport* imageim=vtkImageImport::New();<BR> vtkImageDataGeometryFilter* gfil=vtkImageDataGeometryFilter::New();<BR> imageim->SetImportVoidPointer((void*)vol1,1);<BR> imageim->SetDataExtent(0,127,0,127,0,1);<BR> imageim->SetWholeExtent(0,127,0,127,0,1);<BR> imageim->SetDataSpacing(2.73,2.73,2.73);<BR> imageim->SetDataOrigin(0.0,0.0,0.0);<BR> imageim->SetDataScalarTypeToUnsignedShort();<BR> gfil->SetInput(imageim->GetOutput());<BR> vtkPolyDataWriter* vw=vtkPolyDataWriter::New();<BR> vtkSTLWriter* stl=vtkSTLWriter::New();<BR> ofstream ofile1; <BR> ofile1.open(Out_path1,ios::in | ios::out | ios::binary);<BR> vw->SetInput(gfil->GetOutput());<BR> vw->SetFileName(Out_path1);<BR> vw->SetFileTypeToBinary();<BR> vw->Write();<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->Write();<BR>}<BR></DIV><p>
                <hr size=1>Do You Yahoo!?<br> Yahoo! Small Business - <a href="http://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/resources/">Try our new Resources site!</a>