# Put a fan-shaped mask to an image displayed in a slice view

**URL:** <https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644>\
**Category:** Development\
**Created:** [December 12, 2017, 11:30am UTC](https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644 "2017-12-12T11:30:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![urbancsaba](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/urbancsaba/32/932_2.png) [@urbancsaba](https://discourse.slicer.org/u/urbancsaba)\
**Post date:** [December 12, 2017, 11:30am UTC](https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644/1 "2017-12-12T11:30:04Z")

</div>

Hi Folks,

I have a CT volume displayed axially in a slice view. On this volume I perform different kind of algorithms (this is not the point now) to produce ultrasound-like images.

My question is, how can I apply a mask to convert (or to shape) the slices into a fan-shaped slice, like the (convex) ultrasound images look like?

Thanks,  
Csaba

---

<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 12, 2017, 2:06pm UTC](https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644/2 "2017-12-12T14:06:24Z")

</div>

The easiest is probably to create a mask image and use it to mask the processed CT:

- Create a mask image: it can be a single-slice volume that is non-zero inside the fan and zero outside
- In slice view controller: select mask image as background, and the CT as foreground imagecontroller
- In Volumes module: apply thresholding to the mask volume to hide voxels that has zero value - this not only hides mask volume contents but also the foreground
- To move around this slice: apply a transform to the mask image, and use mask image as Driver in Volume Reslice Driver module (available in SlicerIGT extension)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [December 12, 2017, 5:09pm UTC](https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644/3 "2017-12-12T17:09:10Z")

</div>

Cc: @dzenanz @thewtex

---

<div class="post-metadata">

**Author:** ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)\
**Post date:** [December 12, 2017, 5:40pm UTC](https://discourse.slicer.org/t/put-a-fan-shaped-mask-to-an-image-displayed-in-a-slice-view/1644/4 "2017-12-12T17:40:15Z")

</div>

It is possible to create the mask by inputting a uniform image to the `SlicerITKUltrasound` extension module for a [curvilinear array](https://kitwaremedical.github.io/SlicerITKUltrasoundDoc/Modules/ScanConversion/CurvilinearArray.html) or a [3D phased array](https://kitwaremedical.github.io/SlicerITKUltrasoundDoc/Modules/ScanConversion/PhasedArray3D.html).
