# Is there a way to have all vertices on a vtk model be markups/landmarks?

**URL:** <https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752>\
**Category:** Support\
**Tags:** vtk, markups, slicermorph\
**Created:** [April 4, 2023, 8:54pm UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752 "2023-04-04T20:54:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gening\_Dong](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gening_dong/32/14706_2.png) [@Gening\_Dong](https://discourse.slicer.org/u/Gening_Dong)\
**Post date:** [April 4, 2023, 8:54pm UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752/1 "2023-04-04T20:54:47Z")

</div>

Hi,

I’m trying to match the node IDs between two vtk models. I was thinking if it’s possible to have all vertices on a vtk model be markups, so that I can directly use the vertices on the surface of the source model as its landmarks and perform ALPACA in the SlicerMorph module.

Thanks,  
Gening

---

<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:** [April 4, 2023, 10:28pm UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752/2 "2023-04-04T22:28:54Z")

</div>

You can look at the script repository and to probably work that out.  
[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#markups](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#markups)  
[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#models](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#models)

What is your goal with ALPACA? To register these two vtk models, or to transfer your landmarks from one model to the other?

---

<div class="post-metadata">

**Author:** ![Gening\_Dong](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gening_dong/32/14706_2.png) [@Gening\_Dong](https://discourse.slicer.org/u/Gening_Dong)\
**Post date:** [April 4, 2023, 10:38pm UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752/3 "2023-04-04T22:38:17Z")

</div>

Thanks for the reply!

I’d like to match points 1:1 on two vtk models. My plan is to register two vtk models using ALPACA first and then match the points between the TPS warped model and the target model by finding nearest neighbors of points.

Would it be possible to directly transfer landmarks from one model to the other using SlicerMorph? I saw the ProjectSemiLM utility modules, but could it project those landmarks to the vertices of the target model?

Best,

Gening

 ![A7CF354468834AF2A6902E7B6C953F14.png](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/13228e9e732d507c72b00e023276e1da7fbb4a5c.png)

---

<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:** [April 4, 2023, 10:48pm UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752/4 "2023-04-04T22:48:32Z")

</div>

> [@Gening\_Dong](#):
>
> Would it be possible to directly transfer landmarks from one model to the other using SlicerMorph? I saw the ProjectSemiLM utility modules, but could it project those landmarks to the vertices of the target model?

ALPACA will transfer points on one (source) model to the target model for you.

ALPACA is a point-cloud registration. We often work with 3D models with hundreds of thousands (or more) vertices, but our anatomical landmarks on them are far sparser (from tens to thousands range). To improve the speed, we turn the models into downsampled pointclouds, do the registration as point clouds, and then apply the resultant transformation to the models. This seem to perform sufficiently well, and rather fast, for our use cases. I am not sure how well your LMs will be transferred if you use every single vertex as a landmark. We never tried such approach.

TPS deformation is very slow when you have large number of points. Also projectSemiLM module requires existence of manually annotated landmarks on source and target models (see [https://github.com/SlicerMorph/SlicerMorph/tree/master/Docs/ProjectSemiLM](https://github.com/SlicerMorph/SlicerMorph/tree/master/Docs/ProjectSemiLM)). I don’t think it will work for your case.

---

<div class="post-metadata">

**Author:** ![Chuan](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chuan](https://discourse.slicer.org/u/Chuan)\
**Post date:** [November 16, 2023, 8:52am UTC](https://discourse.slicer.org/t/is-there-a-way-to-have-all-vertices-on-a-vtk-model-be-markups-landmarks/28752/5 "2023-11-16T08:52:55Z")

</div>

Hi Gening,

Recently I have a similar task with yours. Could you tell me which way did you finally choose then to extract all nodes as landmarks and transfer those landmarks to other target models?

Best regards,  
Chuan
