Hi Matt, <br><br>Thanks for the response and the pointer to the VectorLinearInterpolateNearestNeighborExtrapolateImageFunction. <br>This class indeed seems to be doing what i would need but just for vector images. <br><br>
I can only agree the need for support of both inter and extrapolation in the<br>
ResampleImageFilter. Will be glad to help with the testing.<br><br>For now, I will try to convert my images to singlechannel vector image<br>and resample them with the vector interextrapolator (while having some performance loss).<br>
<br>Many thanks, <br><br>Jan<br><br><br><br><br><div class="gmail_quote">On Tue, May 10, 2011 at 5:21 PM, Matt McCormick <span dir="ltr"><<a href="mailto:matt@mmmccormick.com" target="_blank">matt@mmmccormick.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jan,<br>
<div><br>
><br>
> Hi all, Is there a way (in ITK 3.20) to upsample an image with constant<br>
boundary condition using linear interpolator? It happens that when I upsample,<br>
my last frame and/or last slice are set to 0<br>
> (or any other value that I specify with "SetDefaultPixelValue(0)"<br>
<br>
</div>IMHO, ResampleImageFilter needs an ExtrapolateImageFunction in addition to an<br>
InterpolateImageFunction.<br>
<br>
<a href="http://www.itk.org/Doxygen/html/classitk_1_1ExtrapolateImageFunction.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1ExtrapolateImageFunction.html</a><br>
<br>
Otherwise, in order to get that functionality, custom classes have to be created<br>
that involve a lot of copy/pasted code and are not very flexible, e.g.,<br>
<br>
<a href="http://www.itk.org/Doxygen/html/classitk_1_1VectorLinearInterpolateNearestNeighb%0AorExtrapolateImageFunction.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1VectorLinearInterpolateNearestNeighb<br>
orExtrapolateImageFunction.html</a><br>
<br>
I should have some time in about a week or two, and I can give this a go. I can<br>
make a patch, give it to the ITK developers for comment, and include you for<br>
testing if you would like.<br>
<div><br>
<br>
> in the resampler since it shoots out of the range of the input image). As far<br>
as I could find, the WindowedSincInterpolateImageFunction is the only one that<br>
has support for boundary conditions.<br>
<br>
</div>I believe the boundary condition are only used if the center of the resampled<br>
location falls within the image and part of the windowed-sinc kernel falls<br>
outside the image.<br>
<br>
Matt<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div>