# Landmarks and mesh not aligned

**URL:** https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864
**Category:** Support
**Created:** [September 26, 2021, 11:29am UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864 "2021-09-26T11:29:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lv\_xiao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lv_xiao/32/8224_2.png) [@lv\_xiao](https://discourse.slicer.org/u/lv_xiao)
#### Post date: [September 26, 2021, 11:29am UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864/1 "2021-09-26T11:29:33Z")

</div>

Hi everyone, I created a symmetric 3D human facial mesh in R (exported as .ply using vcgPlyWrite function in Rvcg) and also digitised 5 midfacial landmarks along the facial axis of symmetry (exported as fcsv using write.fcsv in Morpho). In R, plotting reveals that the 5 landmarks are exactly along facial midline. However, when I load the .ply and .fcsv into Slicer3d, the landmarks no longer lie along facial midline.

This is the face and landmarks in R:

 ![4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/6/e6208923304bff619d4a697d07e2d9523e122a72.jpeg)

This is the face and landmarks in Slicer3d:

 ![3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/c/8c878206a0ee27554f90198483485a560e33caea.jpeg)

Similarly, I noted that although the Sample Data Gorilla\_template\_LM1.fcsv lie on 3D mesh of Gor\_template\_low\_res.ply, when I import both files into R and plot, the landmarks no longer lie on the surface of the mesh.

This is the R code to load and plot the Gorilla data:

 ![2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/c/1c29a9c97bb31fc13bc389d7b10906483f8ef075.jpeg)

This is a screeshot of the plot generated:

 ![Snipaste_2021-09-26_18-46-51](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/7/475db7b464be22137cc4d4707d707572c3dca366.jpeg)

I want to know why the landmarks that are correctly positioned in R appear incorrectly positioned in Slicer3d and vice versa. What should be done to have the facial landmarks lie along facial midline and on the facial surface in Slicer3d?

---

<div class="post-metadata">

### Author: ![Fluvio\_Lobo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fluvio_lobo/32/81262_2.png) [@Fluvio\_Lobo](https://discourse.slicer.org/u/Fluvio_Lobo)
#### Post date: [September 26, 2021, 12:34pm UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864/2 "2021-09-26T12:34:06Z")

</div>

@lv_xiao,

I am not sure what exactly causes this issue, but it looks like the fiducials/markers are maintaining a relative position/orientation with respect with each other, just not the model… perhaps the model and the fiducials/markers don’t share the same origin?

If I were you, I would start by placing some fiducials on the model using slicer, perhaps on the symmetric face model since there are only 4-5. Then, I would export those landmarks as a .fcsv file and compare the data in the file to the one you generated using R.

Let me know if this helps,

---

<div class="post-metadata">

### Author: ![lv\_xiao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lv_xiao/32/8224_2.png) [@lv\_xiao](https://discourse.slicer.org/u/lv_xiao)
#### Post date: [September 26, 2021, 2:23pm UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864/3 "2021-09-26T14:23:46Z")

</div>

> [@Fluvio\_Lobo](#):
>
> would start by placing some fiducials on the model using slicer

Thank you for the reply. I agree that probably the issue is due to different origin. I followed your suggestion to place several fiducials in slicer, exported the landmarks, and plotted in R. The points lie perfect well on facial surface as I have done in R.

However, I really need to import some externally digitized landmarks into slicer. Therefore, I wish to figure out how these externally digitized landamrks, when loaded into slicer, could still be correctly positioned.

I have uploaded my facial .ply and .fscv file into [GitHub](https://github.com/Patricklv/Landmarks-in-Slicer3d-not-correctly-aligned) so that my issue might be better helped.

---

<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: [September 26, 2021, 3:10pm UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864/4 "2021-09-26T15:10:04Z")

</div>

> [@lv\_xiao](#):
>
> I want to know why the landmarks that are correctly positioned in R appear incorrectly positioned in Slicer3d and vice versa. What should be done to have the facial landmarks lie along facial midline and on the facial surface in Slicer3d?

I can’t comment on why your external landmarks showing up displaced in Slicer, as @Fluvio_Lobo commented there might be other things going on and you will need to troubleshoot it yourself.

As for the gorilla LMs being different in R, I assume that’s because the model was in LPS and R is reading it as if it is RAS. If you negate the first two coordinates of LMs in R, they should line up.

You can try the SlicerMorphR package and see if the read/write markups function (along with options to specify coordinate system) helps you. See at [GitHub - SlicerMorph/SlicerMorphR: R convenience functions for importing SlicerMorph dataset](https://github.com/SlicerMorph/SlicerMorphR)

---

<div class="post-metadata">

### Author: ![lv\_xiao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lv_xiao/32/8224_2.png) [@lv\_xiao](https://discourse.slicer.org/u/lv_xiao)
#### Post date: [September 26, 2021, 3:51pm UTC](https://discourse.slicer.org/t/landmarks-and-mesh-not-aligned/19864/5 "2021-09-26T15:51:53Z")

</div>

Thank you so much for the explanation. Errors for both data are due to the issue of LPS/RAS. Solved.
