[vtkusers] Moving an ImageData

David Doria daviddoria+vtk at gmail.com
Wed Feb 10 14:53:31 EST 2010


Rather than have the lower left corner of the image be at world coordinates
(0,0), I want (0,0) to be at the center of the image.

It looks like the SetOrigin() function of vtkImageData would do this, but it
doesn't seem to "move" the image in world coordinates.

I tried this:

  int dims[3];
  image->GetDimensions(dims);
  image->SetOrigin(-dims[0]/2, -dims[1]/2, -dims[2]/2);
  image->Update();

but it doesn't seem to move.

The border widget is used to show the coordinates of a region of the image
(to verify if it has moved or not).

Can anyone see what I may have done wrong here?
http://www.vtk.org/Wiki/VTK/Examples/CenterAnImage

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100210/34e4faf3/attachment.htm>


More information about the vtkusers mailing list