Markup renaming error loses numbering

Hi, I’m running into some sort of bug when renaming a point list. If I start off with a point list that is named using the scheme 7_1-%d and then I try to remove the underscore to make it 7-%d, the whole numbering scheme is lost and every point is renamed to 7-1.
(This is repeatable and generalize-able, if I start with points named 7_3-%d, trying to remove the underscore changes every point to 7-3)
I assume this is a problem with underscores confusing the renaming process, but I can’t figure out how to stop it from happening.

I cannot reproduce this. Which Slicer version are you using? Could you record a screen capture video as you reproduce the unexpected behavior and share it here?

Slicer version: 5.0.3 r30893 / 7ea0f43

Please try with latest stake 5.4…0

I see, this explains why you have trouble with the rename. When the name contains multiple numbers then the first number is assumed to be part of the name and the second number is assumed to be the point number. This heuristics works well for most cases, as Slicer generates unique node names from a prefix by adding _{counter} to it.

In your case, the second number was 1 for all the control points, therefore %d got replaced by 1 for all your points.

One solution could be to not use a number as node name (e.g., use P7 instead of 7). I would recommend this because this would make the points easier to identify anyway.

Another solution could be to set the node name before you start placing points

You could also write a 2-3-line code snippet that renames the points any way you need.

We could tune the renaming heuristics to match your current needs, but it may not be desirable for others. We could add more options to configure the behavior but the GUI of thr module is already way too complex, so it would be better to avoid adding more to it.

I wonder if it would be feasible to copy/paste the labels from somewhere. I know we can copy and paste whole control points, but this would be restricted to labels column only.

@slopezal you would completely avoid the issue of renaming your landmarks, if you use a markups template with your proper landmark numbers/IDS. it only take a minute or two create blank template, and it will also provide you other safety checks such as not messing up the ordering of the landmarks, or accidentally skipping some.

1 Like

Ah thank you! I was using the first number as a name and the second number to index which replicate it was, but I am pretty sure I will be able to work around this now that I understand what is happening.

1 Like