KCL-BMEIS / niftyreg

This project contains command line tools to perform rigid, affine and non-linear registration of nifti or analyse images as well as utilities
BSD 3-Clause "New" or "Revised" License
132 stars 41 forks source link

Warped image intensity range larger than floating image intensity range with default reg_aladin parameter (linear resampling) #41

Open pritesh-mehta opened 5 years ago

pritesh-mehta commented 5 years ago

I am doing a rigid registration of an ADC map to a T2 MRI using reg_aladin. The only optional parameter I set is -rigOnly. The source code for reg_aladin appears to show the default resampling scheme is linear. However, my original ADC map has a minimum intensity of 0 while my registered ADC map has a minimum intensity of -154. My understanding of linear resampling is that the registered ADC map should not have intensities outside the range of the original ADC map.

fepegar commented 5 years ago

Pasting some relevant lines after discussion with @pmehta1203 trying to figure out if default interpolation was linear:

https://github.com/KCL-BMEIS/niftyreg/blob/f673b7837c0824f55dedb1534b32b55bf68a2823/reg-apps/reg_aladin.cpp#L161

https://github.com/KCL-BMEIS/niftyreg/blob/f673b7837c0824f55dedb1534b32b55bf68a2823/reg-lib/_reg_aladin.h#L255-L258

mmodat commented 5 years ago

The interpolation is set to linear during the registration optimisation, but the final interpolation to generate the final warped image is cubic interpolation. If needed, we could add another parameter to user-specify the order of the final interpolation.

pritesh-mehta commented 5 years ago

A parameter to specify the order of the final interpolation would be great. Thanks!