# How to fast check if a voxel is part of a visible segment

**URL:** <https://discourse.slicer.org/t/how-to-fast-check-if-a-voxel-is-part-of-a-visible-segment/15068>\
**Category:** Development\
**Tags:** module\
**Created:** [December 15, 2020, 8:27am UTC](https://discourse.slicer.org/t/how-to-fast-check-if-a-voxel-is-part-of-a-visible-segment/15068 "2020-12-15T08:27:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://discourse.slicer.org/u/Niels)\
**Post date:** [December 15, 2020, 8:27am UTC](https://discourse.slicer.org/t/how-to-fast-check-if-a-voxel-is-part-of-a-visible-segment/15068/1 "2020-12-15T08:27:24Z")

</div>

For my paintbrush module I am making continuously making adjustments to a volume . I use this same volume as a reference volume in my segmentation.  
In my adjustment script I would like to keep my adjustments limited to the segments I have set visible in the segmentation.

I know that I can export the segmentation to a labelmap. But is it also possbile to directly access a binairy map to check if a certain location is part of a visible segment or not?

I found GetBinaryLabelmapInternalRepresentation in the vtkMRMLSegmentationNode but that seems to work for only one segmentID and not an array of segments.
