[Insight-developers] Change of behavior

Hans Johnson hans-johnson at uiowa.edu
Tue Aug 11 19:43:02 EDT 2009


Stephen,

I¹ve just reported a bug that I wanted to bring to your attention:

      0009398: Changes to itkOptImageToImageMetric.txx on 2009-07-28 break
backwards compatibility


A new boolean variable was introduced to the code on 2009-07-28 in the class
called: m_UseFixedImageMask

This variable is used to determine if fixed image mask processing should be
done. In the past (and in the non-optimized version), fixed image mask
processing was contingent only upon the existence of a mask object.

This new version of the code now requires that you first set the mask, and
then indicate that you want to use the mask.

It is also possible to set the

m_FixedImageMask to some real mask object, then set m_UseFixedImageMask to
true,
and subsequently set m_FixedImageMask back to NULL. This scenerio would
cause the following bit of code to fail.

      if( m_UseFixedImageMask )
        {
        double val;
        if( m_FixedImageMask->ValueAt( inputPoint, val ) )
          {


==================================

I¹ve removed all references to m_UseFixedImageMask  and replaced it with the
previous logical equivalent:

< if( m_UseFixedImageMask )
---
> if( m_FixedImageMask.IsNotNull() )

This fixed all the failing cases in my code, and all the ITK test cases
still pass.

===================================
I am ready to submit this important fix, but I wanted to make sure that
there is not some un-documented reason why that new Boolean is needed.

I¹ll be closing the bug and  making the commit tomorrow afternoon if I don¹t
hear back from you.

Thanks,
Hans

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090811/86a36235/attachment.htm>


More information about the Insight-developers mailing list