# Mask volume using Python scripting

**URL:** <https://discourse.slicer.org/t/mask-volume-using-python-scripting/17814>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [May 25, 2021, 4:58pm UTC](https://discourse.slicer.org/t/mask-volume-using-python-scripting/17814 "2021-05-25T16:58:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![omnikron](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/omnikron/32/11057_2.png) [@omnikron](https://discourse.slicer.org/u/omnikron)\
**Post date:** [May 25, 2021, 4:58pm UTC](https://discourse.slicer.org/t/mask-volume-using-python-scripting/17814/1 "2021-05-25T16:58:26Z")

</div>

I also would like to perform 3D cropping on volume rendering. Are there any current examples using Python scripted modules that I can study to accomplish this? Thanks in advance.

---

<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:** [May 26, 2021, 5:01pm UTC](https://discourse.slicer.org/t/mask-volume-using-python-scripting/17814/2 "2021-05-26T17:01:22Z")

</div>

You can find examples of using Segment Editor effects from Python in the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#segmentations) and here is an [example of using Mask volume effect from a Python script](https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/SegmentEditorSplitVolume/SegmentEditorSplitVolumeLib/SegmentEditorEffect.py#L129-L192).
