# How to fix lmax and fod cutoff?

**URL:** <https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307>\
**Category:** Uncategorized\
**Tags:** tractography\
**Created:** [November 13, 2017, 1:16pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307 "2017-11-13T13:16:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [November 13, 2017, 1:16pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/1 "2017-11-13T13:16:20Z")

</div>

Hi everyone,

I’m processing some ferret data (200 directions, bval 4000, voxel size 0.24 mm isotropic) and I would need help regarding fixing my lmax and cutoff of my fod.  
Do you have any advise regarding how to fix those parameters according to my dataset ?  
On which of the parameters shall I play in order to reduce the noise in my tractographies ?  
What kind of consequences can I expect if I reduce the lmax or increase the cutoff ?

Looking forward to any help that you could provide.  
Céline

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [November 14, 2017, 2:45pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/2 "2017-11-14T14:45:07Z")

</div>

> [@celinede](#):
>
> I’m processing some ferret data (200 directions, bval 4000, voxel size 0.24 mm isotropic) and I would need help regarding fixing my lmax and cutoff of my fod.  
> Do you have any advise regarding how to fix those parameters according to my dataset ?

I would personally stick to the defaults, and not modify these parameters unless there were very specific reasons to change them. Nowadays, this means the response is estimated to _l_max=10, the FOD to _l_max=8.

> [@celinede](#):
>
> What kind of consequences can I expect if I reduce the lmax or increase the cutoff ?

Reducing _l_max will mean broader FODs, which make make the FODs look less noisy, but also introduce more dispersion in your subsequent tractography (at least if using probabilistic tractography), and hence make the tractography more messy. So you’re probably best sticking with the defaults from that point of view.

Reducing the cutoff means allowing the tractography to follow smaller FOD amplitudes, and so increase the chances of following spurious, noise-induced peaks. So reducing the cutoff allows more unlikely streamlines to be produced, while increasing it prevents potentially real connections from being identified. As is often the case with tractography, it’s a compromise between sensitivity and specificity… Again, I wouldn’t change the default value unless there was clear evidence that it was necessary – e.g. if small known tracts are not reconstructed using the default value, but do show up using a reduced cutoff, for example.

---

<div class="post-metadata">

**Author:** ![Kar](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/k/ed655f/32.png) [@Kar](https://community.mrtrix.org/u/Kar)\
**Post date:** [November 15, 2017, 9:23am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/3 "2017-11-15T09:23:04Z")

</div>

Just to to add my few cents 😉 I have been processing rodent brains with 60 directions using an lmax of 8 for general analysis. However, if you are planning to use a template then using a lower value (lmax 4) helps in better registration as the fods are less noisy!  
Also, an fod cutoff of 0.1 (which is the default) does a fine job 🙂

---

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [November 20, 2017, 10:23am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/4 "2017-11-20T10:23:48Z")

</div>

Thanks for your answers !

I meant increase the fod cutoff, not decrease.

I attach 2 sagittal views of my csd/SD tractographies, so that you can see better the kind of noise that I get (those very small pieces of streamlines mainly on the edge of the brain).

Both tractographies with lmax=8, then 1st picture cutoff=0.1, 2nd cutoff=0.2

 ![F01_CSD_l8_thr01](https://community.mrtrix.org/uploads/default/original/1X/ff79a4f2b82d1381b6a90719143f4fe7715152ef.png)  
 ![F01_CSD_l8_thr02](https://community.mrtrix.org/uploads/default/original/1X/db43e3e959f1a7f1ff4294f229bcd05dc46a0c25.png)

---

<div class="post-metadata">

**Author:** ![Kar](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/k/ed655f/32.png) [@Kar](https://community.mrtrix.org/u/Kar)\
**Post date:** [December 1, 2017, 7:59am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/5 "2017-12-01T07:59:10Z")

</div>

What are the other parameters (no.of streamlines, step size, min/max length…?)

---

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [December 1, 2017, 9:37am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/6 "2017-12-01T09:37:06Z")

</div>

My parameters are the following:

- Response tournier
- Fod csd
- tckgen SD\_STREAM, 100000 streamlines

For the rest I’ve left the default values, which gives:

- step size: 0.1x0.24 = 0.024
- min/max length: min 5x0.024 = 0.12 ; max 100x0.024 = 2.4

---

<div class="post-metadata">

**Author:** ![Kar](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/k/ed655f/32.png) [@Kar](https://community.mrtrix.org/u/Kar)\
**Post date:** [December 1, 2017, 10:08am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/7 "2017-12-01T10:08:02Z")

</div>

Safely assuming your voxel size to be 0.24 mm isotropic 😉 I would increase the min length to 1x or 2x voxel size (0.24 or 0.5) and increase the no. of streamlines to a few million (to start with) to increase SNR since you are generating shorter tracks!

---

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [December 1, 2017, 11:00am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/8 "2017-12-01T11:00:54Z")

</div>

That doesnt really help …  
Attached is a picture from an axial view with min length=0.24, still 100000 streamlines as it’s easier to see what’s happening. I’ve also tried with 1 Million, it’s the same but more packed. Also tried min length = 0.48.  
I always have some streamlines weirdly crossing the whole brain, like those orange ones going in diagonal and green going in the other direction.

 ![09](https://community.mrtrix.org/uploads/default/original/1X/e4b9bee6c2945a83c4bba7aca6e7e9fbf8f9c4bb.png)

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [December 1, 2017, 4:27pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/9 "2017-12-01T16:27:58Z")

</div>

I assume these are _ex vivo_ data? In which case, I’d recommend having a look through [this recent post](https://community.mrtrix.org/t/estimate-response-function-for-multi-shell-ex-vivo-marmoset-data/1018/2?u=jdtournier) on the issue.

In general, your results do look quite noisy, can you post some example raw DWI images screenshots so we can get a feel for the data? Also, are you using `dwidenoise` on these data? If not, it would definitely be worth thinking about (along with `mrdegibbs` to remove Gibbs ringing artefacts).

Also, it may help to try to use multi-tissue CSD. Give `dwi2response dhollander` a go, and if that works, try a WM + GM 2-tissue CSD, using [dwi2fod](http://mrtrix.readthedocs.io/en/latest/reference/commands/dwi2fod.html) with the `msmt_csd` algorithm (this assumes you have no signal from CSF).

---

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [December 6, 2017, 10:10am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/10 "2017-12-06T10:10:37Z")

</div>

Thank you very much for your answer !

Yes these are ex-vivo data.  
My preprocessing pipeline includes: denoising, gibbs rigging, eddy current and bias corrections.  
I attach an image of my b4000 after preprocessing.

 ![15](https://community.mrtrix.org/uploads/default/original/1X/473c378299d70cebe527c2f561dfeb7c783e8a2d.jpg)

I have given a try to dhollander and the manual selection of voxels.  
They both worked nicely and somehow equivalently for this adult ferret.

 ![03](https://community.mrtrix.org/uploads/default/original/1X/823af2eee254f92a1ed564a9ee1770130fdea1f8.jpg)

I also have younger ones with less contrast for which the detection of the different tissues is a bit more tricky.  
Do you have any advice on which parameter to play on for dhollander or manual in order to improve the GM/WM detection ?

 ![51](https://community.mrtrix.org/uploads/default/original/2X/b/bdf9a84dd976c70b93da692da44fd6a3a9eba36a.jpg)  
 ![59](https://community.mrtrix.org/uploads/default/original/2X/6/6ff3086aee65f064e7dcff9ed63a2d4b9385267c.jpg)

Is there any influence from the number of voxels that I select ? Is it important to keep this number constant ?

---

<div class="post-metadata">

**Author:** ![ThijsDhollander](https://community.mrtrix.org/user_avatar/community.mrtrix.org/thijsdhollander/32/1617_2.png) [@ThijsDhollander](https://community.mrtrix.org/u/ThijsDhollander)\
**Post date:** [December 7, 2017, 6:04am UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/11 "2017-12-07T06:04:24Z")

</div>

Hi @celinede,

Looking at this screenshot:

> [@celinede](#):
>
> I always have some streamlines weirdly crossing the whole brain, like those orange ones going in diagonal and green going in the other direction.
> 
> [http://community.mrtrix.org/uploads/default/original/1X/e4b9bee6c2945a83c4bba7aca6e7e9fbf8f9c4bb.png](http://community.mrtrix.org/uploads/default/original/1X/e4b9bee6c2945a83c4bba7aca6e7e9fbf8f9c4bb.png)

…I share your concern about the orange-y streamlines running through there. I’m not really sure, but this may be due to one (messed up) outlier volume in the acquisition… That, or some uncorrected motion or something. While multi-tissue CSD will help a lot to get rid of noisy tracks in general, these orange-y ones may still (partially) remain, as they seem to show some orientational bias/issue.

On to the MSMT-CSD using responses from the `dhollander` algorithm then: this should work mostly out of the box. As well as the post that @jdtournier linked to, I can also advise you to take a look at this one: [Multi-tissue CSD](http://community.mrtrix.org/t/multi-tissue-csd/1268)

For ex-vivo data, or in general data with particularly low anisotropy due to ex-vivo-ness, unmyelinated / partial myalination due to development / very low b-value / … or any combination of those, it may be worthwhile to specify the `-fa` option to the `dwi2response dhollander` algorithm. By default, that’s set to 0.2, but you could try to lower it to e.g. 0.1, or anywhere in the range between 0.1 and 0.2. Given your b-value, the fact that it’s ex-vivo, and the fact that it’s a ferret, hmm, it’s a bit of everything. Maybe give the `-fa` option a gentle push to 0.15 or something. I reckon you should be good either way.

Also, in that post I linked to above, take a look at how you can visualise the voxels that the `dhollander` algorithm selects. The WM, and probably the CSF as well, shouldn’t be an issue; but definitely take a look at where the GM voxels for the GM response are selected from, and see if they’re in sensible (GM) regions. Looking at your actual MSMT-CSD result with WM and GM response functions, I note that does look pretty good already! In general, I would definitely more and more encourage to go with an automated algorithm for response function selection. I’ve come to notice that, while `manual` does allow full control, a human isn’t particularly good at all times to select the best voxels for response function estimation. The `dhollander` algorithm (if I say so myself 😇) does a pretty good job over a wide range of data qualities and kinds of data (human, animal, in/ex-vivo, …who knows what else I’ve been looking into 😉). I’ve got another improvement in the works, which should see daylight soon… stay tuned.

> [@celinede](#):
>
> Is there any influence from the number of voxels that I select ? Is it important to keep this number constant ?

For the automated `dhollander` algorithm: no, that doesn’t matter so much. The defaults here are entirely appropriate for any situation I’ve tested so far. If you go manual, definitely make sure you select at least a “decent” number of voxels; if only to “correct” a bit for the less good ones you may naturally select as well. For your data at hand, maybe at least a good 100 or so voxels wouldn’t be a bad idea. But again, you may want to leave this task to the automated algorithm instead…

---

<div class="post-metadata">

**Author:** ![celinede](https://community.mrtrix.org/user_avatar/community.mrtrix.org/celinede/32/1225_2.png) [@celinede](https://community.mrtrix.org/u/celinede)\
**Post date:** [December 7, 2017, 12:36pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/12 "2017-12-07T12:36:35Z")

</div>

Thank you very much for your advice !

For some reason I had understood from jdtournier that I had to use the WM and GM for computing the fod, but when I have a look at other posts, you usually advise to use the WM and CSF.  
Are both possible ?

So I have given a try to the WM and CSF. The rgb images look pretty fine, however for some very young ferrets the voxels from the grey and white matter are not properly localised.  
Is that a problem, considering that I use only the WM and CSF, so the GM is somehow included in the WM ?

 ![38](https://community.mrtrix.org/uploads/default/original/2X/7/70176533bd6dae17f71c855c355ce6d638243963.jpg)

And regarding my noisy orange-y streamlines, I only get them when I use SD\_STREAM, so when I use the default iFOD2 it looks fine.  
See below, the tractography for my adult ferret with dhollander.

 ![02](https://community.mrtrix.org/uploads/default/original/2X/2/2d5cc5854015c17c9a2466cf05b5f915544dff6f.png)

---

<div class="post-metadata">

**Author:** ![ThijsDhollander](https://community.mrtrix.org/user_avatar/community.mrtrix.org/thijsdhollander/32/1617_2.png) [@ThijsDhollander](https://community.mrtrix.org/u/ThijsDhollander)\
**Post date:** [December 7, 2017, 11:33pm UTC](https://community.mrtrix.org/t/how-to-fix-lmax-and-fod-cutoff/1307/13 "2017-12-07T23:33:47Z")

</div>

> [@celinede](#):
>
> For some reason I had understood from jdtournier that I had to use the WM and GM for computing the fod, but when I have a look at other posts, you usually advise to use the WM and CSF.
> 
> Are both possible ?

Both are possible. I post I referred you to, were mostly to help with the response function selection (and the `-fa` parameter in the `dhollander` algorithm). Getting the response functions (the whole triplet of single-fibre WM, GM and CSF response functions) is still independent from the ones you choose to use thereafter in the MSMT-CSD.

As to the choice of the second tissue type being GM or CSF: that depends on your application. Optimally, you’d always want all 3 of them, but to be able to do that from just single-shell data, you need single-shell 3-tissue CSD (SS3T-CSD)… which is not yet available publicly (but I’m working on that!). So in the absence of that one, you need to choose which of GM or CSF is less important for your application. The reason @jdtournier probably suggested GM here, is because the data are ex-vivo, so CSF in the ventricles or surrounding the brain is probably no longer an “issue”. However, if you’re interested in careful interpretation of the microstructure, the value of the CSF is still there, should these animals suffer from some kind of pathology or still be in early development.

However, if you mostly need a very clean FOD for tractography, the GM is your main concern, as it’ll severely mess up the quality of your WM FODs if the GM response function isn’t included in the model. So given the information we’ve got here about your application, a WM+GM model seems the most sensible choice!

> [@celinede](#):
>
> however for some very young ferrets the voxels from the grey and white matter are not properly localised.

That’s exactly what I would expect indeed. For these young animals, you may need to lower the `-fa` parameter. I’m not an expert in ferret anatomy, so it’s hard to judge for me from that last screenshot, since the underlying map shows WM and CSF (so hard to localise GM and “validate” whether the green voxels for the GM response are in decent locations). To evaluate this, I’d recommend overlaying those voxels on the anatomical T1 volumes you’ve shown before. Or even better, do it the other way around: open the voxels at the main image, load the T1 as an overlay and set the overlay colour scale to grey (default is hot otherwise), and make it a bit transparent with the opacity slider in the overlay tool.

Especially if you find that the GM voxels are in actual WM tissue, lowering the `-fa` parameter would be advised. But do it in small steps and evaluate the result until it looks right (or at least better).

Depending on what you intent to analyse thereafter, another advice could/would be to use the same set of response functions for all your animals. In that case, I would only get the response functions from the more mature ferrets, and average them per tissue type across the more mature animals, resulting in single averaged WM, GM (and CSF, but you wouldn’t be using this one) response functions. This may make tractography slightly harder in the younger animals, but may make the FOD more _meaningful_.

Contact me privately if you want to look further down this avenue. There’s a few further insights and developments that I can’t disclose publicly yet here; but it would depend of course on what your goal is in this analysis / project.
