[Insight-users] itk::Image vs. itk::OrientedImage
Tao, Xiaodong (GE, Research)
taox at research.ge.com
Thu Oct 9 09:52:17 EDT 2008
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
More information about the Insight-users
mailing list