[ITK-users] [ITK] Resampling after SetDirection() and SetOrigin()
Matt McCormick
matt.mccormick at kitware.com
Sun Jun 29 20:45:29 EDT 2014
Hi Mathew,
Yes, that is the correct and expected behavior. I do not know if
ImageJ is using the actual location in world space.
It sounds like ChangeInformationImageFilter is what you are looking
for. It will be wrapped for float images if wrapped for float images
is enabled in you CMake configuration (ITK_WRAP_float).
Hope this helps,
Matt
On Sat, Jun 28, 2014 at 9:55 PM, Mathew Guilfoyle <mrguilfoyle at gmail.com> wrote:
> If I change an image's direction and origin using SetDirection() and
> SetOrigin() methods and then write the image back to a file, the volume
> stack viewed in (e.g.) ImageJ is unchanged. This is the behaviour I would
> expect as changing the direction and origin shouldn't alter the array of
> image pixels, just its location and orientation in 'world space'?
>
> However, if I take the same image, adjust the origin and direction as
> before, and then input it to ResampleImageFilter with an identity transform
> (and set spacing, origin, direction, and size to those of the input image)
> the output is a translated and rotated image.
>
> It seems the difference between the original and adjusted origin and
> direction are applied as a translation and rotation during resampling, even
> though GetOrigin() and GetDirection() on the input image to the resampler
> return the adjusted parameters.
>
> Is this the expected behaviour? Is there another image parameter that needs
> to be changed to correctly alter origin and direction?
>
> (ChangeInformationImageFilter is not wrapped for float images so I can't use
> it for my application)
>
> Thanks
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
More information about the Insight-users
mailing list