[vtkusers] Fitting 2D image

TJ Wilkinson tswilkin at fas.harvard.edu
Thu Aug 2 15:49:22 EDT 2001


I'm using vtkImageReslice, vtkImageMapper, vttActor2D, vtkRenderer &
vtkRenderWindow to display and interact with 2D images.  I'd like to add
an image fitting function, but I'd like to do it, if possible, without
having to store extra information, that is, just use the information that
is available in these data objects that I listed.

When an image first is displayed, each pixel in the image file is mapped
to a single pixel on the display.  The only way I've found to fit an image
is to store this original spacing, then use that value to find the new
spacing that would correspond to a fit.  If I don't want to fit the image
immediately, though, I might change the original spacing via zooming.

Basically, I was wondering how I can determine the correct spacing from
the original extents, the size of the renderWindow, an origin, and a given
spacing.

Sincerely,

TJ






More information about the vtkusers mailing list