# Custom visualization behavior on clicking "eye" icon

**URL:** <https://discourse.slicer.org/t/custom-visualization-behavior-on-clicking-eye-icon/31620>\
**Category:** Support\
**Created:** [September 8, 2023, 5:35pm UTC](https://discourse.slicer.org/t/custom-visualization-behavior-on-clicking-eye-icon/31620 "2023-09-08T17:35:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfrwilson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pfrwilson/32/66902_2.png) [@pfrwilson](https://discourse.slicer.org/u/pfrwilson)\
**Post date:** [September 8, 2023, 5:35pm UTC](https://discourse.slicer.org/t/custom-visualization-behavior-on-clicking-eye-icon/31620/1 "2023-09-08T17:35:54Z")

</div>

Hi Community,

My use case involves loading and visualizing tracked ultrasound sequences. I have been using the volume reslice driver to set up visualization, and have implemented a function which successfully sets up this visualization. So far I have been controlling it by using a node combo box and the “nodeActivated” signal.

An even better solution would be to customize the behavior of clicking the “eye” icon in the subject hierarchy view widget in my module:

 ![Screenshot 2023-09-08 at 1.35.16 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/9/8918e78f2c44817b3d13606276b44234da7f82a6.png)

Any idea how to approach this? Is a signal or event emmitted somewhere when this eye icon is clicked?

Paul

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [September 8, 2023, 6:04pm UTC](https://discourse.slicer.org/t/custom-visualization-behavior-on-clicking-eye-icon/31620/2 "2023-09-08T18:04:54Z")

</div>

I don’t know if there’s a signal/event or how this would be customized if possible, but in case it can help [here is the code that gets executed when you left-click the eye.](https://github.com/Slicer/Slicer/blob/6fc6a2abe964263f7cdef4c57fd1675a561256f4/Modules/Loadable/SubjectHierarchy/Widgets/qMRMLSubjectHierarchyTreeView.cxx#L1471-L1475)

---

<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 8, 2023, 9:13pm UTC](https://discourse.slicer.org/t/custom-visualization-behavior-on-clicking-eye-icon/31620/3 "2023-09-08T21:13:09Z")

</div>

The behavior of the eye icon is designed to be customizable. All you need to do is to create a subject hierarchy plugin, make that plugin return higher value in `canOwnSubjectHierarchyItem` method and specify any behavior you need in the `visibilityIcon` method. See a complete example [here](https://github.com/SlicerHeart/SlicerHeart/blob/master/ValveAnnulusAnalysis/HeartValveLib/HeartValvesSubjectHierarchyPlugin.py).
