[vtkusers] please help with vtkImageData and spacing

Markus Ringlander makkan at gmail.com
Thu Jun 15 10:38:52 EDT 2006


Hello,

I will be very grateful if anyone can advice in a problem I have with
vtkImageData and its member method SetSpacing().

Let say I create an image with 32x32 pixels and one with 64x64 pixels,
and set the spacing to 0.1 for each pixel in both images. (I then pass
them on to vtkTexture for later texturing)

One would think that second image would be twice as big as the first
one, in pure "length", but instead the both images appear to be of the
same size in the renderwindow, just that twice as many pixels fit into
the larger image.

So basically the setting of spacing has no real affect on the image in
relation to the global coordinate system it resides in.
Instead it seems to just affect the local coordinate system for the
image itself.

How can I work around this? I need to create my images as above, and
really make my 64x64 image twice as big as a 32x32 image with same
spacing.

The reason is, that I later combine/lap together textures, and need to
have the pixels in the textures to be of the same size (spacing) for
fitting purposes.

Thanks for any help!

/Mark











ct its size in "world coordinates".



More information about the vtkusers mailing list