# Shape analysis by SPHARM-PDM

**URL:** <https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708>\
**Category:** SlicerSALT\
**Created:** [December 22, 2017, 11:25am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708 "2017-12-22T11:25:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sodaGH](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sodagh/32/1033_2.png) [@sodaGH](https://discourse.slicer.org/u/sodaGH)\
**Post date:** [December 22, 2017, 11:25am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/1 "2017-12-22T11:25:28Z")

</div>

Operating system: windows7\_64  
Slicer version: 4.4.0  
Expected behavior: I want to do the shape analysis by SPHARM-PDM  
Actual behavior:

1. I have apply the shape analysis module, when I load the output.csv file in ShapePopulationViewer, it pop up error like this:  
ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008811FE0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (00000000089219D0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008A610C0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008811FE0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (00000000089219D0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008A610C0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008811FE0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (00000000089219D0): vtkTextActor::SetInput was passed an uninitialized string

ERROR: In …\VTKv6\Rendering\FreeType\vtkTextActor.cxx, line 364  
vtkTextActor (0000000008A610C0): vtkTextActor::SetInput was passed an uninitialized string

---

<div class="post-metadata">

**Author:** ![laurapascal](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@laurapascal](https://discourse.slicer.org/u/laurapascal)\
**Post date:** [December 22, 2017, 4:27pm UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/2 "2017-12-22T16:27:08Z")

</div>

Hello,

Thank you for showing your interest in SPHARM-PDM Extension!

The issue could be due by the use of the version 4.4 of Slicer. I highly recommend you to use the new release 4.8 of Slicer that you can download [here](http://download.slicer.org/).

If you need any more help, I will be happy to help you!

---

<div class="post-metadata">

**Author:** ![sodaGH](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sodagh/32/1033_2.png) [@sodaGH](https://discourse.slicer.org/u/sodaGH)\
**Post date:** [December 23, 2017, 3:24am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/3 "2017-12-23T03:24:10Z")

</div>

Hi Laura :

Thanks for your reply!

I want to use SPHARM-PDM to do the shape analysis of hippocampus on my brain MRI data. I’m new to this field and not familiar with this software. I did the shape analysis on my data and it generated several file folders such as “BatchMake\_Scripts”, “EulerFiles”, “Mesh”, “OutputGroupFile” and “Template”.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/b/8bccee078b7f10eba18d440490763d2a7bbc0329.png)

Now I want to do the following feature selection and classification steps, but I don’t know which file to choose. I want to know in which file the shape analysis information was stored and how should I use it.

Thanks for your reading. Looking forward to your reply!

---

<div class="post-metadata">

**Author:** ![sodaGH](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sodagh/32/1033_2.png) [@sodaGH](https://discourse.slicer.org/u/sodaGH)\
**Post date:** [December 24, 2017, 4:48am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/4 "2017-12-24T04:48:19Z")

</div>

hi @laurapascal

I followed your advice and installed 3D Slicer V4.8. After applying shape analysis module, it generated 3 subfolders:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/a/4a13cae8ea8befc783227c801af03e20df55cb55.png)

Can you guide me what should I do next in order to get the shape analysis results? My next step is feature selection and classification, which file stores the shape information I need?  
Thanks for your reading and reply!

---

<div class="post-metadata">

**Author:** ![laurapascal](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@laurapascal](https://discourse.slicer.org/u/laurapascal)\
**Post date:** [December 29, 2017, 4:57am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/5 "2017-12-29T04:57:20Z")

</div>

Hi @sodaGH,

In each folder you will find the results of each step of the SPHARM-PDM process. The final results are contained in the folder named _step3\_ParaToSPHARMMesh_. In this folder, you will find the corresponding shape population composed by models which have the same number of points at corresponding position.

You will find 3 similar groups composed by the same corresponding shape population where each group is based on a different model registration:

- the _input\_rootname\_pp\_surf\_SPHARM_ VTK models which are not registered between them.
- the _input\_rootname\_pp\_surf\_SPHARM\_ellalign_ VTK models which are registered with the sphere used to create them.
- the _input\_rootname\_pp\_surf\_SPHARM\_procalign_ VTK models which are registered with a template that you can specify by using the _Registration Template Option_.

In order to statistically compare the regional differences between two models, you can apply the module [ModelToModelDistance](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/ModelToModelDistance) (available as a module of 3DSilcer): it will compute a distance map between two models with the option corresponding\_point\_to\_point (which will compute the euclidean distance for each corresponding point of your two models). You can then visualize the distance map in [ShapePopulationViewer](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/ShapePopulationViewer) (available in SlicerSALT and 3DSlicer) by displaying the attribute _PointToPointVector_.

In order to classify 3D models according to their morphological variation, you can use the extension [ShapeVariationAnalyzer](https://www.slicer.org/wiki/Documentation/Nightly/Modules/ShapeVariationAnalyzer)  
(available in 3DSilcer). This classifier can be used to identify shapes, help to provide a diagnosis, or evaluate the staging of a disease.

If you have any additional questions, I will be happy to answer them!

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [April 19, 2019, 1:05am UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/6 "2019-04-19T01:05:21Z")

</div>

Can you create an average shape from these results, or does it automatically generate an average shape?

---

<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:** [April 24, 2019, 6:36pm UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/7 "2019-04-24T18:36:19Z")

</div>

Hi Steven,

You can currently create an average from the PDMs generated from SPHARM using [MeshMath](https://github.com/NIRALUser/SPHARM-PDM/blob/master/Modules/CLI/MetaMeshTools/MeshMath.cxx). We are currently porting some of the MeshMath functionality into the SurfaceToolbox. I will keep everybody posted with how that goes.

Thank you,  
Beatriz

---

<div class="post-metadata">

**Author:** ![Shivi23](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Shivi23](https://discourse.slicer.org/u/Shivi23)\
**Post date:** [April 9, 2023, 6:09pm UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/8 "2023-04-09T18:09:48Z")

</div>

Hello,

I am trying to follow this advice and use ShapeVariationAnalyzer for my research. However, after adding the extension I do not see it showing up in Modules. Please help … I have seen some posts saying that ShapeVariationAnalyzer does not work for some versions of Slicer is this true? And if so, what is the next best too to classify 3D models according to their morphological variation? I have already ran my data to create SPHARM outputs and I want to use them to classify 3D models according to their morphological variation. Please help. Thanks!

---

<div class="post-metadata">

**Author:** ![mturja-vf-ic-bd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mturja-vf-ic-bd/32/65865_2.png) [@mturja-vf-ic-bd](https://discourse.slicer.org/u/mturja-vf-ic-bd)\
**Post date:** [May 2, 2023, 7:17pm UTC](https://discourse.slicer.org/t/shape-analysis-by-spharm-pdm/1708/9 "2023-05-02T19:17:43Z")

</div>

Dear Shrivani,

I am writing to inform you that we are currently working on a Slicer extension named “[SurfaceLearning](https://github.com/mturja-vf-ic-bd/SlicerDeepLearningUI)” which we believe would be a suitable solution for your specific use-case. The purpose of this deep learning module is to classify shapes, such as the hippocampus, brain surface, etc. It comes equipped with a range of popular deep learning models, including ResNet, EfficientNet, and DenseNet, as well as a simpler CNN-based classifier.

If you are interested in giving “SurfaceLearner” a try, I would be delighted to guide you through the process of using it. Please feel free to respond to this message or reach out to me via email at [mturja@cs.unc.edu](mailto:mturja@cs.unc.edu).

Best,  
Turja.
