Mouse-Imaging-Centre / pydpiper

Python code for flexible pipeline control
Other
24 stars 10 forks source link

Negative values and sinc/bspline interpolation #396

Open gdevenyi opened 5 years ago

gdevenyi commented 5 years ago

Some tools don't take kindly to negative values and break in unknown ways (nu_correct and inormalize come to mind). The use of sinc/bspline interpolation during resampling is still worth it, but we should be wary of negative values.

This is one way we could fix this, its what I do whenever I'm concerned about negative values during resampling:

mincmath -clamp -const2 0 $(mincstats -quiet -max resampled_image.mnc) resampled_image.mnc resampled_image_clamped.mnc