# Markups : new point ID restart from 1 when loaded from saved scene

**URL:** <https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142>\
**Category:** Support\
**Created:** [December 20, 2021, 1:14pm UTC](https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142 "2021-12-20T13:14:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 20, 2021, 1:14pm UTC](https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142/1 "2021-12-20T13:14:02Z")

</div>

I’ve noticed an ID numbering problem with curve and fiducial markups. I have not tested all markups objects. Using home built Slicer on Linux. Found with factory build 4.13.0-2021-11-01 r30345 / 08aeb16 also.

- Start Slicer
- Load any volume (unused)
- Place 2 fiducial points
- Save the scene
- Restart Slicer
- Load the scene

First, we see that the Fiducial node is selected in the markups toolbar, but ‘Place new point button’ is greyed. To activate it we need to create a new markups. So,

- Create a markups open curve
- Place 3 points
- Stop point placement
- Save the scene

Next,

- Select the existing fiducial node ‘F’
- Place a new point
- Stop point placement
- Save the scene

We see that the third fiducial point is labeled ‘F-1’.

- Close Slicer
- Open F.mrk.json with a text editor

The first point has ID == 1, the second has ID == 2 and the third has ID == 1.  
We have the same result with GetNthControlPointID().

- Start Slicer again
- Load the scene
- Activate point placement, by selecting Fiducial ‘F’
- Select curve ‘OC’
- Place a fourth point
- Stop point placement
- Save the scene
- Close Slicer

If we inspect ‘OC.mrk.json’, we see that the fourth point ID == 1, just like with fiducials.

I hope someone else could confirm it, after which, core devs could have a look.

Regards.

---

<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:** [December 20, 2021, 1:18pm UTC](https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142/2 "2021-12-20T13:18:46Z")

</div>

Could you confirm with the latest Slicer preview build? Your factory build is a month and a half old which is quite behind latest development and fixes.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 20, 2021, 1:31pm UTC](https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142/3 "2021-12-20T13:31:10Z")

</div>

> [@chir.set](#):
>
> Using home built Slicer on Linux. Found with factory build 4.13.0-2021-11-01 r30345 / 08aeb16 also.

I confirm, found with :

- Home built : after ‘git pull’ today
- Factory build : 4.13.0-2021-11-01 r30345 / 08aeb16
- Factory build : 4.13.0-2021-12-19 r30507 / f779d8e

---

<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:** [December 22, 2021, 4:23am UTC](https://discourse.slicer.org/t/markups-new-point-id-restart-from-1-when-loaded-from-saved-scene/21142/4 "2021-12-22T04:23:23Z")

</div>

The last used control point number (that is used for generating the control point names) are not stored persistently, therefore the numbering starts from 0 every time the markup is loaded from disk. I’ve [updated the storage node](https://github.com/Slicer/Slicer/commit/b76bcebcaf6bc8705fdb8403655bb2b806de96aa) to save and restore this value.
