[Insight-users] Re: direction API misleading
Karthik Krishnan
karthik.krishnan at kitware.com
Fri Feb 1 13:16:45 EST 2008
On 2/1/08, Simon Warfield <simon.warfield at childrens.harvard.edu> wrote:
>
>
> The problem is that itk::Image inherits an API from itk::ImageBase to
> store and manipulate Directions, just like an OrientedImage,
> but doesn't act on them. It is particularly confusing for new users -
> what developer would expect us to design an image class that has
> directions but ignores them ?
I agree. It would have been great if itk::Image was an OrientedImage to
start from, but that isn't the case. The fact remains that itk::Image is the
predominant way to represent images ion in ITK.
Direction in itk::ImageBase should simply be treated as MetaData. It is
present in the superclass so as to preserve this meta-data, so that
direction information can be propagated through the pipeline. A ImageWriter
or filter that deems it fit to use the direction info uses it, while several
others ignore it. Please see
itk::ImageBase::CopyInformation(...)
OrientedImage is one of the subclasses that uses the direction information
correctly. Filters that operate on OrientedImage should take the direction
cosines into consideration.
ImageAdaptor now supports the correct storing and passing of direction
> information, but inherits the transforming of physical indexes from the
> base image type. If the base image type is OrientedImage then direction
> information is utilized, and physical coordinates can be used correctly.
> However, a VectorImageToImageAdaptor
VectorImageToImageAdaptor, like ImageAdaptor simply needs to override the
SetDirection and GetDirection methods from itk::ImageBase and delegate the
responsibility to the image its provide facade to. Is that right ? I'll
commit the fix.
Thanks
--
karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080201/a36c31b6/attachment.html
More information about the Insight-users
mailing list