# Combine full warps

**URL:** <https://community.mrtrix.org/t/combine-full-warps/2363>\
**Category:** Uncategorized\
**Created:** [March 16, 2019, 6:14am UTC](https://community.mrtrix.org/t/combine-full-warps/2363 "2019-03-16T06:14:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goku](https://community.mrtrix.org/user_avatar/community.mrtrix.org/goku/32/1854_2.png) [@Goku](https://community.mrtrix.org/u/Goku)\
**Post date:** [March 16, 2019, 6:14am UTC](https://community.mrtrix.org/t/combine-full-warps/2363/1 "2019-03-16T06:14:21Z")

</div>

Hi,

I’m trying to take a subjects full warp to an FOD template and combine it with another full warp.  
I am aware transformcompose can take separate affines and nonlinear warps and combine them but it doesn’t work with the full warps.

Is it possible to combine the full warps that contain the affine and the nonlinear warp? Or maybe decompose them so that transformcompose works?

Thanks

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [March 17, 2019, 6:09am UTC](https://community.mrtrix.org/t/combine-full-warps/2363/2 "2019-03-17T06:09:37Z")

</div>

Hi @Goku

I’m pretty sure you want to be looking at ~~`transformconvert`~~ `warpconvert` (🤦‍♂️) to extract from the full warp format only the specific warp in which you are interested, such that you can then compose it with other transformations.

Rob

---

<div class="post-metadata">

**Author:** ![Goku](https://community.mrtrix.org/user_avatar/community.mrtrix.org/goku/32/1854_2.png) [@Goku](https://community.mrtrix.org/u/Goku)\
**Post date:** [March 19, 2019, 5:49am UTC](https://community.mrtrix.org/t/combine-full-warps/2363/3 "2019-03-19T05:49:24Z")

</div>

That’s not it either. It says transformconvert is for converting linear transforms in ITK and FSL into a mrtrix format. I can recompute the transforms using mrregister and save the affine and the nonlinear warp out separately but was seeing if there was an easier and faster way then rerunning mrregister.

---

<div class="post-metadata">

**Author:** ![maxpietsch](https://community.mrtrix.org/user_avatar/community.mrtrix.org/maxpietsch/32/25_2.png) [@maxpietsch](https://community.mrtrix.org/u/maxpietsch)\
**Post date:** [March 19, 2019, 8:12am UTC](https://community.mrtrix.org/t/combine-full-warps/2363/4 "2019-03-19T08:12:08Z")

</div>

Hello @Goku,

You can not compose full 5D warps as they are defined in their respective midways space and we currently have no tools to estimate the midway space between two arbitrary warps. As Rob points out, you can, however, combine 4D deformation fields via using `transformcompose`. To convert full warps to deformation fields, you’d use [`warpconvert`](https://mrtrix.readthedocs.io/en/latest/reference/commands/warpconvert.html):

For a transformation chain from image 1 to image 2 with target 3 this should (not tested) extract and combine the linear and nonlinear transformations:

`warpconvert warp_full_1to2.mif warpfull2deformation -template image2.mif -from 1 deformation_1to2.mif`  
`warpconvert warp_full_2to3.mif warpfull2deformation -template image3.mif -from 1 deformation_2to3.mif`

`transformcompose deformation_1to2.mif deformation_2to3.mif deformation1_to3.mif`

Max

---

<div class="post-metadata">

**Author:** ![mschira](https://community.mrtrix.org/user_avatar/community.mrtrix.org/mschira/32/2917_2.png) [@mschira](https://community.mrtrix.org/u/mschira)\
**Post date:** [December 5, 2023, 4:05am UTC](https://community.mrtrix.org/t/combine-full-warps/2363/5 "2023-12-05T04:05:54Z")

</div>

Hi Max  
I think I have the same problem, or at least something very similar.  
I have a full warp from the population\_template process.  
I want to apply these two in a single mrtransform step.

 ![FullWarp](https://community.mrtrix.org/uploads/default/original/2X/d/d6633d8c6bd56eb3ad3826e89ad0c4dc768b294f.png)
