# FBA analysis pipeline help

**URL:** https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276
**Category:** Uncategorized
**Tags:** fba
**Created:** [October 29, 2017, 12:39pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276 "2017-10-29T12:39:58Z")
**Posts on this page:** 20
**Page:** 1

<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: [October 29, 2017, 12:39pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/1 "2017-10-29T12:39:58Z")

</div>

Hi,

I am performing FBA using warps generated from ANTS using the instructions: [Registration: using transformations generated from other packages](https://community.mrtrix.org/t/registration-using-transformations-generated-from-other-packages/2259)

I want to apply FOD modulation during this step (which also requires FOD reorientation to be performed as default).

However, in the FBA multi shell analysis pipeline, reorientation is performed in a subsequent step using the fixel images (not while warping the fods).

So, can I perform modulation + reorientation while waping the FOD’s and skip this step in my analysis?

Regards,  
Karthik

---

<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: [October 29, 2017, 11:39pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/2 "2017-10-29T23:39:04Z")

</div>

> [@Kar](#):
>
> So, can I perform modulation + reorientation while waping the FOD’s and skip this step in my analysis?

Yep, that should work. Reorientation can be performed either while warping the FODs, or either subsequently as a direct reorientation of the fixels. Don’t do both though, of course. Either the one, or the other. 😉

As to modulation: if you do that, then your subsequent stats will be stats of the FDC (not the FD). If you don’t do that, you can still do FD and FC separately, and multiply them to obtain FDC (as done in the manual). In that way, you’ve got all 3 of them, separately, at your disposal.

So essentially: modulation should _not_ be needed, unless you want to directly obtain FDC, and FDC only.

---

<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: [October 30, 2017, 4:55pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/3 "2017-10-30T16:55:11Z")

</div>

Thanks, I would need to compute FD, FC and FDC 😉

Continuing with the FBA, I computed the voxel and analysis fixel mask. After playing with several thresholds, I realized that there is no optimum value for the rat brains 🤨 (too high threshold tends to cut off the white matter areas and induce holesl!)

However, in trying to include the wm areas, size of the analysis fixel mask looks enormous…

 ![fixel_mask0000](https://community.mrtrix.org/uploads/default/original/1X/ab184a95bd7d853713e389de88a68dac8201478e.png) ![Capture](https://community.mrtrix.org/uploads/default/original/1X/ff21dbf20f1a704fae7023fefd9b7e381770bbda.PNG)

Looking forward to your comments 🙂

Karthik

---

<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: [October 30, 2017, 11:33pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/4 "2017-10-30T23:33:37Z")

</div>

> [@Kar](#):
>
> After playing with several thresholds, I realized that there is no optimum value for the rat brains

Well, that’s rather “no optimum for 2-tissue CSD”, aggravated by the context being a rat brain with massive grey matter volume. 😉 You could always try to manually mask out some of the gray matter areas; the benefit of the rat is that it’s at least not as folded as in a human…

But this would more naturally be solved in 3-tissue CSD, where a lot of the signal that creates “false” WM FD in the rat cortex would be filtered out. As it stands, there is indeed not a single threshold that will work globally in your case.

I do agree your threshold needs to of course be low enough so as to _not_ exclude _actual_ WM. So for the 2-tissue case at hand, I think the best option would be the manual masking out of some volumes of GM as I mentioned…

---

<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: [October 31, 2017, 6:00pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/5 "2017-10-31T18:00:42Z")

</div>

I managed to make a white matter mask by thresholding the warped fa images, and then created a analysis fixel mask. It still includes some gm though 🙂

 ![screenshot0000](https://community.mrtrix.org/uploads/default/original/1X/08bf062c77e21fa7fbed704e7f277ea1fd9e4ed7.png)

Let’s see how this pans out 😉

---

<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: [October 31, 2017, 10:46pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/6 "2017-10-31T22:46:11Z")

</div>

Looks reasonable, but always be careful when thresholding FA: you may (all too) easily mask out crossing WM areas, some which may have lower FA values than the (still relatively oriented) GM. So well, always quality-check the result. 🙂

It’s better to be on the safe side, and still include some GM (while still removing the massive bulk of it), rather than throw out WM. Even throwing out WM fixels that weren’t going to come out as significant in your analysis may still inadvertently impact the results in nearby fixels if there was a genuine (though not per se significant) effect in them: nearby fixels’ effects boost each other via the connectivity-based fixel enhancement.

So long story short: make sure you’ve definitely got a nice _complete_ WM mask. 😉

---

<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 1, 2017, 5:59pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/7 "2017-11-01T17:59:25Z")

</div>

Ok, thanks! I will run the analysis with this mask, and keep you posted 😉

---

<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 3, 2017, 9:03pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/8 "2017-11-03T21:03:20Z")

</div>

Quick update!

I ran the CFE analysis for computing FD… But, it crashed at some point due to memory issues!

I just looked at the documentation and it says that one must downsample the fod template prior to fba in such a scenario.

So, should I downsample all the other coregistered animals aswell or just the template?

Thanks 🙂

---

<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: [November 4, 2017, 7:40am UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/9 "2017-11-04T07:40:27Z")

</div>

> [@Kar](#):
>
> memory issues!

> [@Kar](#):
>
> one must downsample the fod template prior to fba in such a scenario

Yeah, so essentially you’ve got too many fixels in your template fixel analysis mask for the amount of memory your machine has. I’m not sure if you’re close to realistic numbers, or still far off, but downsampling the template is the way to go.

The most (scientificially) optimal way of fixing things at this stage is to redo everything from the template building step and onwards: so not just modifying some things in between, but really deleting everything from there onwards an redoing the steps, otherwise you’ll get yourself in trouble in difficult to diagnose ways. By the time you’ve got that sorted out, letting everything automatically re-run was already going to be faster and much cleaner.

What you want to do is thus, when you build the template, indicate a larger voxel size to build the template at.

Either that, or buy some more memory. 😉 …or run in on a more appropriate computer / computing environment, if you’re not already doing so.

---

<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 4, 2017, 11:25pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/10 "2017-11-04T23:25:08Z")

</div>

Ok, downsampling the data by a factor of 2 (from 75 um) might be my best bet for now 😃

I’m running the analysis on a server that has been under a heavy workload off late!

But, I will try a few things, tricks and get back to you 😉

---

<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 8, 2017, 7:52pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/11 "2017-11-08T19:52:09Z")

</div>

I managed to get some interesting results 😉 However, a bit too late for ISMRM 😐

Thanks a lot,  
Karthik

---

<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 8, 2017, 9:48pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/12 "2017-11-08T21:48:23Z")

</div>

🤔 but there’s still 7 hours left… Loads of time! 😜

---

<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: [November 8, 2017, 10:55pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/13 "2017-11-08T22:55:39Z")

</div>

I’ve once written 2 abstracts in that time. It’s perfectly feasible within realistic physical constraints. 😁

(and if you’ve got a few collaborators and Google docs, you can even do an abstract in less than an hour… 🤯)

---

<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 9, 2017, 7:34am UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/14 "2017-11-09T07:34:56Z")

</div>

I was quite motivated to have an abstract! Unfortunately, my supervisor wasn’t up for it 😞

---

<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 13, 2017, 8:57pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/15 "2017-11-13T20:57:54Z")

</div>

Good news is that I got group-wise significant results or fixels 😉

Now, I’m interested in calculating a difference map i.e. mean control minus mean tbi to see differences that fwe might wipe out 😄

How can I compute such a map?

Looking forward to your comments 🙂

---

<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: [November 16, 2017, 5:22am UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/16 "2017-11-16T05:22:03Z")

</div>

Sounds like you’re after an absolute effect map, which is part of the output of FBA. You can also compute a relative effect (percentage); see the docs on this: [http://mrtrix.readthedocs.io/en/latest/fixel\_based\_analysis/computing\_effect\_size\_wrt\_controls.html](http://mrtrix.readthedocs.io/en/latest/fixel_based_analysis/computing_effect_size_wrt_controls.html)

But be careful with interpreting effect sizes that aren’t per se significant differences…

---

<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 17, 2017, 2:30pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/17 "2017-11-17T14:30:41Z")

</div>

Just to clarify 🙂 I’m looking to visualize the fd results as in the image: The fa mean difference map (control-TBI) is overlaid on the mean FA map

 ![FA_difference0000](https://community.mrtrix.org/uploads/default/original/1X/3bb89e3738050bf6d13af5e24bc87504c76ac8fc.jpg)

I’m slightly confused with regards to displaying the fba results, so I have some more questions!

If I load the abs\_effect file on the fod template and threshold, color it by an arbitrary value, would it reflect the same?

Is it the same as having subtracted beta1 (control mean) - beta0(tbi mean)?

How would I represent the percentage effect correctly? Is it just loading the percentage effect map and thresholding it according to the fwe values (0.95-1)?

Thanks 🙂

---

<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: [February 6, 2018, 12:22pm UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/18 "2018-02-06T12:22:50Z")

</div>

Hi,

I created a fixel mask (using a much lower threshold) for fod lobe segmentation to include parts of the gray matter (see pic below). The fixelcfe stats for fd works fine! But, when I run it for fdc i get the error: subject data contains non-finite values: -nan. Is there a way to override this by setting the fixels which are nan to zero?

 ![image](https://community.mrtrix.org/uploads/default/original/2X/1/144910a623ae1fb44018f670d046a2e4dba77d35.png)  
Is there any sense in even trying to extend the fba to include more of the gray matter? Looking forward to your comments 🙂

---

<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: [February 7, 2018, 7:49am UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/19 "2018-02-07T07:49:17Z")

</div>

With regards to the above post, is it advisable to lower the fmls peak value (fod2fixel) from the default 0.1 in some scenarios?

---

<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: [February 8, 2018, 5:06am UTC](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276/20 "2018-02-08T05:06:02Z")

</div>

> If I load the abs\_effect file on the fod template and threshold, color it by an arbitrary value, would it reflect the same?

> Is it the same as having subtracted beta1 (control mean) - beta0(tbi mean)?

The absolute effect size is the inner product between the contrast and the beta coefficients ([code](https://github.com/MRtrix3/mrtrix3/blob/master/core/math/stats/glm.cpp#L73)). So assuming that:

- The first column contains 1s for TBI subjects and 0s for control subjects;
- The second column contains 1s for control subjects and 0s for TBI subjects;
- Your contrast is `[-1 1]`

, then yes, this is equivalent to _beta1_ - _beta0_. But this is not necessarily true for any arbitrary experimental design.

> How would I represent the percentage effect correctly? Is it just loading the percentage effect map and thresholding it according to the fwe values (0.95-1)?

This has to do with being very specific about what data you want to inform what aspect of the visualisation. Typically yes, one would use the percentage effect data to set the _colour_ of each fixel, and the FWE (1 - _p_-value) image to _threshold_ the fixel display. But it’s best to be explicit about this, rather than “loading the percentage effect map” 👍

> But, when I run it for fdc i get the error: `subject data contains non-finite values: -nan`.

Given the analysis of FD works without issue, this can only occur if there are non-finite values in your FC somewhere. You could find these using:  
`mrcalc FC.mif -isnan badFC.mif`  
, and looking for the fixels that light up in `mrview`. You could even take the sum of these images across subjects, to find the issue(s) more quickly. Exactly where these are, and how prevalent they are, might provide some insight into what’s going wrong.

> Is there a way to override this by setting the fixels which are nan to zero?

You can; but it would be better to first figure out _why_ you are getting NaN values before you go about masking them.

> Is there any sense in even trying to extend the fba to include more of the gray matter?

This depends as much on your hypothesis as the underlying techniques used. Generally the fixel correspondence in these areas is poorer, and hence the within-group variances are very large.

> With regards to the above post, is it advisable to lower the fmls peak value (fod2fixel) from the default 0.1 in some scenarios?

You certainly can; there’s no “correct” value. Generally for hard-constraint / multi-tissue CSD the FOD amplitudes are smaller than single-tissue soft-constraint CSD, so you can get away with smaller thresholds before you begin to include spurious data. But bear in mind that technically each time you try a different set of masking / segmentation thresholds and re-test your hypothesis, you should be adjusting your _p_-value threshold for multiple comparisons 😐

Rob

[Next page](https://community.mrtrix.org/t/fba-analysis-pipeline-help/1276.md?page=2)
