[Insight-users] deformation field and warping
Luis Ibanez
luis.ibanez at kitware.com
Thu Jul 20 19:40:35 EDT 2006
Hi Michelangelo,
When you resample binary images you should use the NearestNeighborhood
interpolator.
The WarpImageFilter uses by default a linear interpolator. This is the
reason why the wrapped binary image results with gray levels instead
of a single pixel displaced.
Note also that when you use the NearestNeighborhood interpolator your
output image may have more than pixel ON. This is simply because the
displacement of the pixel by the deformation field may be such that
the input pixel is overlapping two output pixels, and therefore set
both of them to ON.
Please use the SetInterpolator() method of the WarpImageFilter and
connect to it a NearestNeighborhood interpolator.
Note also that the direction of the wrapping may not be intuitive.
If you look at the code, the transformation is applied by visiting
all the pixels of the *OUTPUT* image, computing they physical location
in space, adding the displacement indicated by the deformation field
for that same pixel, and then using that resulting physical position
for interpolating a value from the input image.
For details on why this is the direction in which the deformation
field must be applied, please read the introduction to the registration
chapter of the ITK Software Guide
http://www.itk.org/ItkSoftwareGuide.pdf
Regards,
Luis
----------------------
Michelangelo Paci wrote:
> Dear list,
>
> i've a problem using some deformation fields obtained from an image
> registration. For example, when I build a binary image (only one white
> pixel in a black background) and I warp it I obtain a result (GOOD), but
> when I try to move the same white pixel (finding its phisical
> coordinates) adding the displacement to each component, I obtain another
> result (BAD). Origin and spacing are obviously the same.
> Besides I expected that when I warp a black image with only a white
> pixel, the resulting image would be another black image with a moved
> white pixel, but I obtained a black image with some grey pixels in the
> position I expeccted the white one. I read the code of warpImageFilter,
> but It seemed to me make a simple addiction of the displacement for each
> component.
>
> Could you help me, please?
>
> Thank you
>
> Mcihelangelo
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list