# sitk error. Input for "LabelStatisticsImageFilter" does not match the primary input's size

**URL:** <https://discourse.slicer.org/t/sitk-error-input-for-labelstatisticsimagefilter-does-not-match-the-primary-inputs-size/20326>\
**Category:** Radiomics\
**Tags:** python\
**Created:** [October 24, 2021, 11:18pm UTC](https://discourse.slicer.org/t/sitk-error-input-for-labelstatisticsimagefilter-does-not-match-the-primary-inputs-size/20326 "2021-10-24T23:18:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio\_Nunes](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fabio_nunes/32/12804_2.png) [@Fabio\_Nunes](https://discourse.slicer.org/u/Fabio_Nunes)\
**Post date:** [October 24, 2021, 11:18pm UTC](https://discourse.slicer.org/t/sitk-error-input-for-labelstatisticsimagefilter-does-not-match-the-primary-inputs-size/20326/1 "2021-10-24T23:18:08Z")

</div>

Hello dear members,

I’ve been working with pyradiomics to try to analyse a segment of pericardial fat. I will replicate the code bellow. Unfortunatly I cannot attach the files here as the upload option does not allow for nrrd files to be uploaded.

```auto
import os
import SimpleITK
import six
from radiomics import featureextractor

imageName = '/home/my_name/Desktop/image.nrrd'
maskName = '/home/my_name/Desktop/mask.nrrd'

params = '/home/my_name/pyradiomics/examples/exampleSettings/Params.yaml'

extractor = featureextractor.RadiomicsFeatureExtractor(params)

result = extractor.execute(imageName, maskName)
for key, val in six.iteritems(result):
  print("\t%s: %s" %(key, val))

```

Once I run the code I get the following error message (see attached image)

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/b/9bb83d0da38819f40c2397423b7cf53086b76bb2.png)

Has anyone encountered this problem before? Thank you,

---

<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:** [October 26, 2021, 3:03am UTC](https://discourse.slicer.org/t/sitk-error-input-for-labelstatisticsimagefilter-does-not-match-the-primary-inputs-size/20326/2 "2021-10-26T03:03:29Z")

</div>

It seems that pyradiomics requires the segmentation mask’s geometry (origin, spacing, axis directions, and extents) to match the analyzed volume’s geometry.
