# Registration of structural and diffusion weighted data

**URL:** <https://community.mrtrix.org/t/registration-of-structural-and-diffusion-weighted-data/203>\
**Category:** Uncategorized\
**Created:** [May 4, 2016, 6:44pm UTC](https://community.mrtrix.org/t/registration-of-structural-and-diffusion-weighted-data/203 "2016-05-04T18:44:56Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Finn](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/f/e68b1a/32.png) [@Finn](https://community.mrtrix.org/u/Finn)\
**Post date:** [July 8, 2016, 1:47pm UTC](https://community.mrtrix.org/t/registration-of-structural-and-diffusion-weighted-data/203/6 "2016-07-08T13:47:48Z")

</div>

Just a comment.

Updated some old scripts that uses FLIRT for registration for this purpose. So the ref image is the highres structural image and moving image a suitable dwi image. Now with `transformconvert` you don’t have to bother with flipping dims for the subsequent `mrtransform`

So in principle it works like this:

`flirt -in mov_brain.nii.gz -ref ref_brain.nii.gz -dof 6 -omat mov2ref.mat`

`transformconvert mov2ref.mat mov_brain.nii.gz ref_brain.nii.gz flirt_import mov2ref_mrtrix.txt`

`mrtransform -linear mov2ref_mrtrix.txt -inverse ref.nii.gz new_ref.nii.gz`

Then the header qform is updated with the linear transformation (in this case only 6 dof) so that `new_ref.nii.gz` lives in moving-space.

---

_[View the full topic](https://community.mrtrix.org/t/registration-of-structural-and-diffusion-weighted-data/203)._
