Request: move one control point menu item

Hi,

In the context menu of control points, the ‘Delete control point’ and ‘Delete <Markup>’ items are one after the other. It happened (rarely though) that the markups node gets accidentally deleted while deleting one point, just a wrong mouse position in a haste.

Menu_item_ordering

Would core devs consider moving the ‘Delete control point’ item upwards? Perhaps after ‘Rename control point’.

Thanks for considering and regards.

1 Like

+1.

It happened to me more than once.

Probably enabling undo/redo is the right solution for this. You can enable undo/redo by copy-pasting this code snippet to your Python console (or add it to your startup script to always enable).

We incorporated that into SlicerMorph as an option. It is ok for recovering deleted control points, but it creates weird issues when you are recovering a node.

Scene undo/redo for the node types listed in the code snippet should work well. Please report any issues that you find.

It works well indeed, even to recover a deleted node.

One last thing, could you point to a code snippet to move a newly created toolbar to the first row?

Thank you.

1 Like

I don’t think you can specify where the toolbar is added, but if you move the toolbar manually then the same position will be restored after you restart the application - if “Save user interface…” option is enabled (in Application settings / Appearance).

This option is already activated in settings. My custom toolbar gets always created in second row and I move it up every time. I can just add the icons of the Undo/Redo code snippet in my custom toolbar, so that I don’t have 2 of them to move. This is very useful. :+1:t3:

I think measurements being blocked bug has not been addressed yet. Adding a default Markups node to scene removes measurements · Issue #7239 · Slicer/Slicer · GitHub

Also, try creating a pointlist with 3-4 points. Delete the node, recover, and repeat the operation a few times (undo/redo), notice that one by one the points start to disappear from the list.

I also noticed a case where the node was removed from the scene by right click delete scene and yet the points remained visible in the 3D viewer. I can’t remember the sequence this was generated from. I will try to replicate…

But it is such a critical features, I think we should harden and incorporate into the core, as opposed to keeping at a snippet.

On repeat Undo/Redo after removing a fiducial node with 3 points, I do not see the points disappearing.

I noticed something else:

  • create a Fiducial node with 3 points
  • delete the node
  • Undo
  • Undo again : the third point is removed in the Markups module, but still persists in a slice view, being non-interactive. The first and second points become non-interactive also.
  • Redo - the third point reappears in the Markups module, and all three points become interactive in the slice view.

It seems to be N° 1 in the feature request section.