ANTsX/ANTsPy

How can I use the ANTSpy to register a T1 image to all volumes of a fMRI image?

Closed this issue · 2 comments

Dear @ncullen93, @cookpa , @stnava
I have used the ants.registration function to register the T1 image of a subject to its mean image of the fMRI image. I want to apply this registered output to all volumes of the fMRI image, such that it has an fMRI image (4 dimensional) as an output in which each volume would consist of the registered image instead of the primary bold image. Could it be possible? If so, could you please guide me with an example?
Thanks in advance

The answer depends on what you did for the registration

mytx = ants.registration(fixed=t1w, moving=boldmean, ...)
ants.apply_transforms( fixed=t1w, moving=boldts, imagetype=3, transformlist=mytx['fwdtransforms'] )

Or

mytx = ants.registration(fixed=boldmean, moving=t1w, ...)
ants.apply_transforms( fixed=t1w, moving=boldts, imagetype=3, transformlist=mytx['invtransforms'] )

Thank you so much for replying. It worked well.
Thanks for your help