# BoneTextureExtension: Texture Analysis Work in Slicer

**URL:** <https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278>\
**Category:** Support\
**Created:** [October 24, 2017, 7:31pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278 "2017-10-24T19:31:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [October 24, 2017, 7:31pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/1 "2017-10-24T19:31:05Z")

</div>

> Dear Professor Beatriz:  
> Sorry to bother you! I am really meeting some problems with 3DSlicer. May I ask you a few questions？
> 
> 1. I want to use HeterogeneityCAD modules to obtain texture features, but it is not in the module list. Module list like follow:  
> ![Attachment](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/9/9986f5b48ec1f2dd23258192e2f6b67a21ce04db.png)  
> How could I import this model.？
> 2. Could I use .png or .off data as my input data? It always shows error when I import data.  
> Thanks,  
> Miao

Hi Miao,

Thanks so much for your email, I hope you dont mind I respond to your email in the Slicer forum.

1. I am not aware of HeterogeneityCAD modules, do you mean [BoneTexture extension](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/BoneTextureExtension)?

2. It is possible to load png data into Slicer. Specifically for analysis in the BoneTextureExtension you will need to save/export that image into nrrd or other volumetric image formats.

Please provide a bit more of info, and I/the rest of the Slicer community will try to do our best to help.  
Best,

Bea

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [October 24, 2017, 8:07pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/2 "2017-10-24T20:07:22Z")

</div>

HeterogeneityCAD is an extension, not a core module - you will first need to install it using ExtensionManager.

You can also consider looking into the Radiomics extension that provides the Slicer interface to the pyradiomics library, which can be used to calculate ~1500 features: [http://pyradiomics.readthedocs.io/en/latest/](http://pyradiomics.readthedocs.io/en/latest/)

cc: @JoostJM

---

<div class="post-metadata">

**Author:** ![jbvimort](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jbvimort](https://discourse.slicer.org/u/jbvimort)\
**Post date:** [October 24, 2017, 8:15pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/3 "2017-10-24T20:15:11Z")

</div>

The BoneTexture Extension is not able to compute textural features for 2D images, it only can be used for 3D scans in Slicer.

Therefore you can consider using the itk\_texturefeatures python package that contain filter able to compute 1st order, Run Length an Co-occurrence textural features and textural feature maps for 2D and 3D images and can easily be intalled: pip install itk\_texturefeatures.

More informations and code examples can be found here:  
[http://www.insight-journal.org/browse/publication/985](http://www.insight-journal.org/browse/publication/985)

> **[InsightSoftwareConsortium/ITKTextureFeatures](https://github.com/InsightSoftwareConsortium/ITKTextureFeatures)**
>
> Fast, Texture Feature Maps from N-Dimensional Images - InsightSoftwareConsortium/ITKTextureFeatures

---

<div class="post-metadata">

**Author:** ![Miao\_Fan](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Miao\_Fan](https://discourse.slicer.org/u/Miao_Fan)\
**Post date:** [October 25, 2017, 3:36am UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/4 "2017-10-25T03:36:23Z")

</div>

Got it. It works. Thank you!

---

<div class="post-metadata">

**Author:** ![Miao\_Fan](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Miao\_Fan](https://discourse.slicer.org/u/Miao_Fan)\
**Post date:** [October 25, 2017, 3:37am UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/5 "2017-10-25T03:37:22Z")

</div>

I have install itk\_texturefeature. How could I use it?

---

<div class="post-metadata">

**Author:** ![Miao\_Fan](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Miao\_Fan](https://discourse.slicer.org/u/Miao_Fan)\
**Post date:** [October 25, 2017, 1:06pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/6 "2017-10-25T13:06:57Z")

</div>

The BoneTexture Extension is not able to compute textural features for 2D images, it only can be used for 3D scans in Slicer. But I need to deal with 2D images. Is there any module can compute 2D images?

---

<div class="post-metadata">

**Author:** ![jbvimort](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jbvimort](https://discourse.slicer.org/u/jbvimort)\
**Post date:** [October 25, 2017, 1:15pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/7 "2017-10-25T13:15:22Z")

</div>

You can find some python code examples here:

- For the run length features: [https://github.com/jbvimort/ITKTextureFeatures/blob/AllowingFloat/example/computeGLRLMFeatures.py](https://github.com/jbvimort/ITKTextureFeatures/blob/AllowingFloat/example/computeGLRLMFeatures.py)
- For the co-occurrence features: [https://github.com/jbvimort/ITKTextureFeatures/blob/AllowingFloat/example/computeGLCMFeatures.py](https://github.com/jbvimort/ITKTextureFeatures/blob/AllowingFloat/example/computeGLCMFeatures.py)

Those two examples are for 3D images but it’s easy to adapt them in order to work with 2D images by moving dimension from 3 to 2 in each code.

---

<div class="post-metadata">

**Author:** ![Miao\_Fan](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Miao\_Fan](https://discourse.slicer.org/u/Miao_Fan)\
**Post date:** [October 25, 2017, 3:05pm UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/8 "2017-10-25T15:05:15Z")

</div>

I could obtain .off files which contain 3D points. Is there any function that can output a .nrrd file?

---

<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:** [October 27, 2017, 2:22am UTC](https://discourse.slicer.org/t/bonetextureextension-texture-analysis-work-in-slicer/1278/9 "2017-10-27T02:22:01Z")

</div>

You can always create 3D volume from a “2D” image (single-slice 3D image) by resampling. Probably the simplest is to use CropVolume module for that.
