# Read In JSON Landmark files

**URL:** <https://discourse.slicer.org/t/read-in-json-landmark-files/8548>\
**Category:** Support\
**Tags:** markups-fiducials\
**Created:** [September 24, 2019, 3:39pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548 "2019-09-24T15:39:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [September 24, 2019, 3:39pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/1 "2019-09-24T15:39:28Z")

</div>

Hi, I was wondering fi there was a way to read in landmark json files into 3D Slicer. I have Json files such as the following: [{“id”:“A”,“coordinates”:[-24.27351391435728,28.911588222173073,-123.59017318765929],“uncertainty”:{“stddevs”:[1.0314645489033252,1.0102904254707992,0.9816888397547289],“pcvectors”:[[-0.5679702259804069,-0.8192947708623337,-0.07852325029825062],[0.8142129897713141,-0.5732519865382224,0.09186602863757418],[-0.12027896610556417,-0.011757481346694274,0.9926705052256556]]}} created from another program and would like to be able to display them in 3D Slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 24, 2019, 3:59pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/2 "2019-09-24T15:59:58Z")

</div>

In short term, you can probably implement this in 10-15 lines of python code (read in the json file, iterate through its items and add each point to a markups node).

We are planning to implement markups import/export in json format. Is the file that you received follows some commonly used standard or it is just invented for a particular project?

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [September 25, 2019, 8:46pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/3 "2019-09-25T20:46:49Z")

</div>

It’s a common standard. I’ve found it in several statistical shape modelling programs.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 25, 2019, 8:58pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/4 "2019-09-25T20:58:45Z")

</div>

Can you provide some references? It would be nice to know if there’s community agreement on such a standard. Does the standard have a name?

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [September 26, 2019, 1:24am UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/5 "2019-09-26T01:24:24Z")

</div>

So not sure if you’re talking about references for the standard itself or the software, but the software I have found that uses it is RvtkStatismo, Statismo, and Scalismo all for statistical shape modelling.

---

<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, 2019, 1:50am UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/6 "2019-09-26T01:50:26Z")

</div>

JSON itself is not a standard for anything specific, it is a format to exchange data of many different kinds. What we are interested in learning if there was a common convention to describe landmark coordinates agreed upon communities. From what I am seeing in the few lines of the sample in the original email, it doesn’t appear that way to me but I might be mistaken.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 26, 2019, 11:28am UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/7 "2019-09-26T11:28:03Z")

</div>

> [@stevenagl12](#):
>
> talking about references for the standard itself

Hi @stevenagl12 - Yes, that is the question. Your original email implied that this particular json encoding is a kind of agreed upon standard for interchange of these landmark files, so my question is whether this kind of file has a particular name (json is of course generic). Even better, perhaps there is a json schema and/or a human readable description of the file format?

If there’s something well defined we could consider supporting it - as @lassoan says, it doesn’t look like it would be much work to implement.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [October 1, 2019, 4:25pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/8 "2019-10-01T16:25:35Z")

</div>

I’m not exactly sure, all I know is that using those softwares previously mentioend produces the same type of JSON formatted files with coordinates, uncertainty, and pcvectors from any mesh being landmarked.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 2, 2019, 3:44am UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/9 "2019-10-02T03:44:57Z")

</div>

Can you post a link to a json file that contains named landmarks? Statismo file format is probably only used by that software, so Slicer would not adopt it as is, but we could still learn from it.

---

<div class="post-metadata">

**Author:** ![Emmanuel\_Salinas\_Mir](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/emmanuel_salinas_mir/32/6032_2.png) [@Emmanuel\_Salinas\_Mir](https://discourse.slicer.org/u/Emmanuel_Salinas_Mir)\
**Post date:** [July 18, 2020, 12:29pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/10 "2020-07-18T12:29:20Z")

</div>

Hi

EPAD also works with JSON landmarks using AIM protocol[Annotation and Image Markup - AIM](https://wiki.nci.nih.gov/display/AIM/Annotation+and+Image+Markup+-+AIM).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 18, 2020, 2:48pm UTC](https://discourse.slicer.org/t/read-in-json-landmark-files/8548/11 "2020-07-18T14:48:27Z")

</div>

We checked out AIM but in many aspects it was too complex, yet it would have been too limiting to be used as an internal storage format. We decided that if there is interest then exporter/importer can be added for this format (similarly to DICOM).
