[vtkusers] Moving an ImageData

KS Jothybasu jothybasu at gmail.com
Wed Feb 10 14:59:24 EST 2010


I think you could set that with ImageActor->SetPosition()

Jothy

On Wed, Feb 10, 2010 at 7:53 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100210/06c06f8d/attachment.htm>


More information about the vtkusers mailing list