# Population Analysis Output

**URL:** <https://discourse.slicer.org/t/population-analysis-output/43644>\
**Category:** SlicerSALT\
**Created:** [July 8, 2025, 9:25am UTC](https://discourse.slicer.org/t/population-analysis-output/43644 "2025-07-08T09:25:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anasmh101](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/anasmh101/32/80621_2.png) [@anasmh101](https://discourse.slicer.org/u/anasmh101)\
**Post date:** [July 8, 2025, 9:25am UTC](https://discourse.slicer.org/t/population-analysis-output/43644/1 "2025-07-08T09:25:11Z")

</div>

Hello everyone,

I’m currently working on a project that involves analyzing bone apposition and resorption in mandibular condyles by comparing pre-treatment and post-treatment CBCT scans.

Here’s what I’ve done so far:

1. I performed rigid alignment for the pre- and post-treatment condyle segmentations.

2. I ran SPHARM-PDM on all segmented models (pre and post).

3. Using population analysis module I created a CSV file to define the pre- and post-treatment groups then clicked the **“Process and Export”** button.

However, the output in the 3D viewer shows a dark, unrecognizable model with no clear shape as shown in screenshot

Did I miss something in the workflow or setup? I’d really appreciate any guidance or suggestions on what might be going wrong.  
Thanks in advance!

 ![Population Analysis](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/f/3fef91da78f53e8052188af45d2b1fab17c7fa33.jpeg)

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [July 10, 2025, 7:55am UTC](https://discourse.slicer.org/t/population-analysis-output/43644/2 "2025-07-10T07:55:27Z")

</div>

Hi Anash  
The dark color of the average model shown in the screenshot might be an issue of surface normal flipping. If you use the “models” module, you should be able to select that surface and under 3D Display → Visible Sides, it should say “All”. If not please, switch to All.  
Some quick questions  
After step 2, did the model surfaces look fine? Did you double check the correspondence in Shape Population Viewer to see that there are no flipped correspondences?  
Best  
Martin

---

<div class="post-metadata">

**Author:** ![anasmh101](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/anasmh101/32/80621_2.png) [@anasmh101](https://discourse.slicer.org/u/anasmh101)\
**Post date:** [July 10, 2025, 2:24pm UTC](https://discourse.slicer.org/t/population-analysis-output/43644/3 "2025-07-10T14:24:46Z")

</div>

Hi Martin,

Thanks again for your help!

I checked the correspondences in Shape Population Viewer as shown in the screenshot, and it seems there **is** an issue with the correspondence.

May I ask how I can solve this?

Just to add some context — I’m using the `.vtk` files named `surf_SPHARM_ellalign.vtk`.

Best regards,  
Anas

 ![Correspondence](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/a/9a8d7479151a70bc461a16762eaea74f581a55bc.jpeg)

---

<div class="post-metadata">

**Author:** ![styner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/styner/32/1024_2.png) [@styner](https://discourse.slicer.org/u/styner)\
**Post date:** [July 10, 2025, 2:49pm UTC](https://discourse.slicer.org/t/population-analysis-output/43644/4 "2025-07-10T14:49:57Z")

</div>

Thanks Anas  
To solve the issue with the correspondence, let’s first outline what the issue is:

1. Is the correspondence issue mainly a flip (or multiple flips) along one of the main axes, e.g. front-back flip, top-bottom flip, left-right flip? If so, then those flips can be added manually to the SPHARM-PDM generation module (SPHARM-PDM has issues with correspondence if the shape of structure is not elongated and more spherical in a first order approximation, this seems to be the case here)

1. If the correspondence issue is more complex, e.g. the correspondence is off by a 30 degree rotation of the phi or theta visualization, then at least 3 fiducials/landmarks on all objects will be needed as input the Correspondence Improvement module

hope this helps  
Martin

---

<div class="post-metadata">

**Author:** ![anasmh101](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/anasmh101/32/80621_2.png) [@anasmh101](https://discourse.slicer.org/u/anasmh101)\
**Post date:** [July 10, 2025, 5:52pm UTC](https://discourse.slicer.org/t/population-analysis-output/43644/5 "2025-07-10T17:52:38Z")

</div>

Hi Martin,

Thanks a lot again for your continued support

I’ve re-run the SPHARM-PDM process using landmarks to improve the correspondence. Each fiducial file matches the name of its respective condyle, and the landmarks have consistent names and sequences across all models.

Unfortunately, the correspondence issue still persists.

Just to clarify: I processed all pre- and post-treatment condyle segmentations together in a single batch. Since you mentioned that the flip can be manually controlled during SPHARM-PDM generation, I’m now considering running SPHARM-PDM for each **pre/post pair individually** so I can better control the flipping.

If I do it that way, would I still be able to perform **population analysis and PCA** later on using the full set of 50 models?

If not, how can I control the flipping when processing all 25 pre- and 25 post-treatment segmentations together? Specifically, how do I determine the correct **starting point (axis: X, Y, or Z)** to fix the flipping and end up with consistently aligned models?

Thanks again for your help — your guidance is really appreciated!

Best,  
Anas
