# Multiple VOI in pyradiomics

**URL:** <https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482>\
**Category:** Radiomics\
**Created:** [May 10, 2020, 8:44am UTC](https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482 "2020-05-10T08:44:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![codecrazer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/codecrazer/32/6479_2.png) [@codecrazer](https://discourse.slicer.org/u/codecrazer)\
**Post date:** [May 10, 2020, 8:44am UTC](https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482/1 "2020-05-10T08:44:40Z")

</div>

If there were multiple VOIs and the pipeline extraction were used, but only Image and Mask were specified. The label column were not used. What will happen?

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [May 14, 2020, 5:12am UTC](https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482/2 "2020-05-14T05:12:10Z")

</div>

Then the default settings take effect: label with value 1, or first segment is used to calculate features.

---

<div class="post-metadata">

**Author:** ![codecrazer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/codecrazer/32/6479_2.png) [@codecrazer](https://discourse.slicer.org/u/codecrazer)\
**Post date:** [May 14, 2020, 5:28am UTC](https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482/3 "2020-05-14T05:28:43Z")

</div>

It there any way to check how many segmentation in the nrrd file? I have a multiple ROI nrrd, and I delete all other segmentation except one, could I check if there is only one segmentation in the file by code? Thanks for your help!

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [May 23, 2020, 2:15pm UTC](https://discourse.slicer.org/t/multiple-voi-in-pyradiomics/11482/4 "2020-05-23T14:15:28Z")

</div>

If it’s a segmentation generated in Slicer then yes, quite easy:

```auto
import SimpleITK as sitk
ma = sitk.ReadImage('path/to/segmentation.seg.nrrd')
n_seg = ma.GetNumberOfComponentsPerPixel()

```
