Problem in spacing and origin

Hi all,
I am using thinplate spline algorithm to deform my landmarks. I have landmarks’ coordinates in index format. The problem is that when the spacing and origin of my nrrd image are 1 and 0 respectively, the result is desirable but when I change the spacing and origin of the input image to the values that I want to have, the output image is black. Dos anyone know what is the solution?

In ITK in general, you are expected to work in physical space and not in index space, convert your indexes to physical points using the image’s TransformIndexToPhysicalPoint method then compute your thinplate spline.

When the spacing is all 1’s and origin 0’s the physical and index space coincide - this is rare for medical and microscopy images.

1 Like

Thanks for your helpful answer. Could you please let me know in thinplate spline code, the input image would be our target image?

Not sure exactly what you are asking for, in any case, here is a link to a C++ example.