[Insight-users] bug in BSplineDeformableTransform

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 19 13:17:31 EDT 2009


Hi Stefan,

Thanks for looking at this code.

Yes, this looks like a bug.
Please file a bug report in the MANTIS bug tracker.

Would you like to take a first crack at fixing it ?

It may involve adding a test for both Even and Odd
Spline orders...


  Please let us know,


       Thanks


            Luis


--------------------------------------
On Tue, Oct 13, 2009 at 6:39 AM, Stefan Klein <s.klein at erasmusmc.nl> wrote:
> Dear Luis,
>
> The itk::BSplineDeformableTransform::InsideValidRegion seems to be incorrect
> (see below). It always returns true if
> ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY is turned ON, in combination
> with an even spline order. Should I file a bug report?
>
> Kind regards,
> Stefan.
>
>
> template<class TScalarType, unsigned int NDimensions, unsigned int
> VSplineOrder>
> bool
> BSplineDeformableTransform<TScalarType, NDimensions, VSplineOrder>
> ::InsideValidRegion(
>  const ContinuousIndexType& index ) const
> {
>  bool inside = true;
>
> #ifndef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY
>  if( !m_ValidRegion.IsInside( index ) )
>    {
>    inside = false;
>    }
> #endif
>
>  if ( inside && m_SplineOrderOdd )
>    {
>    typedef typename ContinuousIndexType::ValueType ValueType;
>    for( unsigned int j = 0; j < SpaceDimension; j++ )
>      {
>      if ( index[j] >= static_cast<ValueType>( m_ValidRegionLast[j] ) )
>        {
>        inside = false;
>        break;
>        }
> #ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY
>      if ( index[j] < static_cast<ValueType>( m_ValidRegionFirst[j] ) )
>        {
>        inside = false;
>        break;
>        }
> #endif
>      }
>    }
>
>  return inside;
> }
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list