# Fractal dimension

**URL:** <https://discourse.slicer.org/t/fractal-dimension/5890>\
**Category:** Development\
**Tags:** extensions-manager\
**Created:** [February 22, 2019, 4:58pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890 "2019-02-22T16:58:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [February 22, 2019, 4:58pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/1 "2019-02-22T16:58:29Z")

</div>

Hi all,  
I’m writing to ask if a new extension can be interested for the community.  
In collaboration with some colleagues of mine, we wrote a python code for fractal dimension computation.  
We had this idea because we really struggled to find something “easy to use” (with no success), so now we would like to share our solution.  
For the moment it works just with 2D images, but our plan is to support also 3D volumes.

Do you think we can create a new scripted modules and expose it to the slicer users?

Thank you very much.  
Best.

Paolo

---

<div class="post-metadata">

**Author:** ![Fernando](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fernando/32/5640_2.png) [@Fernando](https://discourse.slicer.org/u/Fernando)\
**Post date:** [February 25, 2019, 10:50pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/2 "2019-02-25T22:50:51Z")

</div>

Hi Paolo,

What do you use it for?

Best,  
Fernando

---

<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:** [February 25, 2019, 11:10pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/3 "2019-02-25T23:10:23Z")

</div>

@PaoloZaffino for the sake of improved discoverability and reduced maintenance efforts, do you want to consider adding this as a new featureset to [pyradiomics](https://pyradiomics.readthedocs.io/en/latest/)? From a quick search, fractal dimension has been used for radiomics studies, e.g., see [https://www.ncbi.nlm.nih.gov/pubmed/29230678](https://www.ncbi.nlm.nih.gov/pubmed/29230678).

pyradiomics already has a large and thriving community (see [mailing list](https://groups.google.com/forum/#!forum/pyradiomics) and [github repo](https://github.com/Radiomics/pyradiomics)), and is accompanied by the [SlicerRadiomics extension](https://github.com/Radiomics/SlicerRadiomics) exposing its features to the end user, so you would need to do no Slicer development, and your new features will magically become accessible to the SlicerRadiomics users. As an extra benefit, your features will be accessible in a package via PyPI and Conda, expanding the potential pool of happy users.

cc: @JoostJM

suggested-by: @rkikinis

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [February 27, 2019, 3:52pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/4 "2019-02-27T15:52:44Z")

</div>

Hi all!

@Fernando we use it to quantify vessel complexity.

@fedorov @JoostJM thanks a lot for offering us this possibility…it would be great add our code to this project.  
@Pierangela00 is the PhD student that wrote the code and that is in charge of deploying it. Do you have any suggestion/guideline/policy about integrating our code into the project?

Thank you very much!  
Paolo

---

<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:** [February 27, 2019, 4:08pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/5 "2019-02-27T16:08:51Z")

</div>

> [@PaoloZaffino](#):
>
> Do you have any suggestion/guideline/policy about integrating our code into the project?

Yes we do! [pyradiomics/CONTRIBUTING.rst at master · AIM-Harvard/pyradiomics · GitHub](https://github.com/Radiomics/pyradiomics/blob/master/CONTRIBUTING.rst)

---

<div class="post-metadata">

**Author:** ![Fernando](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fernando/32/5640_2.png) [@Fernando](https://discourse.slicer.org/u/Fernando)\
**Post date:** [February 28, 2019, 4:30pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/6 "2019-02-28T16:30:43Z")

</div>

> [@PaoloZaffino](#):
>
> @Fernando we use it to quantify vessel complexity.

That’s very interesting and related to my work, I’m looking forward to trying the code!

---

<div class="post-metadata">

**Author:** ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)\
**Post date:** [March 1, 2019, 11:22am UTC](https://discourse.slicer.org/t/fractal-dimension/5890/7 "2019-03-01T11:22:55Z")

</div>

@fedorov thanks a lot.  
Any suggestion about the file/place where we could put our code?  
Is there an already defined data structure to get/return images?

Thank you.

---

<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:** [March 1, 2019, 2:47pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/8 "2019-03-01T14:47:49Z")

</div>

There is already functionality to computer texture images, so maybe that is similar. I suggest you create an issue under pyradiomics, describe your code and discuss details there.

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [March 18, 2019, 12:57pm UTC](https://discourse.slicer.org/t/fractal-dimension/5890/9 "2019-03-18T12:57:59Z")

</div>

If I’m correct, fractal dimension features returns values on a segment level (i.e. where each values describes the entire region of interest), this would make it ideal to implement as a feature class. If it returns values per voxel (and therefore generates a parameter map), it is best implemented as an image type (=filter).

Both signatures are described [here](https://pyradiomics.readthedocs.io/en/latest/developers.html#).  
If you require assistance, let us know by submitting a PR or issue on the github as @fedorov suggested.
