# How to add slice intersection button in gui?

**URL:** <https://discourse.slicer.org/t/how-to-add-slice-intersection-button-in-gui/16877>\
**Category:** Development\
**Tags:** python\
**Created:** [March 31, 2021, 3:11pm UTC](https://discourse.slicer.org/t/how-to-add-slice-intersection-button-in-gui/16877 "2021-03-31T15:11:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay\_pillai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akshay_pillai/32/8301_2.png) [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Post date:** [March 31, 2021, 3:11pm UTC](https://discourse.slicer.org/t/how-to-add-slice-intersection-button-in-gui/16877/1 "2021-03-31T15:11:57Z")

</div>

I’m trying to create a button in my module that works just like the slice intersection checkbox. When I click on the button I want to toggle the slice intersection visibility. What would I put in def onClick() or how do I toggle slice intersection using python?

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [March 31, 2021, 5:25pm UTC](https://discourse.slicer.org/t/how-to-add-slice-intersection-button-in-gui/16877/2 "2021-03-31T17:25:04Z")

</div>

Hi @akshay_pillai, there is an example of toggling slice intersections in the [Slicer script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository). It involves setting the slice intersection visibility. Let us know how it goes.
