# Markup renaming error loses numbering

**URL:** <https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971>\
**Category:** Support\
**Created:** [September 30, 2023, 4:20am UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971 "2023-09-30T04:20:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![slopezal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slopezal/32/67692_2.png) [@slopezal](https://discourse.slicer.org/u/slopezal)\
**Post date:** [September 30, 2023, 4:20am UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/1 "2023-09-30T04:20:21Z")

</div>

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.

---

<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:** [September 30, 2023, 4:25am UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/2 "2023-09-30T04:25:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![slopezal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slopezal/32/67692_2.png) [@slopezal](https://discourse.slicer.org/u/slopezal)\
**Post date:** [September 30, 2023, 1:37pm UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/3 "2023-09-30T13:37:42Z")

</div>

Slicer version: 5.0.3 r30893 / 7ea0f43

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/add93d08e9d980c61779080a22493d338c788196.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/add93d08e9d980c61779080a22493d338c788196.mp4)

---

<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:** [September 30, 2023, 2:23pm UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/4 "2023-09-30T14:23:04Z")

</div>

Please try with latest stake 5.4…0

---

<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:** [September 30, 2023, 2:45pm UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/5 "2023-09-30T14:45:41Z")

</div>

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.

---

<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:** [September 30, 2023, 5:02pm UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/6 "2023-09-30T17:02:46Z")

</div>

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.

[![](https://img.youtube.com/vi/SUouhaIMWXw/maxresdefault.jpg "Landmark Templates in 3D Slicer") ](https://www.youtube.com/watch?v=SUouhaIMWXw)

---

<div class="post-metadata">

**Author:** ![slopezal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slopezal/32/67692_2.png) [@slopezal](https://discourse.slicer.org/u/slopezal)\
**Post date:** [October 2, 2023, 3:57pm UTC](https://discourse.slicer.org/t/markup-renaming-error-loses-numbering/31971/7 "2023-10-02T15:57:33Z")

</div>

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.
