# Markup annotations in Open Anatomy Export

**URL:** <https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366>\
**Category:** Development\
**Created:** [November 21, 2022, 9:43pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366 "2022-11-21T21:43:32Z")\
**Posts on this page:** 15\
**Page:** 1

<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:** [November 21, 2022, 9:43pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/1 "2022-11-21T21:43:32Z")

</div>

Is conceivable that glTF export functionality of Open Anatomy can support Markups?

Embedding models/segmentations in [3Dviewer.net](http://3Dviewer.net) is great, but occasionally one needs annotations (landmarks, labels etc) as well. Are there any alternative solutions for that?

---

<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:** [November 21, 2022, 10:22pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/2 "2022-11-21T22:22:54Z")

</div>

They could be exported as static geometry. Maybe the easiest and most general would be to have an option in Slicer to convert Markups to Models and then they would export automatically to glTF.

---

<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:** [November 22, 2022, 12:51am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/3 "2022-11-22T00:51:05Z")

</div>

İ tried markups to models extension, but unfortunately text labels are not converted. Also essentially all you can do curves or lines, which can be acceptable for callouts, but lack of labels is a concern.

---

<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:** [November 22, 2022, 3:36am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/4 "2022-11-22T03:36:48Z")

</div>

Can you do labels well in that 3D viewer? We could export polygon text but I believe they won’t orient towards the camera (“billboard” mode) like they do in Slicer.

---

<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:** [November 22, 2022, 4:31am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/5 "2022-11-22T04:31:29Z")

</div>

> [@pieper](#):
>
> Can you do labels well in that 3D viewer?

No idea, haven’t gone that far. Know other free viewers that handles text?

---

<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:** [November 22, 2022, 5:36am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/6 "2022-11-22T05:36:03Z")

</div>

It would be doable with vtkjs. I haven’t seen it done exactly, but it should be pretty straightforward… Now that OHIF-v3 has really nice vtkjs-based slice rendering it could be a good time to consider what it would take to build on it make a web viewer that has more Slicer-like functionality.

---

<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:** [November 22, 2022, 6:06am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/7 "2022-11-22T06:06:07Z")

</div>

The important trick (for me at least) is being able to run this without requiring a dedicated website. I really love [3Dviewer.net](http://3Dviewer.net)’s passthrough URL functionality. For example I cannot maintain a publicly accessible website, but I can post data somewhere on the cloud with a sharable URL…

Would it be possible to do that with vtkjs?

---

<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:** [November 22, 2022, 6:10am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/8 "2022-11-22T06:10:47Z")

</div>

Yes, all that can be done with vtk.js and with ohif.

There’s definitely programming required to make it just the way we want it.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [November 22, 2022, 11:27am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/9 "2022-11-22T11:27:05Z")

</div>

Could you post such a link and what input would you use?

---

<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:** [November 22, 2022, 6:19pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/10 "2022-11-22T18:19:55Z")

</div>

We might be able to build on this: [Kitware Glance](https://kitware.github.io/glance/app/)

---

<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:** [November 22, 2022, 7:11pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/11 "2022-11-22T19:11:13Z")

</div>

> [@rbumm](#):
>
> Could you post such a link and what input would you use?

Sample data from SlicerMorph [https://github.com/SlicerMorph/SampleData/blob/master/baboon.gltf](https://github.com/SlicerMorph/SampleData/blob/master/baboon.gltf)

You just turn into a link like this:

`https://3dviewer.net/index.html#model=https://github.com/SlicerMorph/SampleData/blob/master/baboon.gltf`

this is from the open anatomy extension tutorial by the way.

---

<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:** [November 22, 2022, 7:15pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/12 "2022-11-22T19:15:13Z")

</div>

> [@pieper](#):
>
> We might be able to build on this: [Kitware Glance](https://kitware.github.io/glance/app/)

It looks promising, but when I tried to load MRHead.nrrd I didn’t get anything, and I couldn’t figure out how to turn on 3D rendering… Not sure if it is a browser thing (firefox).

---

<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:** [November 22, 2022, 9:39pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/13 "2022-11-22T21:39:34Z")

</div>

[3dviewer.net](http://3dviewer.net) supports picking: if you click on a part then its name is highlighted in the mesh tree. Therefore, additional labels may not be necessary.

If you want to add labeled points then the OpenAnatomy exporter could be very easily enhanced to export each markup point as a separate small sphere. If you click on the small sphere then you can see its label in the mesh tree.

---

<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:** [November 22, 2022, 10:28pm UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/14 "2022-11-22T22:28:12Z")

</div>

> [@lassoan](#):
>
> If you want to add labeled points then the OpenAnatomy exporter could be very easily enhanced to export each markup point as a separate small sphere. If you click on the small sphere then you can see its label in the mesh tree.

Thank you! I will try that. Do we currently have UI driven method to export markups to spheres? (I don’t think Markups to Models module do that).

---

<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:** [November 23, 2022, 12:23am UTC](https://discourse.slicer.org/t/markup-annotations-in-open-anatomy-export/26366/15 "2022-11-23T00:23:15Z")

</div>

I don’t think there is a function to export each markup point to a separate sphere model node, but it should be easy to write a short script for it (using a vtkSphereSource, similarly to this [example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#define-edit-a-circular-region-of-interest-in-a-slice-viewer)).
