[Insight-developers] Bugs with respect to ITK_IMAGE_BEHAVES_AS_ORIENTED_IMAGE

Stephen Aylward Stephen.Aylward at kitware.com
Fri Nov 7 11:13:36 EST 2008


Do you also have USE_REVIEW and USE_OPTIMIZED_REGISTRATION_METHODS turned
on?   Those are needed to enable the registration methods that SHOULD (may?)
correctly handle directions.

Stephen

On Fri, Nov 7, 2008 at 11:07 AM, Hans Johnson <hans-johnson at uiowa.edu>wrote:

>  Luis,
>
> I'm sorry to spring this on you just hours after the release, but I
> discovered several bugs when ITK_IMAGE_BEHAVES_AS_ORIENTED_IMAGE is turned
> on, and images with different directions are used.
>
> I'm working on a patch right now, but it does touch many many files.  So
> far my tests have shown that regression tests pass both with or without
> setting the output directions.  The problem showed up when attempting to
> register images that have different orientations, spacing's, size, and
> origins.  I think that our test data is too uniformly defined to catch these
> problems.
>
> =======================================================
> grep -A 2 -B 2 "Set.*Spacing.*Get.*Spacing" Insight/Code/*/* > ReviewList
>
> From this I look for patterns like the following:
>
> Code/Algorithms/itkBayesianClassifierImageFilter.txx-
>  this->GetOutput()->SetRegions( membershipImage->GetBufferedRegion() );
> Code/Algorithms/itkBayesianClassifierImageFilter.txx:
>  this->GetOutput()->SetSpacing( membershipImage->GetSpacing() );
> Code/Algorithms/itkBayesianClassifierImageFilter.txx-
>  this->GetOutput()->SetOrigin(  membershipImage->GetOrigin() );
> Code/Algorithms/itkBayesianClassifierImageFilter.txx-
>  this->GetOutput()->Allocate();
>
> NOTICE:  The output of this filter does not set the Direction!!!!
> this->GetOutput()->SetDirection(  membershipImage->GetDirection() );
> =======================================================
>
> Unfortunately this seems like a very common problem throughout ITK.   It is
> my assumption that most filters that: a) take input image, b) do something
> to the intensity values, c) generate and output image; will behave in such a
> way that the output image has the same origin, spacing, size, AND direction
> as the input image.  Filters  that: a)take an input image, b) take
> parameters for desired output physical space defintion, c) generate the new
> output image; must have options for setting Spacing, Origin, AND Direction.
>
> Experimental build:
> http://www.cdash.org/CDash/buildSummary.php?buildid=210257
>
> I hope to have the code committed and bugs reported in about 1 hour.
>
> Hans
> --
> Hans J. Johnson, Ph.D.
> Hans-johnson at uiowa.edu
>
> 278 GH
> The University of Iowa
> Iowa City, IA 52241
> (319) 353 8587
>
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
> Please reply to the sender that you have received the message in error, then
> delete it.  Thank you.
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
>


-- 
Stephen R. Aylward, Ph.D.
Chief Medical Scientist
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(518) 371-3971 x300
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20081107/e588efa1/attachment.htm>


More information about the Insight-developers mailing list