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
630 stars 161 forks source link

how to perform deformable registration without the affine step #333

Open HazelHik opened 2 years ago

HazelHik commented 2 years ago

Hi there,

I want to know whether it's possible that I only conduct ants.registration to get the deformable field, skipping the rigid/affine registration step. Do we have one "typeofTransform" for this ?

Thanks!

ntustison commented 2 years ago
HazelHik commented 2 years ago

Hi ntustison,

Thank you for the advice! so I can run mytx = ants.registration(fixed=fi, moving=mi, type_of_transform = 'antsRegistrationSyN*[bo]') right? What's the meaning (difference) of bo & so?

HazelHik commented 2 years ago

I tried mytx = ants.registration(fixed=fi, moving=mi, type_of_transform = 'antsRegistrationSyN*[bo]') and mytx = ants.registration(fixed=fi, moving=mi, type_of_transform = 'antsRegistrationSyN*[so]') but mytx['fwdtransforms'] still have two components, [0] is for affine and [1] is for deformable parameters. If I run:

mywarpedimage = ants.apply_transforms( fixed=fi, moving=mi,
                                               transformlist=mytx['fwdtransforms'][1])

I found the warped image not matched exactly (because I should use transformlist=mytx['fwdtransforms'] to apply affine mat as well).

What I want is a registration map that is deformable flows so I can convert it to numpy and do some further exploration. But now as all (?) the registration process contains an affine map, I can not use only the deformation flows to warp images to achieve antsSyn's performance.

ntustison commented 2 years ago

The * in antsRegistrationSyN*[bo] is simply a placeholder for the different possibilities, ie, "Quick", "Repro". You would have to specify which one you want. See the help here.