iterative inverse displacement filter in ITK

(Sindhura C) #1

Are there any examples (code) where this filter is used?

(Sindhura C) #2

I found that the code for inverse deformation field is available in C:\ITK\Modules\Compatibility\Deprecated\include
After building it, I tried executing the file ITKDisplacementFieldTestDriver.exe. it gives a list of options to select . When i select one, it has to wait for me to give input . But it terminates.

(Francois Budin) #3

@EE18D504_SINDHURA_C : The executable you tried to run is a test driver. To run the actual test, you should type ctest NAME_OF_THE_TEST. This will run the executable with the appropriate arguments.

Also, there are several filters that allow you to compute the inverse of a displacement fields. You can check which one gives you a better result. One that gave me good results in the past was actually an ITK remote module ( ITKFixedPointInverseDisplacementField) which is available in ITK when setting the CMake variable Module_FixedPointInverseDisplacementField to ON.

1 Like
(Sindhura C) #4

Do you mean I should write ctest itkIterativeInverseFieldImageFilterTest ?Im still getting errors saying that “unable to create process”

(Francois Budin) #5

What you want to do is ctest -R itkIterativeInverseDisplacementFieldImageFilterTest (with ITKv5). But it really depents what you want to do. Why are you trying to run this test? Just to verify that it works?

(Sindhura C) #6

I have deformation field obtained after registration of two images. I want to find inverse deformation field for that using iterative method.


I usually use a fixed point method to invert displacement fields, something like this.

WarpImageFilter Filter = new WarpImageFilter();
Image inverse = new Image(displacementImage.GetSize(), PixelIDValueEnum.swigToEnum(displacementImage.GetPixelIDValue()));
Image mI = -displacementImage;

for (int i = 0; i < iterations; i++)
  inverse = Filter.Execute(mI, inverse); 

Its a simple approach but it works surprisingly well in many cases.

(Bradley Lowekamp) #8

As I recall that is essentially what the FixedPointInverseDisplacementFieldImageFilter does, but your version is parallel.


Yes I figured there would be a filter for it.