<DIV>&nbsp;</DIV>
<DIV>Hi Friends,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I wanted to read a volume and save it&nbsp;as vtk and stl files.In the following application while I was debugging while setting the output of ImageImport to the input of&nbsp;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>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>void convert1::image(CS_Volume* vol1,LPCTSTR Out_path1,LPCTSTR Out_path2)<BR>{<BR>&nbsp;<BR>&nbsp; vtkImageImport* imageim=vtkImageImport::New();<BR>&nbsp;vtkImageDataGeometryFilter* gfil=vtkImageDataGeometryFilter::New();<BR>&nbsp;imageim-&gt;SetImportVoidPointer((void*)vol1,1);<BR>&nbsp;imageim-&gt;SetDataExtent(0,127,0,127,0,1);<BR>&nbsp;imageim-&gt;SetWholeExtent(0,127,0,127,0,1);<BR>&nbsp;imageim-&gt;SetDataSpacing(2.73,2.73,2.73);<BR>&nbsp;imageim-&gt;SetDataOrigin(0.0,0.0,0.0);<BR>&nbsp;imageim-&gt;SetDataScalarTypeToUnsignedShort();<BR>&nbsp;gfil-&gt;SetInput(imageim-&gt;GetOutput());<BR>&nbsp;vtkPolyDataWriter* vw=vtkPolyDataWriter::New();<BR>&nbsp;vtkSTLWriter* stl=vtkSTLWriter::New();<BR>&nbsp;ofstream ofile1;&nbsp;<BR>&nbsp;ofile1.open(Out_path1,ios::in | ios::out | ios::binary);<BR>&nbsp;vw-&gt;SetInput(gfil-&gt;GetOutput());<BR>&nbsp;vw-&gt;SetFileName(Out_path1);<BR>&nbsp;vw-&gt;SetFileTypeToBinary();<BR>&nbsp;vw-&gt;Write();<BR>&nbsp;ofstream
 ofile2;<BR>&nbsp;ofile2.open(Out_path2,ios::in | ios::out | ios::binary);<BR>&nbsp;stl-&gt;SetInput(gfil-&gt;GetOutput());<BR>&nbsp;stl-&gt;SetFileName(Out_path2);<BR>&nbsp;stl-&gt;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>