[Insight-developers] Image filters and direction cosines

Lorensen, William E (Research) lorensen at crd.ge.com
Tue Aug 23 13:33:58 EDT 2005


Peter,
Thanks for the headsup. I suspect there will be several places that I missed. I'll do what I can to get them fixed before the release.

Bill


-----Original Message-----
From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
[mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org]On Behalf
Of Peter Cech
Sent: Tuesday, August 23, 2005 1:12 PM
To: insight-developers at itk.org
Subject: [Insight-developers] Image filters and direction cosines


Hi!

Having direction cosines together with an image is great, but some image
filters are throwing this information away (you get identity matrix
instead of proper direction cosines on the output). So far I found three
of them (see bug #2177 and patches at
http://www.vision.ee.ethz.ch/~pcech/bugreports/ITK-20050822/ ),
but there might be some more.

If you happen to write a filter that overrides
GenereateOutputInformation() and does not call
Superclass::GenereateOutputInformation(), please check whether you set
output's direction cosines.

Another problem is updating the origin of an image. Usual formula
origin[i] = origin[i] + spacing[i] * index[i];
does not yield correct results for oriented images. My attempt to fix
RegionOfInterestImageFilter is located at
http://www.vision.ee.ethz.ch/~pcech/bugreports/ITK-20050822/itkRegionOfInterestImageFilter-correct_origin.patch
The filter chooses between computing correct origin via
TransformContinuousIndexToPhysicalPoint (for Image and OrientedImage)
and the old formula for other types of image. If you have comments or
suggestions, I'll be glad to hear them.

itkMetaImageIO.cxx (line 875) should be also updated, but I do not know
how to find out type of saved image, so most likely the same way of
updating origin will be performed for all image types. If you want a
testcase, ExtractImageFilter can produce an image with non-zero index of
largest possible region.

Regards,
Peter Cech
_______________________________________________
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