Correct image and mask using command line

Hi pyradiomics team,

kindly I imported DICOM images into 3D slicer and did segmentation and extract the features properly using 3D slicer, then I saved the image and the mask into file. now I wanna make sure that the same features I will get it If i used command line. Unfortunately, I did not get the features by command line using pyradiomics specifying the image and the mask and it showed me an error, here is the message I’ve got it:

C:\features>pyradiomics pancreas_image.nrrd pancreas_label.nrrd
[2019-12-04 22:13:22] E: radiomics.script: Feature extraction failed!
Traceback (most recent call last):
File “C:\Python27\lib\site-packages\pyradiomics-2.2.0.post35+g8da1db7-py2.7-win-amd64.egg\radiomics\scripts\”, line 70, in _extractFeatures
feature_vector.update(extractor.execute(imageFilepath, maskFilepath, label, label_channel))
File “C:\Python27\lib\site-packages\pyradiomics-2.2.0.post35+g8da1db7-py2.7-win-amd64.egg\radiomics\”, line 273, in execute
boundingBox, correctedMask = imageoperations.checkMask(image, mask, **_settings)
File “C:\Python27\lib\site-packages\pyradiomics-2.2.0.post35+g8da1db7-py2.7-win-amd64.egg\radiomics\”, line 239, in checkMask
raise ValueError('Image/Mask datatype or size mismatch. Potential fix: enable correctMask, see ’
ValueError: Image/Mask datatype or size mismatch. Potential fix: enable correctMask, see Documentation:Usage:Customizing the Extraction:Settings:correctMask for more information
Case-1_Image: C:\features\pancreas_image.nrrd
Case-1_Mask: C:\features\pancreas_label.nrrd

You probably need to export to labelmap.


To make things easier, we have made automated segmentation cropping optional. By default, extents of segmentation will match extents of master volume. Cropping can be enabled/disabled in the Save dialog’s additional options section. This feature is available in Slicer Preview Release that you download tomorrow or later.

Alternatively, you can enable correctMask in the PyRadiomics configuration, which will resample the mask back to the image space.