[Insight-developers] Bug 6558. PhysicalPoint to Index consisten conversions

Simon Warfield simon.warfield at childrens.harvard.edu
Wed May 6 13:43:51 EDT 2009


Luis Ibanez wrote:
> 3) About the new method IsStrictlyInside(), we struggled
>     with this one.
>
>     A central part of the patch is to have
>
>                 IsInside( ContinuousIndex )
>
>     return true for indices located at a band of
>     0.5 pixels wide all around the image grid.
>   
I see it as quite central to the representation of the voxel-centered 
physical coordinate system that the continuous index extends from
(-0.5 + voxel center) to (voxel center + 0.5)
>     However, in certain classes, when IsInside() is called,
>     (e.g. BSplines) the expectation is really that a point
>     in that external band will be considered to be outside
>     of the image grid. In that particular code, IsInside()
>     is used to compute the support of a BSpline in the
>     BSpline grid (which is itself represented as an image).
>
>   


For general usage, in itkImageFunction, and  there is IsInsideBuffer() 
for a discrete index, and an ability to 
ConvertContinuousIndexToNearestIndex.
itkImageRegion has IsInside defined for indexes to test if the index is 
strictly inside the region.

For the BSpline code, it looks like calls to InsideValidRegion are being 
used to compute an interpolation, and apparently that interpolation 
implementation is not consistent with voxel-centered coordinates. 
Perhaps the solution is to rewrite the 
itkBSplineInterpolationWeightFunction code to be consistent with 
voxel-centered coordinates.

Other places where a check for InsideValidRegion are being used for the 
BSpline code seem to be acting as nearest neighbor interpolators.
Ultimately, if the interpolator was implementing
BSplineInterpolationWeightFunction<TCoordRep, VSpaceDimension, VSplineOrder>
::Evaluate(
  const ContinuousIndexType& index ) const
at all valid continuous indexes it wouldn't be necessary to have this 
check.  It seems the problem arises because the interpolator doesn't 
handle all valid continuous indexes correctly.


--
Simon




More information about the Insight-developers mailing list