# Extending the Markups module

**URL:** <https://discourse.slicer.org/t/extending-the-markups-module/14882>\
**Category:** Development\
**Created:** [December 4, 2020, 12:23pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882 "2020-12-04T12:23:18Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 4, 2022, 2:26pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/21 "2022-03-04T14:26:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 4, 2022, 2:43pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/22 "2022-03-04T14:43:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 4, 2022, 3:06pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/23 "2022-03-04T15:06:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 4, 2022, 3:12pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/24 "2022-03-04T15:12:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 4, 2022, 3:21pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/25 "2022-03-04T15:21:47Z")

</div>

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

> <https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/Logic/vtkSlicerMarkupsLogic.h#L261>

Unless I misunderstand names again…

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 4, 2022, 3:24pm UTC](https://discourse.slicer.org/t/extending-the-markups-module/14882/26 "2022-03-04T15:24:51Z")

</div>

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

[Previous page](https://discourse.slicer.org/t/extending-the-markups-module/14882.md?page=1)
