# Set filter to the scene based on displayable node attributes

**URL:** https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138
**Category:** Development
**Created:** [December 20, 2021, 12:18am UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138 "2021-12-20T00:18:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)
#### Post date: [December 20, 2021, 12:18am UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138/1 "2021-12-20T00:18:57Z")

</div>

Hi,

I’m looking for a way to hide/show displayable nodes based on their attribute value.

I can see an option: to filter the scene at once and after that user can display recently hided nodes (if he wants) by clicking on eye icon in data module for example.  
Or add such functionality to the scene so that all nodes that dont fit the criteria must not be displayed no matter what `DisplayVisibility` they have.

I think I would prefer the second way but does Slicer community need such functionality?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [December 20, 2021, 3:15pm UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138/2 "2021-12-20T15:15:11Z")

</div>

I typically just use a small python loop to selectively show only the desired nodes.

---

<div class="post-metadata">

### Author: ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)
#### Post date: [December 20, 2021, 3:26pm UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138/3 "2021-12-20T15:26:51Z")

</div>

This is useful for those who is pretty familiar with python 🙂

---

<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: [December 22, 2021, 2:44pm UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138/4 "2021-12-22T14:44:52Z")

</div>

An easy way to show/hide a group of nodes is to put them into a folder in the Data module and click the eye icon of the folder.

---

<div class="post-metadata">

### Author: ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)
#### Post date: [December 23, 2021, 2:06am UTC](https://discourse.slicer.org/t/set-filter-to-the-scene-based-on-displayable-node-attributes/21138/5 "2021-12-23T02:06:58Z")

</div>

Thank you, haven’t thought about that
