[Insight-users] What is the *correct* way to downsample an image with ITK?
poireau
joelthelion at laposte.net
Mon Jun 14 09:55:25 EDT 2010
Hi Luis,
Thanks for your answer!
On 06/14/2010 02:12 PM, Luis Ibanez wrote:
> >
> > Hi Joel,
> >
> > The WindowedSinc interpolator should have taken care of
> > removing artifacts during the resampling. IF the spectrum
> > of your image can be masked by a box in the frequency
> > domain.
> >
> >
> > I don't see this interpolator being used in your code at:
> >
> http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.10&view=markup
> >
> <http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.10&view=markup>
It was added in the lastest revision:
http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/filters/clitkImageResampleGenericFilter.cxx?revision=1.11&view=markup
> >
> > How big are the squares of your checkerboard ?
> >
> > If your input image is:
> > http://www.creatis.insa-lyon.fr/~schaerer/checkerboard.png
> > <http://www.creatis.insa-lyon.fr/%7Eschaerer/checkerboard.png>
> >
> > It looks like the squares are one-pixel wide.
> > Is that the case ?
> >
> > Any sub-sampling of this image will result in the
> > overlaps of the spectrum when it gets replicated
> > due to the sampling of the coarser grid.
> >
> > Smoothing will not help here, since, there is no
> > other frequency different from the highest ones,
> > so attenuating the high frequencies doesn't
> > results in a diminished level of frequency warping.
> >
Yes, they are one pixel wide. My point of view is that a correct
subsampling algorithm should remove everything that it can't represent
at the output resolution, without making spurious structures appear. It
should also preserve the mean value of the image if it cannot preserve
the features of the image.
I agree my example is not a realistic medical image, but real images are
a combination of low and high frequencies. If the high frequencies
result in the apparition of spurious structures at low resolutions, then
we have a problem, even if it isn't as obvious as with the checkerboard
pattern.
> > BTW: This is not really an "ITK problem". :-)
> >
> > It is an "image processing" problem.
> >
> >
> > ITK provides tools, but you still have to use them
> > properly and in the case where they are applicable.
> >
> > We can't blame the hammer for not doing a good
> > job of removing a screw.
> >
I really don't want to criticize ITK, I just want to find the correct
way of doing this with it. And it seems that at the moment, it can't be
done out of the box since ITK doesn't seem to provide good low-pass
filters. I think the Gaussian can be a reasonable alternative though,
even though it's probably not the best.
Except of course if I'm missing something about the windowed sinc
interpolation function :)
joel
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/What-is-the-correct-way-to-downsample-an-image-with-ITK-tp5167122p5177528.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list