# Load TBSS output files into Slicer?

**URL:** <https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204>\
**Category:** SlicerDMRI\
**Created:** [August 28, 2019, 6:05am UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204 "2019-08-28T06:05:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 28, 2019, 6:05am UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/1 "2019-08-28T06:05:51Z")

</div>

Hello,

I have been using FSL’s [TBSS](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/TBSS) to compare the FA, RD, and AD values of two different groups. The result of this analysis is a single statistics file which is in the NIFTI format (.nii.gz), highlighting voxels that are significantly different between the two groups in terms of FA/RD/AD. I am trying to load this into Slicer, to create a diagram similar to [this one](https://www.researchgate.net/figure/Results-from-the-tract-based-spatial-statistics-TBSS-analyses-depicting-the-voxels-that_fig1_262055573), but I’m very new to the software. Could someone help me out? Is there a way to load TBSS output data into Slicer?

Thank you!

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [August 28, 2019, 7:15am UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/2 "2019-08-28T07:15:05Z")

</div>

Hi! In general it should be possible to load nifti files in Slicer. Could you let us know what steps you followed and what happened? There are tutorials for loading data here:  
[https://www.slicer.org/wiki/Documentation/4.10/Training](https://www.slicer.org/wiki/Documentation/4.10/Training)

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [August 28, 2019, 5:37pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/3 "2019-08-28T17:37:47Z")

</div>

An alternative solution might be to use MRIcroGL. It has far fewer features than Slicer, but it is a simple tool that might solve your task. Assuming you have [MRIcroGL v1.2](https://github.com/rordenlab/MRIcroGL12/releases) the following script would create the following image (you would want to use the ‘mni152’ template if your data was normalized, and change spmMotor to the name of your statistical map).

```
import gl
gl.resetdefaults()
#open background image
gl.loadimage('spm152')
gl.overlayloadsmooth(1)
#open overlay: show positive regions
gl.overlayload('spmMotor')
gl.minmax(1, -2,-5)
gl.colorname(1,'8redyell')
gl.colorfromzero(1,1)
gl.cutout(0.5,0.6,0.5,0,1,1)
gl.shadername('OverlaySurface')
gl.backcolor(255,255,255)

```

 ![cutout](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/9/593823c65f15095a8fbe8fc8ef927d70bbc54b4f.jpeg)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 28, 2019, 6:05pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/4 "2019-08-28T18:05:37Z")

</div>

> [@Chris\_Rorden](#):
>
> It has far fewer features than Slicer

But the rendering is cooler!

---

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 28, 2019, 8:13pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/5 "2019-08-28T20:13:34Z")

</div>

Thank you! I followed these instructions, but the output has some sort of strange cuboid tessellation pattern that I haven’t seen in other figures. Does this have something to do with the settings I’m using? Or, do you think it has to do more with the structure of the data? TBSS uses voxels for analysis, so perhaps those cuboid patterns are a result of that (?)

 ![17%20PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/f/4f7402c2c9308fac08360e78315fd381ae4f2be0.jpeg) ![44%20PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/a/6a48e34a314d6b7f5a7558596898c408f02c9874.jpeg) ![21%20PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/0/508ac6c019ea5e05ea9c744acc5f82260e6406e9.jpeg)

---

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 28, 2019, 8:15pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/6 "2019-08-28T20:15:45Z")

</div>

This looks very cool! I will test this out, as well. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [August 28, 2019, 9:14pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/7 "2019-08-28T21:14:18Z")

</div>

It looks like you are volume rendering the white matter skeleton voxels from tbss. More typical displays instead overlay slices of such a stats volume over a background anatomical image, with some nicely chosen colormap to only show significant regions. (Chris gave a very cool example.)

---

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 28, 2019, 9:20pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/8 "2019-08-28T21:20:51Z")

</div>

Got it, that’s what I’m trying now. To create a cutout like in Chris’s example, would I use a mask? I can’t figure out how to hide the masked segment…

---

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 28, 2019, 9:23pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/9 "2019-08-28T21:23:25Z")

</div>

@Chris_Rorden is it possible to export a figure like this to a .obj file out of MRIcroGL?

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [August 29, 2019, 12:28pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/10 "2019-08-29T12:28:29Z")

</div>

@M.F. I would suggest you look at the [“3D Slicer Surface Model Tutorial fMRI” YouTube video](https://www.youtube.com/watch?v=GNsWRnm7gQw). MRIcroGL handles voxelwise volumes, not meshes (like obj files). Slicer can handle both voxels and meshes.

For this simple task, you might also want to try [Surfice](https://github.com/neurolabusc/surf-ice/releases) which only deals with meshes. If you want to apply a simple statistical threshold to your voxels (say z \> 4.95) you would choose the Advanced/ConvertVoxelwiseVolumeToMesh and specify your threshold. You can then save to OBJ/GIFTI/PLY/MZ3/VRML/STL format. Assuming you named your output “myMesh.obj” you could run the following script to get the following image.

```
import gl
gl.resetdefaults()
gl.meshload('BrainMesh_ICBM152Right.mz3')
gl.overlayload('myMesh.obj')
gl.overlaycolorname(1, 'red')
gl.shaderxray(1.0, 0.3)
gl.azimuthelevation(110, 15)
gl.meshcurv()

```

 ![surfice2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/1/e1b154be2baf5b4ce70b1ab2f13f12e3cfb81228.jpeg)

At the moment there are a lot of free tools, so you should be able to mix and match them for your problems. The learning curve is steeper for Slicer since it can do much more and is far more extensible.

---

<div class="post-metadata">

**Author:** ![M.F](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@M.F](https://discourse.slicer.org/u/M.F)\
**Post date:** [August 30, 2019, 6:01pm UTC](https://discourse.slicer.org/t/load-tbss-output-files-into-slicer/8204/11 "2019-08-30T18:01:34Z")

</div>

Thank you, this worked like a charm!
