[Insight-users] Upsampling with constant boundary condition

Matt McCormick matt at mmmccormick.com
Tue May 10 11:21:15 EDT 2011


Hi Jan,

> 
> Hi all, Is there a way (in ITK 3.20) to upsample an image with constant 
boundary condition using linear interpolator? It happens that when I upsample, 
my last frame and/or last slice are set to 0
>  (or any other value that I specify with "SetDefaultPixelValue(0)" 

IMHO, ResampleImageFilter needs an ExtrapolateImageFunction in addition to an 
InterpolateImageFunction.

http://www.itk.org/Doxygen/html/classitk_1_1ExtrapolateImageFunction.html

Otherwise, in order to get that functionality, custom classes have to be created 
that involve a lot of copy/pasted code and are not very flexible, e.g.,

http://www.itk.org/Doxygen/html/classitk_1_1VectorLinearInterpolateNearestNeighb
orExtrapolateImageFunction.html

I should have some time in about a week or two, and I can give this a go.  I can 
make a patch, give it to the ITK developers for comment, and include you for 
testing if you would like.


> in the resampler since it shoots out of the range of the input image). As far 
as I could find, the WindowedSincInterpolateImageFunction is the only one that 
has support for boundary conditions.

I believe the boundary condition are only used if the center of the resampled 
location falls within the image and part of the windowed-sinc kernel falls 
outside the image.

Matt



More information about the Insight-users mailing list