# Exporting the thickness bone table from Bone Thickness Mapping extension

**URL:** <https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004>\
**Category:** Support\
**Tags:** segmentation, extensions-manager, python\
**Created:** [July 31, 2021, 6:39pm UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004 "2021-07-31T18:39:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.Odaba](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M.Odaba](https://discourse.slicer.org/u/M.Odaba)\
**Post date:** [July 31, 2021, 6:39pm UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004/1 "2021-07-31T18:39:22Z")

</div>

Hi,  
I’ve been using Bone Thickness Mapping extension. It’s an amazing tool and the heatmap it creates is super useful. However, I need to have access to thickness values to do more statistical analyses. I assume for each pixel or coordinate, there is a thickness value. I’m new in scripting and still learning Python. From Line 921 to 924 of the provided script (BoneThicknessMapping.py), it says:

# thickness table

```
    ix = [int(i) for i in [minmax_thickness[0]*gradient_scale_factor, (minmax_thickness[1])*gradient_scale_factor + 1]]
    thicknessTableNode = BoneThicknessMappingLogic.build_color_table_node('ThicknessColorMap', ix[-1])
    for i in range(ix[0], ix[-1]): calculate_and_set_colour(thicknessTableNode, i, hue=p(i, ix[-1], ix[0]) * 0.278, sat=0.9, val=0.9)

```

Does this mean that the data I’m after is called “thicknessTableNode”? If so, would you let me know how I can save the data in a table, text file or other formats?

Thanks,  
Mo

---

<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:** [July 31, 2021, 7:25pm UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004/2 "2021-07-31T19:25:33Z")

</div>

I haven’t used the module myself, but the thickness data is stored as a scalar field on a model node, so you can use [`arrayFromModelPointData`](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html?highlight=arrayFromModelPointData#slicer.util.arrayFromModelPointData) to get a numpy array. You can also `arrayFromModelPoints` to get the corresponding vertex coordinates in RAS space.

You could file an issue on [the extension repository](https://github.com/Auditory-Biophysics-Lab/SlicerBoneThicknessMappingExtension/issues) to explain what you are trying to do and get more clues.

---

<div class="post-metadata">

**Author:** ![M.Odaba](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M.Odaba](https://discourse.slicer.org/u/M.Odaba)\
**Post date:** [August 5, 2021, 12:57am UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004/3 "2021-08-05T00:57:45Z")

</div>

> [@pieper](#):
>
> arrayFromModelPoints

Thanks for your reply.  
Would you also make an example of how to export the thickness data and vortex coordinates in RAS space in a text or csv file? I need to export this file out of 3D Slicer.

Thanks a lot.

---

<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:** [August 7, 2021, 4:41pm UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004/4 "2021-08-07T16:41:17Z")

</div>

You get all these values in numpy arrays, so you can easily save them in any format you need. There is nothing Slicer-specific in this, you can just use basic Python functions from packages like numpy, pandas, etc.

---

<div class="post-metadata">

**Author:** ![Gonzalo\_Rojas\_Costa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gonzalo_rojas_costa/32/5259_2.png) [@Gonzalo\_Rojas\_Costa](https://discourse.slicer.org/u/Gonzalo_Rojas_Costa)\
**Post date:** [January 3, 2024, 12:00am UTC](https://discourse.slicer.org/t/exporting-the-thickness-bone-table-from-bone-thickness-mapping-extension/19004/5 "2024-01-03T00:00:58Z")

</div>

Or, is it possible to get thickness values using a ROI, or something similar function? Because, I want to compare the skull thickness in the frontal area, occipital, etc. in two different populations.
