[vtkusers] Problem while getting input to the ImageDataGeometryFilter
Uma Sindhura
usindhura at yahoo.com
Wed May 25 02:32:55 EDT 2005
Hi Friends,
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?
void convert1::image(CS_Volume* vol1,LPCTSTR Out_path1,LPCTSTR Out_path2)
{
vtkImageImport* imageim=vtkImageImport::New();
vtkImageDataGeometryFilter* gfil=vtkImageDataGeometryFilter::New();
imageim->SetImportVoidPointer((void*)vol1,1);
imageim->SetDataExtent(0,127,0,127,0,1);
imageim->SetWholeExtent(0,127,0,127,0,1);
imageim->SetDataSpacing(2.73,2.73,2.73);
imageim->SetDataOrigin(0.0,0.0,0.0);
imageim->SetDataScalarTypeToUnsignedShort();
gfil->SetInput(imageim->GetOutput());
vtkPolyDataWriter* vw=vtkPolyDataWriter::New();
vtkSTLWriter* stl=vtkSTLWriter::New();
ofstream ofile1;
ofile1.open(Out_path1,ios::in | ios::out | ios::binary);
vw->SetInput(gfil->GetOutput());
vw->SetFileName(Out_path1);
vw->SetFileTypeToBinary();
vw->Write();
ofstream ofile2;
ofile2.open(Out_path2,ios::in | ios::out | ios::binary);
stl->SetInput(gfil->GetOutput());
stl->SetFileName(Out_path2);
stl->Write();
}
---------------------------------
Do You Yahoo!?
Yahoo! Small Business - Try our new Resources site!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050524/f621a371/attachment.htm>
More information about the vtkusers
mailing list