# T2-values generated with T2-mapping module invalid?

**URL:** <https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055>\
**Category:** Support\
**Created:** [June 16, 2020, 12:29pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055 "2020-06-16T12:29:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KatS](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@KatS](https://discourse.slicer.org/u/KatS)\
**Post date:** [June 16, 2020, 12:29pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/1 "2020-06-16T12:29:02Z")

</div>

Dear Slicer community,  
I came across a problem when using the T2 mapping extension for mouse brain data acquired on a 9.4T Bruker scanner (MSME sequence with 30 echo times).  
I loaded Bruker DICOM files via the MultiVolumeImporter PlugIn as “30 frames MultiVolume by EchoTime” and used this as input in the T2 mapping-Module. I generated a T2-map with thresholds of 0.1 for R^2 and 300 for T2. The output looks reasonable.  
I then wanted to extract the actual T2-values for different anatomical regions. I used Segment editor for segmentation and Segment statistics. The values displayed in the table however seem to be incorrect and do not match the values expected from the literature or derived from Bruker’s Paravision analysis tool: mean values for different structures (i.e. cortex and CSF) are roughly the same and higher than they should be.  
Has anyone experience with this? Is there anything I need to do in a different way? I assume it has something to do with how the map is calculated, but am not sure about that.  
Thanks a lot for your help in advance!!!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 16, 2020, 1:23pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/2 "2020-06-16T13:23:46Z")

</div>

Bruker scanners are well known to produce inconsistent and incorrect DICOM outputs (you can read about frustration of Bruker users [here](https://github.com/neurolabusc/Bru2Nii/)). Most probably you need to fix `MultiVolume.FrameLabels` values in Data module “MRML node information” section.

---

<div class="post-metadata">

**Author:** ![KatS](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@KatS](https://discourse.slicer.org/u/KatS)\
**Post date:** [June 16, 2020, 2:43pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/3 "2020-06-16T14:43:44Z")

</div>

Thanks for the fast reply! Yes, I’m aware of the issues with Bruker DICOMS unfortunately.  
I checked MultiVolume.FrameLabels values and these were the echo times in ascending order, which I think is correct. Or should it be something different?  
Additionally, when looking at the imported images in MultiVolume Explorer, they appear to be fine.  
Could there be a problem when Bruker files are used for the calculation of the T2 map in the T2-mapping extension?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 16, 2020, 5:20pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/4 "2020-06-16T17:20:47Z")

</div>

This is a Python-scripted module, so you can inspect and modify the code very easily.

The source code is available here: [https://github.com/gattia/Slicer-T2mapping/blob/master/T2mapping/T2mapping.py#L223-L298](https://github.com/gattia/Slicer-T2mapping/blob/master/T2mapping/T2mapping.py#L223-L298). The computation part is quite short and has lots of comments, and high-level overview is also given in the [module documentation](https://github.com/gattia/Slicer-T2mapping), so you should be able to tell if the computation is correct.

If you enable developer mode in Slicer application settings and restart the application then “Edit” button will appear in the modue, which you can use to open the source code in a text editor. After making changes, you just need to click “Reload” button.

---

<div class="post-metadata">

**Author:** ![KatS](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@KatS](https://discourse.slicer.org/u/KatS)\
**Post date:** [June 22, 2020, 3:00pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/5 "2020-06-22T15:00:35Z")

</div>

Thanks for the reply! I was able to figure out how the computation is done, but I’m afraid that it might not be working well for my data.  
Is there a way to display a plot with the fit or an error map?

Hitting the “Edit” button in developer mode does not open the code in a text editor. Is there anything else apart from enabling developer mode and restart Slicer to use this function?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 23, 2020, 9:58pm UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/6 "2020-06-23T21:58:57Z")

</div>

> [@KatS](#):
>
> Hitting the “Edit” button in developer mode does not open the code in a text editor

Make sure .py fine extension is associated with a text editor. But you don’t need to use this convenience feature, you can open the module’s .py file manually (you can find its location in the application log).

> [@KatS](#):
>
> Is there a way to display a plot with the fit or an error map?

I don’t think the module offers this, but you can create plots yourself. See examples here: [Documentation/Nightly/ScriptRepository - Slicer Wiki](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Plotting).

Would you like to plot intensity values at specific positions?

---

<div class="post-metadata">

**Author:** ![gattia](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@gattia](https://discourse.slicer.org/u/gattia)\
**Post date:** [September 1, 2021, 4:00am UTC](https://discourse.slicer.org/t/t2-values-generated-with-t2-mapping-module-invalid/12055/7 "2021-09-01T04:00:04Z")

</div>

@KatS Im the developer of that module and just came across this post. Did you figure out the problem? It could be that for some reason your data wasn’t playing nicely with the linear fit method (log transform the data and then fit a linear equation). I’d be interested in helping out to make sure this works for others.
