Extending the Markups module

If I understand your question correctly (I think btw it should be a new thread), then I have a simple suggestion.

I recently implemented a similar use case, in which the user clicks a button that says “Add ROI”, but in reality it initiates fiducial placement, which then, by observing the point added event, creates a ROI in the same position as a center. The fiducial node is not used for anything else and I am not interested in seeing it in any list. Is this the same kind of use case?

If so, my solution was just to call HideFromEditorsOn for the fiducials node, and it worked nicely.

Thanks @cpinter. Would HideFromEditorsOn prevent the creation of the markups add button in the toolbar and in the Markups module gui? I have a few of these ephimeral markups and it clutters the UI for something the user should never use independently.

I don’t quite understand. Is it a new markup type? Or why is any button created?

In the pluggable architecture, the markups toolbar and the Markups UI get populated with the registered markups. If I register a new markup in an external module a new button for adding a markup of that type is added. I want to avoid having “add markups” buttons for these ephimeral markups, they cannot be used directly and users should not get a button to add something they cannot use. Does it make sense?

Ah I see, so it is a new type. I got confused by the register function. Anyway, as I see there is a createPushButton argument in the function

Unless I misunderstand names again…

Yes, of couse! Thank you @cpinter. The funny thing is that I created that function, but I did not remember about it :smile:

1 Like