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

Compose and write field #447

Closed mathxiaobin closed 1 year ago

mathxiaobin commented 1 year ago

I am implementing some group-wise registration work and have encountered some issues. Can someone help me solve them?

  1. I would like to know how to combine the mytx['fwdtransforms'][1] and mytx['fwdtransforms'][0] from mytx = ants.registrtaion(***)into a single deformation field and save them in the nii.gz format. This deformation field will be used as the initial deformation field for another registration.
  2. How to convert a affine transformation(for example mytx['fwdtransforms'][1]; mytx = ants.registrtaion(***)) into a dense deformation field, and then save it in the nii.gz format?
cookpa commented 1 year ago

I think both of these use cases can be realized by calling ants.applytransforms as you would to apply the warp, adding the compose option, compose=/path/to/composite_warp.nii.gz.

mathxiaobin commented 1 year ago

I think both of these use cases can be realized by calling ants.applytransforms as you would to apply the warp, adding the compose option, compose=/path/to/composite_warp.nii.gz.

It's works! thank you!