ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
628 stars 161 forks source link

Transform deformation field to displacement field #186

Closed myldh33 closed 4 years ago

myldh33 commented 4 years ago

Hi,

After registration, we can obtain and save the deformation field.

How about displacement field? can we convert the deformation field to displacement?

And can we save displacement field as Numpy Array?

Thanks

stnava commented 4 years ago

ants produces displacement fields as outputs along with affine transformations. both are defined according to ITK standards in the image physical space, not voxel space.

you can convert to numpy and save numpy arrays in the standard way.

myldh33 commented 4 years ago

Thanks for replying Do you mean first data in fwdtransform is displacement, and second is deformation?

stnava commented 4 years ago

it depends. please read documentation more thoroughly and run some of the examples.

if it's called *Warp then it's a displacement field. otherwise affine.

stnava commented 4 years ago

see https://github.com/ANTsX/ANTs/wiki/Anatomy-of-an-antsRegistration-call

and also https://github.com/ANTsX/ANTs/wiki/Forward-and-inverse-warps-for-warping-images,-pointsets-and-Jacobians