[Insight-developers] itkOrientImageFilter working only in 3D?

Kent Williams norman-k-williams at uiowa.edu
Thu Oct 28 12:57:48 EDT 2004


Making it work for 2D is, as they say, a small matter of programming. It 
is 3D, and only 3D, because it was written to solve the particular 
problem of image organization with respect to medical imaging scans.  
While most of ITK is problem-domain-neutral, the orientation of 3D 
Images have real physical meaning in medical imaging.

It is a bug, I guess, for the filter to only work for 3D, yet silently 
accept other dimensionalities.  The dimensionality of the input and 
output images should be the same, and it should be an error if either is 
not 3. Either that, or the filter needs to be generalized to other 
dimensionalities.

The existing filter would work on 2D images promoted to 3D images with a 
first, or slowest moving, dimension of one.
itkOrientImageFilter::GenerateData looks like the only place that 3D 
matters, I don't have time right to do the work to properly generalize 
this function (and write a new test case to test it), but anyone else 
who wants to jump in is welcome to.

Some design consideration should be give to how 2D SpatialOrientation 
should embed into the 3D SpatialOrientation as defined in 
itkSpatialOrientation.h. And the filter doesn't handle higher-order 
images either. There's some talk in the comments in the filter code 
about adding a fourth 'time' dimension, but since no one has requested 
for the OrientImageFilter support 4 or more dimensions,  no work has yet 
been done.

itk::OrientImageFilter also stores the image orientation in the 
MetaDataDictionary for the itk::Image.  To support the University of 
Iowa Psychiatry research, image orientation information needs to persist 
end-to-end in image processing. It is quite possible to either ignore 
the SpatialOrientation information entirely in an application, or keep 
track of it separate from the images being worked on, but for us at 
Iowa, for our own selfish reasons, we prefer the orientation to live as 
part of an itk::Image.  I imagine that the orientation of images is 
significant in a lot of other image-processing scenarios as well.

It can also be argued that  since itk::PermuteAxesFilter and 
itk::FlipImageFilter cover the same operations, in most cases simply 
using one or the other of those directly instead of itk:: 
OrientImageFilter  would be the more direct solution to this problem.


Julien Jomier wrote:

>Hi,
>
>Sorry if this is a naive question.
>It seems that itkOrientImageFilter only works for 3D images. Is this the way
>it should be or is it supposed to work for 2D images too?
>If this filter is restricted to only one dimensionality, would it be better
>to template the filter over the pixel type of the input/output image (output
>type  should be the same as the output)?
>
>thanks,
>
>Julien
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>
>  
>



More information about the Insight-developers mailing list