# Hide 2D Segment from Showing in Certain Slice Views

**URL:** <https://discourse.slicer.org/t/hide-2d-segment-from-showing-in-certain-slice-views/27312>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [January 17, 2023, 9:53pm UTC](https://discourse.slicer.org/t/hide-2d-segment-from-showing-in-certain-slice-views/27312 "2023-01-17T21:53:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xerox](https://avatars.discourse-cdn.com/v4/letter/x/898d66/32.png) [@xerox](https://discourse.slicer.org/u/xerox)\
**Post date:** [January 17, 2023, 9:53pm UTC](https://discourse.slicer.org/t/hide-2d-segment-from-showing-in-certain-slice-views/27312/1 "2023-01-17T21:53:39Z")

</div>

Hi,

I currently have created a 2D segmentation algorithm in Python and have set my segmentations similar to how it is done in [this code](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#read-and-write-a-segment-as-a-numpy-array). Because my code is in 2D however and only segments based on the axial view, I want to hide any segment markups from the sagittal and coronal view as those segments don’t have any meaning. Is there a way to do this perhaps by modifying the voxel array or something similar? Thanks for the help in advance!

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [January 18, 2023, 1:39am UTC](https://discourse.slicer.org/t/hide-2d-segment-from-showing-in-certain-slice-views/27312/2 "2023-01-18T01:39:08Z")

</div>

You can make nodes visible only in specific views using [`displayNode.SetViewNodeIDs`](https://apidocs.slicer.org/master/classvtkMRMLDisplayNode.html#a8fd9a8d62109f08b3720edc8e174a546).

See an example here using Markups:  
[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#change-markup-point-list-display-properties](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#change-markup-point-list-display-properties)
