[Insight-users] bug in BSplineDeformableTransform
Stefan Klein
s.klein at erasmusmc.nl
Tue Oct 13 06:39:25 EDT 2009
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;
}
More information about the Insight-users
mailing list