[Insight-users] itk::Image vs. itk::OrientedImage

Bill Lorensen bill.lorensen at gmail.com
Thu Oct 9 10:08:33 EDT 2008


Daniel,

We are working on removing the confusion you discovered. Direction was
added a couple of years ago. Direction was included in Image to permit
interchange (at an API level, not functional level) of the Image and
Oriented image. At the time, we created a new image (OrientedImage)
because we thought the performance hit would be too high for
registration applications. Since then, due in part to clever
programming, the perfomance hit is not too bad, but the confusion over
Image versus OrientedImage is bad. We are working on making Image look
just like OrientedImage. For backward compatibility of the API (not
necessarily function), both classes will remain.

Bill

On Thu, Oct 9, 2008 at 9:52 AM, Tao, Xiaodong (GE, Research)
<taox at research.ge.com> wrote:
> Hello Daniel,
>
> You should use itk::OrientedImage instead of itk::Image.
> Itk::OrientedImage applies direction matrix when transforming Index to
> Physical Point.
>
> Xiaodong
>
> -----Original Message-----
> From: insight-users-bounces at itk.org
> [mailto:insight-users-bounces at itk.org] On Behalf Of Daniel Betz
> Sent: Thursday, October 09, 2008 9:37 AM
> To: insight-users at itk.org
> Subject: [Insight-users] itk::Image vs. itk::OrientedImage
>
> Hello,
>
> I have an itk::Image with orientation like this:
>
> origin:[-125, -124.1, 79.3]
> spacing:[0.9375, 0.9375, 3]
> direction:
> 1 0 0
> 0 1 0
> 0 0 -1
>
> Now I take a valid pixel index:
>
> Pixel Index: [134, 112, 11]
>
> and ask with itk::Image::TransformIndexToPhysicalPoint() for the
> coordinates in physical space and get:
>
> Physical Point: [0.625, -19.1, 112.3]
>
> This is not a physical point inside my image, because the direction of
> the z-axis is negativ. So the z-component 112.3 is outside of my image,
> because the image starts at origin 79.3 (z-axis).
>
> Reading the source code I determined, that
> itk::Image::TransformIndexToPhysicalPoint()
> does not take direction into account.
>
> But there is the class itk::OrientedImage which handles the orientation
> correctly.
>
> My question is, why is SetDirection() in itk::Image available, since the
> Transform Methods will not use it anyway. Why has itk::Image only a
> "fake orientation" and why I need itk::OrientedImage for a "real
> orientation" ?
> The design decission to handle it that way is not visible for me.
>
> In the Doxygen documentation of itk::Image is written, that some
> functions are implemented differently in itk::OrientedImage. I think
> that is not enough and it should be documented more explicitly that I
> can set the direction in an itk::Image even though it will not taken
> into account by the transform methods.
>
> Sincerly
> Daniel Betz
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list