[vtkusers] How do get vtkImageReader/vtkImageViewer to read along X and Y direction?
Kevin Tiow Wee Tan
twtan at cheerful.com
Thu Jun 12 12:43:44 EDT 2003
Hello,
I used following to code to read a raw-byte format file:
reader.SetFilename(filename);
reader.SetDataExtent(0, xDim-1, 0, yDim-1, 0, zDim-1);
reader.FileDimensionality(3);
reader.DataScalarTypeToUnsingedChar();
reader.Update();
and I passed to vtkImageViewer to view images such as following:
imageViewer.SetInput(reader.GetOutput());
imageViewer.SetSize(xDim, yDim);
imageViewer.Render();
The above code works fine if I wanted to view along Z direction, by
using imageViewer.SetZSclice() method.
How easy that I can get vtkImageReader to read along X or Y direction OR
get vtkImageViewer to view along X or Y direction?
The only thing I can think of is using SetTransform() method under
vtkImageReader... Do I need to make any changes for the xDim, yDim, zDim
values under SetDataExtent () method?
or do I need to read byte-by-byte along X and Y directions (the hard
way)?
Any suggestion would be very much appreciated...
--
Thanks
Kevin
**********************************
Manchester Material Science Centre
University of Manchester
----------------------------------
Centre for Virtual Environments
University of Salford
**********************************
More information about the vtkusers
mailing list