[Insight-users] Insight-users Digest, Vol 74, Issue 31

Simon Warfield simon.warfield at childrens.harvard.edu
Wed Jun 16 11:36:14 EDT 2010


insight-users-request at itk.org wrote:
> Date: Wed, 16 Jun 2010 09:46:09 -0400
> From: Luis Ibanez <luis.ibanez at kitware.com>
> Subject: Re: [Insight-users] Interpolation and centered pixel
>         coordinates
> To: D?enan Zuki? <dzenanz at gmail.com>
> Cc: insight-users at itk.org
> Message-ID:
>         <AANLkTikQna2jtbdcwpMTZtWmGC5KZnEMf1dTN2_9fOY- at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> D?enan,
>
> We did quite a heavy testing when we fixed
> the problem of centered pixel coordinates.
>
> The Dashboard was green when we released
> ITK 3.18, which give us some confidence on
> the correctness of the code.
>
> --
>
> Please note that it is your responsibility to call
>
>      interpolator->IsInsideBuffer( point )
>
>   

There is a bug in the interpolator API.  The expectation of the API is 
that if the interpolator can legally address the coordinates of the 
point then all of the surrounding discrete indexes can be legally 
addressed.  Of course this is not always true, but last time I looked, 
none of the interpolators check that the discrete coordinates they look 
up are still inside the image. It is a problem for interpolation near 
the boundaries of the image.  This is particularly a problem for 
interpolators with a large window region.

--Simon


> before you call
>
>      interpolator->Evaluate( point );
>
>
> That is, your code should take the form:
>
>
>    if(    interpolator->IsInsideBuffer( p1 ) )
>       {
>       p2 = interpolator->Evaluate( p1 );
>       }
>
>
> --
>
> If you still find run-time errors, please
> post to the list a minimal code example
> that displays the problem.
>
>
>     Thanks
>
>
>         Luis
>
>
> ----------------------------------------------------------
> 2010/6/11 D?enan Zuki? <dzenanz at gmail.com>
>
>   
>> Hi everyone,
>>
>> I am running into some crashes in
>> \InsightToolkit-3.18.0\Code\Common\itkLinearInterpolateImageFunction.txx
>> (line 150), and I wonder could it be due to recent move to consistent use of
>> centered pixels (physical coordinates going from -spacing/2 to
>> (n-1)*spacing+spacing/2, instead of 0 to n*spacing). Did anyone have
>> encounters with similar problems? More specifically, does
>> TransformPhysicalPointToContinuousIndex in
>> \InsightToolkit-3.18.0\Code\Common\itkImageBase.h honor the centered pixel
>> coordinates?
>>
>> Regards,
>> D?enan
>>
>>     


-- 
Simon K. Warfield, Ph.D.
Associate Professor of Radiology
Harvard Medical School
Director of Radiology Research
Director Computational Radiology Laboratory
Department of Radiology
Children's Hospital Boston

http://www.crl.med.harvard.edu

Administrator:
  Laura Alice
  laura.alice at childrens.harvard.edu
  617-355-2755




More information about the Insight-users mailing list