Comparison with Pyradiomics - cerr/CERR GitHub Wiki

CERR provides a wrapper function pyFeatureExtraction.py for radiomic feature extraction using Pyradiomics. Results are stored as MATLAB structures to simplify comparison with CERR.

Sample scripts and settings files (JSON format for CERR and YAML for Pyradiomics) are distributed with CERR. Please refer to documentation on Pyradiomics for guidance on customizing the sample settings.


Documented differences

Pyradiomics differs from the IBSI standard in certain cases, where valid alternative definitions are possible. This could result in different feature values from CERR, which adopts the IBSI's definitions.


Comparing radiomic features vs. CERR

1. Scalar features

Using user-input data and settings

The wrapper function compareCerrWithPyradAllFeatures.m allows users to input custom settings files and returns differences (absolute and percentage) in feature values computed using each tool.


%Input paths
pyRadPath = '\C:\Miniconda3\lib\site-packages'; %Replace with path to Pyradiomics installation
fpath = 'Path\to\planC.mat'; %Replace with path to input CERR archive
pyradParamFile = 'Path/to/pyradSettings.yaml'; %Replace with path to Pyradiomis settings
cerrParamFile = Path/to/cerrSettings.json'; %Replace with path to CERR settings

% Input structure name
strName = 'str1'; %Replace with structure of interest from CERR archive

% Compute differences
[cerrFeatS,pyFeatS,diffS,pctDiffS] = compareCerrWithPyradAllFeatures(fpath,...
    strName,cerrParamFile,pyradParamFile,pyRadPath);

Using Lung CT Phantom provided by the IBSI

Using the original CT scan

  • Sample settings : CERR : cerrOrigNoInterp.json | Pyradiomics: pyOrigNoInterp.yaml
  • Running the comparison
pyradPath = ''\C:\Miniconda3\lib\site-packages';'; #Replace with path to your Pyradiomics installation
[cerrFeatS,pyFeatS] = compareRadiomicsWithPyradOriginalImgNoInterp(pyradPath);

Using (derived) filtered images

  • Sample settings: CERR : cerrWaveletNoInterp.json | Pyradiomics: pyWaveletNoInterp.yaml
  • Running the comparison
% Compare features from image filtered using 'coif1' wavelet('HHH' decomposition)
[cerrFeatS,pyFeatS] = compareRadiomicsWithPyradWaveletImgNoInterp(pyradPath);

Outputs(cerrFeatS, pyFeatS) are stored as MATLAB structures, accessible as shown below:

%E.g. Retrieve values for 'entropy' feature computed on the original image
imageType = 'Original';
featureClass = 'firstOrderS';
featureName = 'entropy' ;
pyFeatVal = pyFeatS.(imageType).(featureClass).(featureName);
cerrFeatVal = cerrFeatS.(imageType).(featureClass).(featureName);

2. 3D convolutional filter response maps

A sample script for comparing LoG and Wavelet filters is provided. The wrapper function pyProcessImage.m handles pre-processing using Pyradiomics.

% Comparing pre-processing using (1) LoG filter with sigma = 3.0mm, 4.0mm  (2) 'Coif1' wavelet filter 
[pyFiltS,cerrFiltS] = comparePyradFilters;

Evaluation against IBSI benchmarks

Sample scripts for comparing CERR radiomics and Pyradiomics calculations against IBSI benchmarks are detailed in Benchmarking CERR Radiomics with other software.