# Using json files to create markups

**URL:** https://discourse.slicer.org/t/using-json-files-to-create-markups/22754
**Category:** Support
**Tags:** markups
**Created:** [March 29, 2022, 5:59pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754 "2022-03-29T17:59:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Tulika\_Nandi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tulika_nandi/32/10110_2.png) [@Tulika\_Nandi](https://discourse.slicer.org/u/Tulika_Nandi)
#### Post date: [March 29, 2022, 5:59pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/1 "2022-03-29T17:59:05Z")

</div>

Hi, I’m trying to create a line markup by loading a json file. I am able to see the line in the 3D view but not in the slice views despite trying our various display and visibility options. Could you share an example json file for a line that works? Similar to the example for fiducials provided here - [Markups — 3D Slicer documentation](https://slicer.readthedocs.io/en/v4.11/user_guide/modules/markups.html).

Also, for the schema, I am not able to use v1.0.3 - could you provide a correct link to use for this?

Tulika

---

<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: [March 31, 2022, 4:19pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/2 "2022-03-31T16:19:30Z")

</div>

In recent Slicer versions we added `positionStatus` field, which seems to be initialized to `undefined` by default. I’ll change that to be set to `defined` by default when `position` is specified. The new behavior will be available in tomorrow’s Slicer Preview Release.

As a workaround, you can specify `"positionStatus": "defined"` for each control point.

---

<div class="post-metadata">

### Author: ![Tulika\_Nandi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tulika_nandi/32/10110_2.png) [@Tulika\_Nandi](https://discourse.slicer.org/u/Tulika_Nandi)
#### Post date: [April 1, 2022, 3:08pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/3 "2022-04-01T15:08:42Z")

</div>

That works - thank you!

---

<div class="post-metadata">

### Author: ![Tulika\_Nandi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tulika_nandi/32/10110_2.png) [@Tulika\_Nandi](https://discourse.slicer.org/u/Tulika_Nandi)
#### Post date: [April 1, 2022, 3:31pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/4 "2022-04-01T15:31:06Z")

</div>

One more question - when creating fiducials using a json file, is there a way to change the color of each fiducial individually?

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [April 1, 2022, 3:38pm UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/5 "2022-04-01T15:38:05Z")

</div>

Control points in a Markups Point List can have unique label names for each control point, but the entire list has a single display which includes color. Therefore all control points in a single Point List must have the same color, but different Point Lists can have their own color.

---

<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: [April 2, 2022, 1:11am UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/6 "2022-04-02T01:11:01Z")

</div>

In one point list you can use two colors - selected and unselected.

In recent Slicer versions you can add any amount of additional metadata for each control point. That can be used for coloring curves, but not yet for coloring the control points. This control point coloring would not be hard to implement, but right now I don’t know about any project that will need this in the near future.

If you need this feature and you are somewhat familiar with C++ then you can help with the implementation. Alternatively, you can generate a colored model using vtkGlyph3D filter using a short (about 10-20 lines) Python script.

---

<div class="post-metadata">

### Author: ![Tulika\_Nandi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tulika_nandi/32/10110_2.png) [@Tulika\_Nandi](https://discourse.slicer.org/u/Tulika_Nandi)
#### Post date: [April 4, 2022, 8:22am UTC](https://discourse.slicer.org/t/using-json-files-to-create-markups/22754/7 "2022-04-04T08:22:08Z")

</div>

Thank you for the suggestions! Sorry I don’t have experience with C++ so can’t help with that. It’s not crucial for me at the moment - the workaround of using separate point lists should be enough for now.
