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

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.

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.

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
1 Like

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 to save and restore this value.

1 Like