[vtkusers] scaling a volume

Melanie Tory mktory at cs.sfu.ca
Mon Feb 25 17:29:44 EST 2002


Hi Lisa,

Thanks for the idea, but it doesn't seem to work.  I tried setting the
origin and spacing of the vtkImageData using SetOrigin() and SetSpacing()
functions, and nothing in my image changed.  The scale did not change
relative to other objects in the scene, and when I scaled non-uniformly,
the aspect ratio of the volume itself did not even change.

I also tried doing the scaling of my subvolume while creating it.
I used the functions SetOutputSpacing() and SetOutputOrigin()
in vtkImageReslice.  This did change some things, but not as I expected.
The object was not scaled unifomly (even though I put the same number for
each dimension) and the data shown on the volume seemed to change as I
rotated the object.

Any ideas? I'm really stumped.

Thanks,

Melanie

On Thu, 21 Feb 2002, Lisa Avila wrote:

> Hi Melanie,
>
> You probably aren't doing anything "wrong"  (setting the scale by some
> uniform value should work - you have encountered a bug I suspect) - but
> this is not the preferred way to change the size of the volume. Instead,
> change the origin and the spacing of the input vtkImageData to indicate the
> location and size of the volume. This allows you to scale independently
> change the origin and the spacing of the input vtkImageData to indicate 
the
> location and size of the volume. This allows you to scale independently
> along the three axes whereas this will produce incorrect results (in
both
> volume and surface rendering shading will be wrong) in VTK if done in
the
> prop's matrix.
>
> Lisa




More information about the vtkusers mailing list