# SlicerMorph GPA will not exclude landmarks

**URL:** <https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594>\
**Category:** Support\
**Created:** [March 19, 2022, 12:36am UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594 "2022-03-19T00:36:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasmine\_Croghan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine_croghan/32/14714_2.png) [@Jasmine\_Croghan](https://discourse.slicer.org/u/Jasmine_Croghan)\
**Post date:** [March 19, 2022, 12:36am UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/1 "2022-03-19T00:36:06Z")

</div>

Hi all,

I have run an auto3DGM analysis and used Markup to identify landmarks in areas I am not interested in, thinking I can easily exclude those landmarks for downstream analysis in SlicerMorph’s GPA module. I created a comma, not space, delimited list of those landmarks, and the python viewing window indicates that the landmarks were excluded, the analysis.log of the GPA indicates that the landmarks were excluded, but the results in the GPA module still contain the supposedly excluded landmarks. What am I doing wrong here?

 ![Will_not_exclude_commas_no_space](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/5/055979ff45cc9592ba35c708a310b000a974aa57.jpeg)

For the record I’m using the latest (non-stable) build from github, as is required by auto3DGM according to the installation instructions.

Thanks for any help you can provide.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 19, 2022, 1:07am UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/2 "2022-03-19T01:07:32Z")

</div>

> [@Jasmine\_Croghan](#):
>
> but the results in the GPA module still contain the supposedly excluded landmarks.

How do you know that excluded landmarks are actually included in the GPA? How many landmarks did your auto3DGM analysis had? GPA reports 371 included landmarks for the analysis. Usually people specify some round numbers like 400-500 points in auto3Dgm.

---

<div class="post-metadata">

**Author:** ![Jasmine\_Croghan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine_croghan/32/14714_2.png) [@Jasmine\_Croghan](https://discourse.slicer.org/u/Jasmine_Croghan)\
**Post date:** [March 19, 2022, 1:12am UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/3 "2022-03-19T01:12:39Z")

</div>

Hi, there were 512 original points, and all the output files have 371 landmarks. The ‘mean shape’ point cloud displays landmarks that were removed, like the highlighted landmark, 135.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 19, 2022, 12:07pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/4 "2022-03-19T12:07:14Z")

</div>

If you have started with 512 and the gpa reports 371 LMs, then it means 141 LMs were excluded in the analysis.

I am not seeing any landmark numbers more than 371 on the screenshot, which tells me that after the exclusion the landmarks were reorderer consecutively. Thus your the landmark 135 in GPA output is not the same landmark as the excluded 135.

Do you want to retain the original LM indices?  
@smrolfe

---

<div class="post-metadata">

**Author:** ![Jasmine\_Croghan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine_croghan/32/14714_2.png) [@Jasmine\_Croghan](https://discourse.slicer.org/u/Jasmine_Croghan)\
**Post date:** [March 19, 2022, 12:52pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/5 "2022-03-19T12:52:45Z")

</div>

Oh, interesting, you’re right there are no landmarks labelled higher than 371! The thing that really stumps me, though, is that all the landmarks that I removed are on the surface you see (inside the braincase), so there should be NO visible landmarks in this view. I have confirmed multiple times that there are landmarks where I have specifically removed them.

What could be making it redistribute landmarks? Is it somehow related to the auto3DGM landmarking method?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 19, 2022, 9:38pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/6 "2022-03-19T21:38:33Z")

</div>

> [@Jasmine\_Croghan](#):
>
> What could be making it redistribute landmarks?

Hard to tell without looking at the data. Can you provide 3-4 lmk files, a model and the list of lm you want to be excluded?

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [March 19, 2022, 11:23pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/7 "2022-03-19T23:23:59Z")

</div>

One issue I see is that the landmark index in the exclusion list should correspond to the index in the control points table. This index starts at 1, so 0 is an invalid. I will add error catching to alert the user of this. If you can provide some sample landmark files we can check if there is something else going on too  
.

 ![Screen Shot 2022-03-19 at 4.15.31 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/6/d67230881e4b660d4539156ff77c29594cbc526a.png)

---

<div class="post-metadata">

**Author:** ![Jasmine\_Croghan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine_croghan/32/14714_2.png) [@Jasmine\_Croghan](https://discourse.slicer.org/u/Jasmine_Croghan)\
**Post date:** [March 22, 2022, 7:42pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/8 "2022-03-22T19:42:28Z")

</div>

Interesting, I thought it would go by the name of the landmark. I will have to fix that on the next run. That may well be the issue! Currently waiting for it to finish another auto3DGM run that is taking quite a while. Here is a link for now of a couple of the .fcsv files, a .ply, and a list of landmarks to be removed.

[Link to requested files](https://drive.google.com/drive/folders/1SuQfq9RE7V71z5hK8aNLgHDmLueMFVMr?usp=sharing)

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 22, 2022, 8:32pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/9 "2022-03-22T20:32:15Z")

</div>

> [@Jasmine\_Croghan](#):
>
> I thought it would go by the name of the landmark.

That’s not possible, because there is no standard landmark naming convention. What if they are not numeric? Everything is based on the order of the landmarks.

I ran the samples provided, and I can confirm that GPA is definitely excluding the landmarks you have specified. But while doing that it also reorders them, so landmark names in the GPA output no longer matches the input. If this is critical for you, we might consider making that change. If so, please submit an feature request at [Issues · SlicerMorph/SlicerMorph · GitHub](https://github.com/SlicerMorph/SlicerMorph/issues)

Meanwhile, the scale of your dataset seems totally off. The coordinates are tiny. You may run into precision issues with such small coordinates. Make sure you are using the output from the auto3Dgm under OSS (original subject space) folder.

---

<div class="post-metadata">

**Author:** ![Jasmine\_Croghan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine_croghan/32/14714_2.png) [@Jasmine\_Croghan](https://discourse.slicer.org/u/Jasmine_Croghan)\
**Post date:** [March 22, 2022, 8:35pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/10 "2022-03-22T20:35:41Z")

</div>

Okay, I was wondering about how tiny those were! I had always used the aligned landmarks and meshes in the R implementation, but I will switch to the OSS landmark output folder.

Thank you so much for helping me solve these issues! I was beyond frustrated last week and these are very simple solutions (to my ignorance).

-Jasmine

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 22, 2022, 8:40pm UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/11 "2022-03-22T20:40:58Z")

</div>

> [@Jasmine\_Croghan](#):
>
> Okay, I was wondering about how tiny those were! I had always used the aligned landmarks and meshes in the R implementation, but I will switch to the OSS landmark output folder.

If you are going to use aligned meshes and landmarks, you really shouldn’t do a GPA. Those are considered already superimposed (AFAIK).

---

<div class="post-metadata">

**Author:** ![coco](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@coco](https://discourse.slicer.org/u/coco)\
**Post date:** [June 13, 2024, 8:03am UTC](https://discourse.slicer.org/t/slicermorph-gpa-will-not-exclude-landmarks/22594/12 "2024-06-13T08:03:50Z")

</div>

Interesting, I questionned that myself yesterday and wondered if indexes would shift after discarding landmarks so that you can keep track of landmarks by their displayed name. I think that change is needed if it has not been done so (I’ll check later)…
