# Convert .PTS landmarks coordinates in .fcsv or .LPS format

**URL:** <https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303>\
**Category:** Support\
**Tags:** markups-fiducials\
**Created:** [July 10, 2024, 1:53pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303 "2024-07-10T13:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ATroyelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atroyelli/32/66917_2.png) [@ATroyelli](https://discourse.slicer.org/u/ATroyelli)\
**Post date:** [July 10, 2024, 1:53pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303/1 "2024-07-10T13:53:16Z")

</div>

Hi!

Is it possible to transform a file of .PTS landmark coordinates into .fcsv or .LPS/.RAS format? I have landmarks coordinated in .TPS to use as templates in ALPACA.

Thank you very much in advance

Adrian

Operating system: Windows 10 (x64)  
Slicer version: 5.6.2  
Expected behavior:  
Actual behavior:

---

<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:** [July 10, 2024, 3:28pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303/2 "2024-07-10T15:28:54Z")

</div>

There is nothing that will automatically do this in Slicer. You can of course develop a python script to do that.

If you are using R, I think geomorph reads TPS files, and you can then use SlicerMorphR to write them as fcsv. Although I highly encourage you switch to JSON (both functions are available in SlicerMorph write.markups.fcsv, or write.markups.json)

---

<div class="post-metadata">

**Author:** ![ATroyelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atroyelli/32/66917_2.png) [@ATroyelli](https://discourse.slicer.org/u/ATroyelli)\
**Post date:** [July 10, 2024, 9:29pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303/3 "2024-07-10T21:29:36Z")

</div>

Thank you very much! Anyway, I ´ll try to develop an algorithm to obtain this trasnformation

---

<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:** [July 10, 2024, 9:40pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303/4 "2024-07-10T21:40:35Z")

</div>

If you know the PTS format, this should be simple. Read the landmark coordinates as a numpy array, and write them as a mrk.json one specimen at a time. For a basic mrk.json example see with 3 landmarks:

[https://slicer.readthedocs.io/en/latest/developer\_guide/modules/markups.html#markups-json-file-format-mrk-json](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html#markups-json-file-format-mrk-json)

---

<div class="post-metadata">

**Author:** ![ATroyelli](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/atroyelli/32/66917_2.png) [@ATroyelli](https://discourse.slicer.org/u/ATroyelli)\
**Post date:** [July 18, 2024, 7:05pm UTC](https://discourse.slicer.org/t/convert-pts-landmarks-coordinates-in-fcsv-or-lps-format/37303/5 "2024-07-18T19:05:58Z")

</div>

Great!. I´ll try that.

Thank you so much!
