Mrregister Output waprs

Hi All,

I was just wondering how the command mrregister -nl warp1 warp2 as outlined in the documentation outputs the two individual warps. I want to save each of these warps to use later in the script.

The documentation does not make this particularly clear.

Best Wishes

Hi Dan,

The correct option is -nl_warp. I guess the part of the docs you’re referring to is

-nl_warp warp1 warp2 the non-linear warp output defined as two deformation fields, where warp1 can be used to transform image1->image2 and warp2 to transform image2->image1. The deformation fields also encapsulate any linear transformation estimated prior to non-linear registration.

In the example, warp1 is an image that you can name as you wish. For instance:

mrregister 1.mif 2.mif -nl_warp warp1to2.mif warp2to1.mif

Then you can use the warps, for instance, to transform 1.mif to the space of image 2.mif:
mrtransform 1.mif -warp warp1to2.mif -template 2.mif 1at2.mif

These two commands would be equivalent (except for differences caused by floating point number precision issues) to: mrregister 1.mif 2.mif -nl_warp warp1to2.mif warp2to1.mif -transformed 1at2.mif

Note that if you wanted to warp both images to the midway space of 1.mif and 2.mif then you’d need to store the full 5D warp image. We call the 5D warps warp_full in mrregister and mrtransform.

Hope that helps,

1 Like