# Registering T1 to dwi and running ROI to ROI analysis

**URL:** https://community.mrtrix.org/t/registering-t1-to-dwi-and-running-roi-to-roi-analysis/3590
**Category:** Uncategorized
**Created:** [April 29, 2020, 1:48pm UTC](https://community.mrtrix.org/t/registering-t1-to-dwi-and-running-roi-to-roi-analysis/3590 "2020-04-29T13:48:31Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [May 3, 2020, 1:25pm UTC](https://community.mrtrix.org/t/registering-t1-to-dwi-and-running-roi-to-roi-analysis/3590/2 "2020-05-03T13:25:35Z")

</div>

Welcome Mason!

> I was hoping for some advice on how to register my T1 anatomical scan to the dwi data (Flirt/fnirt would be my first guess, but if the MRtrix community advise another package, please let me know),

We unfortunately still do not have the capability to naively register images of different modalities within _MRtrix3_; so yes, most people revert to using FSL `flirt` for this purpose. The most recent example is in [this thread](https://community.mrtrix.org/t/image-corregistration-error-in-act-with-5tt-and-dw-image/3582). You don’t want to be using `fnirt` as one does not expect there to be non-linear distortions between two images of the same brain taken minutes apart.

Given the prevalence of this processing step, it could perhaps do with its own Wiki entry? Alternatively it wouldn’t be too hard for anyone to write a script within the _MRtrix3_ Python API to automate precisely this process 😉🤞

> … use these for the ROI to ROI analysis. Which brings me onto my next question. Does anyone have any advice on the best way to do this?

> `tckgen wmfod.mif MTtracks.tck -seed_image lh_MTroi_dwiSpace.mif -mask mask.mif -select 100k`

> I also assume this would be the tracks running through this ROI and not necessarily the ROI to ROI tracks?

Correct. The only constraint that you are providing to `tckgen` that relates to your specific hypothesis is that you want the streamlines to start in the left hemisphere ROI; it is entirely oblivious at that point to the existence of a homologous ROI. Most likely you want to be using the `-include` option in `tckgen`, as documented [here](https://mrtrix.readthedocs.io/en/latest/reference/commands/tckgen.html#region-of-interest-processing-options). Note that while it’s also technically possible to generate streamlines emanating from one ROI using `tckgen -seed_image` and then select only those streamlines intersecting another ROI using `tckedit -include` (and you might find discussions on this elsewhere on the forum), doing both steps in `tckgen` is a little bit simpler.

> I also see track numbers in the order of 10 million, not 10K as per the tutorials. Is this simply altered by changing the -select 100k to -select 10m?

10 million is a pretty arbitrary number that is often used for whole-brain tractography if one wants the streamline counts of _all_ individual white matter bundles of interest to have reasonable quantities of streamlines. If you are only reconstructing one specific pathway, you don’t need anywhere near that number. Indeed even 100k is probably overkill for targeted tracking. Go with the tutorial’s 10k, and make an assessment from there.

> For completeness here is each step I currently take:

That all looks pretty standard.

One caveat maybe to be aware of, just in case you’re copy-pasting the tutorial that is written assuming a certain type of data rather than tailoring for your own: Generating the file “`b0s.mif`” currently assumes strongly that the first volume in each image series is a _b_=0 image, and weakly that this is the _only_ _b_=0 volume present in each series. A more robust approach is to use `dwiextract -bzero`, which will examine the diffusion gradient table to find which images are _b_=0’s. If you have multiple _b_=0 volumes within each series, this may make estimation of the susceptibility distortion field a little more robust.

Another is that in your `tckgen` call, you’re providing your brain mask image as a _seed_ image - meaning that all streamlines generated will have been _initiated_ within that image - but you are _not_ additionally providing that image as input to the `-mask` option, which would otherwise constrain the streamlines to _propagate_ only within that mask. So with your current usage it’s possible that you might actually observe some streamline vertices outside of your brain mask.

Rob

---

_[View the full topic](https://community.mrtrix.org/t/registering-t1-to-dwi-and-running-roi-to-roi-analysis/3590)._
