# CLI module output image segmentation

**URL:** <https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797>\
**Category:** Development\
**Tags:** segmentation, cli, module\
**Created:** [April 29, 2024, 1:54pm UTC](https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797 "2024-04-29T13:54:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franciska](https://avatars.discourse-cdn.com/v4/letter/f/b38774/32.png) [@Franciska](https://discourse.slicer.org/u/Franciska)\
**Post date:** [April 29, 2024, 1:54pm UTC](https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797/1 "2024-04-29T13:54:01Z")

</div>

Hi!

I would like to create a custom module, just like the [BlurImage](https://github.com/lassoan/SlicerPythonCLIExample?tab=readme-ov-file) example.

I put mine under Segmentation modules.  
When using the module, under the IO parameters I can chose Output Volume as creating a new volume, or creating a new LabelmapVolume.(and these work properly)

How could I chose to create a new segmentation? I tried to find it [here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/SlicerExecutionModel) but I didn’t.

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:** [April 29, 2024, 2:27pm UTC](https://discourse.slicer.org/t/cli-module-output-image-segmentation/35797/2 "2024-04-29T14:27:37Z")

</div>

It is a bit hidden in the documentation, but the relevant part is this:

\<image [type=“_scalar_ |_label_ |_tensor_ |_diffusion-weighted_ |_vector_ |_model_ “] [reference=”…”]\>

If you want to select a segmentation node as input or output, you can specify `type="label"` for your image element in the .xml file. See example [here](https://github.com/Slicer/Slicer/blob/main/Modules/CLI/LabelMapSmoothing/LabelMapSmoothing.xml).
