[vtkusers] vtkImageData to vtkStructuredPoints

kmm kmm at brown.edu
Mon Jan 27 02:37:44 EST 2003


Please forgive my ignorance and naivete.

I am trying to process CT data (TIFF files) to generate points on an
isosurface for output as OBJ files. Eventually, I want to process a
whole folder of slices, but for now, I am just trying to get it to work
with one (sfpr.tif).

I am having trouble making the conversion of the TIFF file to
StructuredPoints, so that I can pass it through DividingCubes or
EdgePoints.  I thought the following snippet would work, as it has in
the past when using MarchingCubes to make volumes:

.... 

vtkTIFFReader *myTiffReader=vtkTIFFReader::New();
	myTiffReader->SetFileName("sfpr.tif");

vtkStructuredPoints *points=vtkStructuredPoints::New();
	points=((myTiffReader->GetOutput())->MakeImageToStructuredPoints())->GetOutput();

vtkDividingCubes *dc = vtkDividingCubes::New();
	dc->SetInput(points);
	dc->SetValue(1500);
....

But I get the following error message:

/home/kmm/vtk/shrew/shrew.cxx:24: no matching function for call to
`vtkImageData::MakeImageToStructuredPoints()'

For kicks, if I replace the offending line with:

     points=(myTiffReader->GetOutput());

I get the following:

/home/kmm/vtk/shrew/shrew-0.02.cxx:25: invalid conversion from
`vtkImageData*' to `vtkStructuredPoints*'


I do have vtkImageData.h included.

There may be a better method for processing a file at a time (I am open
to suggestions). This seems like a fairly straightforward process I am
trying, but I am baffled.

Does the problem have to do with 2D data rather than 3D data as I am
used to?

Any suggestions would be greatly appreciated.

Thanks 
Kevin

-- 
Kevin Middleton
Department of Ecology and Evolutionary Biology
Box G-B204
Brown University
Providence RI 02912
phone: 401 863 3804
fax: 401 864 7544




More information about the vtkusers mailing list