# Creating custom ROI

**URL:** <https://discourse.slicer.org/t/creating-custom-roi/7442>\
**Category:** Support\
**Created:** [July 6, 2019, 2:49am UTC](https://discourse.slicer.org/t/creating-custom-roi/7442 "2019-07-06T02:49:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jainey](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jainey](https://discourse.slicer.org/u/Jainey)\
**Post date:** [July 6, 2019, 2:49am UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/1 "2019-07-06T02:49:57Z")

</div>

Hi All

Is there a way that I create a custom shaped ROI, instead of the box. A spherical one.

Thanks

Tom

---

<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:** [July 6, 2019, 3:58am UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/2 "2019-07-06T03:58:26Z")

</div>

You can create arbitrarily shaped masks and segments in Segment Editor. You can construct various shapes using VTK sources using a few lines of Python code - see example [here](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Manipulating_objects_in_the_slice_viewer). In recent Preview releases you can also create arbitrarily sized spherical markers using Markups module.

---

<div class="post-metadata">

**Author:** ![Jainey](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jainey](https://discourse.slicer.org/u/Jainey)\
**Post date:** [July 8, 2019, 5:30pm UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/3 "2019-07-08T17:30:10Z")

</div>

Thanks Prof. @lassoan.

I am trying to crop an arbitrary shape. Do you think there is a module that I can combine with crop volume module so that instead of the box ROI I can create a sphere which can be cropped .

I would like to keep it in the same format without segmenting/ stl or obj.

Thanks

---

<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:** [July 9, 2019, 3:37am UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/4 "2019-07-09T03:37:52Z")

</div>

> [@Jainey](#):
>
> I am trying to crop an arbitrary shape.

Images are always stored in a rectilinear grid. If you mean you want to blank out part of an image then you can do that in Segment Editor module: define a region using a segment (Paint effect with sphere brush; Scissors effect with sphere shape; etc.) then use Mask volume effect. To get Mask volume effect, install SegmentEditorExtraEffects extension.

---

<div class="post-metadata">

**Author:** ![Jainey](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jainey](https://discourse.slicer.org/u/Jainey)\
**Post date:** [July 15, 2019, 2:24pm UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/5 "2019-07-15T14:24:32Z")

</div>

Thanks Prof. @lassoan.

I did install extra effects and it works fine. But say I want to cut out a sphere from the middle, I mask the surrounding image with this. Then can I still keep my middle sphere as a volume rather than a model/stl.

Thanks a lot

---

<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:** [July 15, 2019, 2:39pm UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/6 "2019-07-15T14:39:41Z")

</div>

> [@Jainey](#):
>
> can I still keep my middle sphere as a volume

Yes. This is what Mask volume is for. It blanks out regions in the volume that is inside or outside the selected segment.

---

<div class="post-metadata">

**Author:** ![Jainey](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@Jainey](https://discourse.slicer.org/u/Jainey)\
**Post date:** [July 16, 2019, 4:49pm UTC](https://discourse.slicer.org/t/creating-custom-roi/7442/7 "2019-07-16T16:49:25Z")

</div>

Thanks Prof @lassoan
