[vtkusers] [visualizing a volume]
John Fourkiotis
gfourk at zeus.csd.auth.gr
Wed Jul 7 03:43:29 EDT 2004
Hi,
i have used the following code to read 10 tiff image slices of a tooth,
with each image having dimensions 250x188x8bits, (greyscale):
#include <vtk/vtkTIFFReader.h>
const int GREYSCALE = 1;
const int TWO_DIMENSIONAL = 2;
const int LENGTH = 250;
const int WIDTH = 188;
int main()
{
vtkTIFFReader * tiffReader = vtkTIFFReader::New();
tiffReader->SetDataSpacing(1,1,1); // dont know what value is the
correct
tiffReader->SetFileDimensionality(TWO_DIMENSIONAL); // 2-> to read a
volume from 2D files
tiffReader->SetNumberOfScalarComponents(GREYSCALE); // greyscale
tiffReader->SetDataScalarTypeToUnsignedChar();
tiffReader->SetFilePattern("tooth%i.tif");
tiffReader->SetDataExtent(0, LENGTH-1, 0, WIDTH-1, 1, 10);
...
return 0;
}//~
now, how can try to visualize the volume and see if my code does work ?
Should i use a vtkImageToStructuredPoints and then create a volume ?
thanx
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
More information about the vtkusers
mailing list