Error in _extractFeatures when using pyradiomics in Slicer

Hi !

I am trying to do radiomic analysis on a 3D lung sample. The segmentation is ready but I only get an error massage. It looks like there is some problem with the masks but I am not sure at all. Any suggestions?

Here is the whole massage from the code:
Starting RadiomicsCLI for RBC_train_largesmallarteryplusspeackle_segment_Speckle

…Done

[2021-07-01 21:38:26] I: radiomics.script: Starting PyRadiomics (version: v3.0.1.post4+gad5b2de)

[2021-07-01 21:38:26] I: radiomics.script: Processing input…

[2021-07-01 21:38:26] I: radiomics.featureextractor: Loading parameter file C:/Users/lantis.user/AppData/Local/Temp/Slicer\RadiomicsLogicParams.json

[2021-07-01 21:38:26] I: radiomics.featureextractor: Applying custom setting overrides: {‘label’: 1, ‘correctMask’: True}

[2021-07-01 21:38:26] I: radiomics.script: Input valid, starting sequential extraction from 1 case(s)…

[2021-07-01 21:38:26] I: radiomics.script: Processing case 1

[2021-07-01 21:38:26] I: radiomics.featureextractor: Calculating features with label: 1

[2021-07-01 21:38:26] I: radiomics.featureextractor: Loading image and mask

[2021-07-01 21:38:36] E: radiomics.script: Feature extraction failed!

Traceback (most recent call last):

File “C:\Users\lantis.user\AppData\Local\NA-MIC\Slicer 4.11.20210226\NA-MIC\Extensions-29738\SlicerRadiomics\Lib\site-packages\radiomics\scripts\segment.py”, line 70, in _extractFeatures

feature_vector.update(extractor.execute(imageFilepath, maskFilepath, label, label_channel))

File “C:\Users\lantis.user\AppData\Local\NA-MIC\Slicer 4.11.20210226\NA-MIC\Extensions-29738\SlicerRadiomics\Lib\site-packages\radiomics\featureextractor.py”, line 272, in execute

image, mask = self.loadImage(imageFilepath, maskFilepath, generalInfo, **_settings)

File “C:\Users\lantis.user\AppData\Local\NA-MIC\Slicer 4.11.20210226\NA-MIC\Extensions-29738\SlicerRadiomics\Lib\site-packages\radiomics\featureextractor.py”, line 382, in loadImage

raise ValueError(‘Error reading mask Filepath or SimpleITK object’)

ValueError: Error reading mask Filepath or SimpleITK object

[2021-07-01 21:38:37] I: radiomics.script: Processing results…

[2021-07-01 21:38:37] I: radiomics.script: Finished segment-based extraction successfully…

Extraction complete

Cleaning up…

I have not been able to identify the exact issue so far, but as a workaround you can export your segmentation as a labelmap (using the section below from the Segmentations module), and then use theresulting labelmap node as “Input regions” parameter in the Radiomics module. This worked for me.

image

I filed an issue, will try to get back to it: Cannot use the module with input mask defined by a segmentation node · Issue #67 · AIM-Harvard/SlicerRadiomics · GitHub.