Everything is good however I’d like to modify the delete button so that it deletes ALL mark-ups instead of just the last one. I’d like to modify this on my .py file however it seems like the code for Markups module is done by C++.
Not only that, as it currently stands, if I click the delete button (delete last added markup point), it only deletes the sphere balls, but not the line. I’d like to delete the line as well.
The delete all points option shows up with a long mouse press. There is an update of this widget in-progress that will change this to a drop down menu arrow, since this interface option is rarely used and can be confusing.
Which version of Slicer are you using? The place button should be updating with the current markup type, and deleting the line and last point with the delete button, or the line and both points with the delete all option. This was working for me with your code snippet.
As we can see, the line is persisting although the spheres can be removed.
Also, is there a way for me to edit so that instead of the long mouse press, I can delete all using a single mouse press? in the .py file.
Lastly, instead of summoning a separate tab window for the qSlicerMarkupsPlaceWidget, is there a way for me to have it stay within the 3D scene view window only?
Are you using the stable version of 3D Slicer? This behavior is caused by the widget not updating to the correct markup type, but I can’t replicate this error on my end.
You could incorporate this widget in a module, but these functions will also be available in the main toolbar in the upcoming markups update.
Very strange. Yes I’m using the latest stable version - 4.11.20210226
Could it be something related to my code? If you wouldn’t mind copying & pasting my code into yours.
And great yes I plan to incorporate the widget into my module. Would you be able to provide a brief guidance on how I can do this programmatically? Any example project that incorporates qSlicerMarkupsPlaceWidget programmatically would be great
Hi Sara, is it just me or has placing a fiducial point become a little buggy after this update? I feel like even if I move just a little bit after I click, or don’t hold the mouse click long enough, the fiducial point does not get placed. Has there been a change in code with regards to this?
Great! If you are adding the qSlicerMarkupsPlaceWidget to a module, it might be helpful to check out the SimpleMarkupsWidget which uses this widget to see how to set the parameters.
I am also working on an update to the qSlicerMarkupsPlaceWidget which should be available in the next stable version, that will add it to the main Slicer toolbar.
With the current behavior, the “delete all” button removes points from the current markups node only. Removing all points from active and non-active nodes could potentially be useful, but also risky.
Are there cases where a simple “clear scene” would not work?
Oh okay. So is there no way for me to delete all of the lines using the delete button?
I do have models I’d like to keep in the scene so clear scene would not be so ideal.