diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1a.json index b633fd7..8fb7977 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1a.json @@ -17,7 +17,10 @@ }, "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 } + "binWidthEntropy":0 }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1b.json index 0a1bbf0..68a9ea5 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID1b.json @@ -8,11 +8,10 @@ "settings": { "resample": { - "resolutionXCm": 0.1, + "resolutionXCm": 0.1, "resolutionYCm": 0.1, "resolutionZCm": 0.1, - "interpMethod": "bspline", - "intensityRounding": "On" + "interpMethod": "bspline" }, "padding": { @@ -27,7 +26,10 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2a.json index e970ba4..05e7b8c 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2a.json @@ -21,8 +21,11 @@ }, "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 - } + "binWidthEntropy":0 + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2b.json index c37c2de..1e3f77b 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID2b.json @@ -10,11 +10,11 @@ "settings": { "resample": { - "resolutionXCm": 0.1, + "resolutionXCm": 0.1, "resolutionYCm": 0.1, "resolutionZCm": 0.1, "interpMethod": "bspline", - "intensityRounding": "On" + "intensityRounding": "On" }, "padding": { @@ -30,8 +30,11 @@ "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 - } + "binWidthEntropy":0 + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3a.json index 224d52f..3b12287 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3a.json @@ -24,8 +24,11 @@ "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 - } + "binWidthEntropy":0 + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3b.json index 2bec13b..aa4d1a6 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID3b.json @@ -11,11 +11,11 @@ "settings": { "resample": { - "resolutionXCm": 0.1, + "resolutionXCm": 0.1, "resolutionYCm": 0.1, "resolutionZCm": 0.1, "interpMethod": "bspline", - "intensityRounding": "On" + "intensityRounding": "On" }, "padding": { @@ -30,7 +30,10 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { "firstOrder": {"featureList": ["all"]} diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4a.json index a3c9351..2080ade 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4a.json @@ -3,18 +3,18 @@ "structures": ["ROI"], "imageType": { - "rotationInvariantLawsEnergy": { - "Direction": "2d", - "Type": "L5E5", - "Normalize": "yes", - "RotationInvariance": { - "Dim": "2D", - "AggregationMethod": "max" + "RotationInvariantLawsEnergy": { + "Direction": "2d", + "Type": "L5E5", + "Normalize": "yes", + "RotationInvariance": { + "Dim": "2D", + "AggregationMethod": "max" }, - "EnergyKernelSize": [15,15], - "EnergyPadMethod": "mirror", - "EnergyPadSize" : [7,7,0] - } + "EnergyKernelSize": [15,15], + "EnergyPadMethod": "mirror", + "EnergyPadSize" : [7,7,0] + } }, "settings": { @@ -31,7 +31,9 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } + }, + + "mapFeaturenamesToIBSI": "yes" }, diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4b.json index 3297d2d..ee8342c 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID4b.json @@ -3,27 +3,27 @@ "structures": ["ROI"], "imageType": { - "rotationInvariantLawsEnergy": { - "Direction": "3d", - "Type": "L5E5E5", - "Normalize": "yes", - "RotationInvariance": { + "RotationInvariantLawsEnergy": { + "Direction": "3d", + "Type": "L5E5E5", + "Normalize": "yes", + "RotationInvariance": { "Dim": "3D", "AggregationMethod": "max" - }, - "EnergyKernelSize": [15,15,15], - "EnergyPadMethod": "mirror", - "EnergyPadSize" : [7,7,7] - } + }, + "EnergyKernelSize": [15,15,15], + "EnergyPadMethod": "mirror", + "EnergyPadSize" : [7,7,7] + } }, "settings": { "resample": { - "resolutionXCm": 0.1, + "resolutionXCm": 0.1, "resolutionYCm": 0.1, "resolutionZCm": 0.1, "interpMethod": "bspline", - "intensityRounding": "On" + "intensityRounding": "On" }, "padding": { "cropToMaskBounds": "no", @@ -37,7 +37,9 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } + }, + + "mapFeaturenamesToIBSI": "yes" }, diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5a.json index d6b979c..de9a36b 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5a.json @@ -5,11 +5,11 @@ "imageType": { "Gabor": { "Sigma_mm": 5, - "Wavlength_mm": 2, - "SpatialAspectRatio": 1.5, - "Orientation":[22.5,45,67.5,90,112.5,135,157.5,180,202.5,225,247.5,270,292.5,315,337.5,360], - "OrientationAggregation": "average", - "ImagePlane": "Axial" + "Wavlength_mm": 2, + "SpatialAspectRatio": 1.5, + "Orientation":[22.5,45,67.5,90,112.5,135,157.5,180,202.5,225,247.5,270,292.5,315,337.5,360], + "OrientationAggregation": "average", + "ImagePlane": "Axial" } }, @@ -20,16 +20,19 @@ "method": "mirror", "size": [50,50,0] }, + "texture" :{ "minSegThreshold": -1000, "maxSegThreshold": 400 }, + "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 - } - - + "binWidthEntropy":0 + }, + + "mapFeaturenamesToIBSI": "yes" + }, "featureClass": { diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5b.json index 0d608bc..b415034 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID5b.json @@ -5,38 +5,42 @@ "imageType": { "Gabor": { "Sigma_mm": 5, - "Wavlength_mm": 2, - "SpatialAspectRatio": 1.5, - "Orientation":[22.5,45,67.5,90,112.5,135,157.5,180,202.5,225,247.5,270,292.5,315,337.5,360], - "OrientationAggregation": "average", - "ImagePlane": ["Axial","Sagittal","Coronal"], - "PlaneAggregation": "average" - } + "Wavlength_mm": 2, + "SpatialAspectRatio": 1.5, + "Orientation":[22.5,45,67.5,90,112.5,135,157.5,180,202.5,225,247.5,270,292.5,315,337.5,360], + "OrientationAggregation": "average", + "ImagePlane": ["Axial","Sagittal","Coronal"], + "PlaneAggregation": "average" + } }, "settings": { "resample": { - "resolutionXCm": 0.1, - "resolutionYCm": 0.1, - "resolutionZCm": 0.1, - "interpMethod": "sitkBSpline", - "intensityRounding": "On" + "resolutionXCm": 0.1, + "resolutionYCm": 0.1, + "resolutionZCm": 0.1, + "interpMethod": "bspline", + "intensityRounding": "On" }, + "padding": { "cropToMaskBounds": "no", "method": "mirror", "size": [49,49,49] }, + "texture" :{ "minSegThreshold": -1000, "maxSegThreshold": 400 }, + "firstOrder" :{ "offsetForEnergy": 0, - "binWidthEntropy":0 - } - + "binWidthEntropy":0 + }, + + "mapFeaturenamesToIBSI": "yes" }, diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6a.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6a.json index bb814f7..8665ed8 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6a.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6a.json @@ -29,9 +29,15 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } - + }, + + "mapFeaturenamesToIBSI": "yes" - } + }, + +"featureClass": { + "firstOrder": {"featureList": ["all"]} + } + } diff --git a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6b.json b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6b.json index 32ef284..b1487d3 100644 --- a/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6b.json +++ b/cerr/datasets/radiomics_settings/IBSIsettings/IBSI2Phase2/IBSIPhase2-2ID6b.json @@ -37,9 +37,14 @@ "firstOrder" :{ "offsetForEnergy": 0, "binWidthEntropy":0 - } - - - } + }, + + "mapFeaturenamesToIBSI": "yes" + + }, + +"featureClass": { + "firstOrder": {"featureList": ["all"]} + } } diff --git a/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_CERR_features.csv b/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_CERR_features.csv index 3cb57d4..58ca690 100644 --- a/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_CERR_features.csv +++ b/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_CERR_features.csv @@ -1,24 +1,24 @@ -family,feature_name,feature_tag,ibsi_identifier,1.A,1.B,2.A,2.B,3.A,3.B,4.A,4.B,5.A,5.B,6.A,6.B,7.A,7.B,8.A,8.B,9.A,9.B,10.A,10.B,11.A,11.B -Diagnostic,Number of voxels in ROI before interpolation,diag_n_voxel,0,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256,,,,,,,,,, -Diagnostic,Number of voxels in intensity ROI-mask after interpolation and resegmentation,diag_n_voxel_interp_reseg,1,125238,357802,125238,357802,125238,357802,125238,357802,125238,357802,125238,357802,,,,,,,,,, -Diagnostic,Mean intensity in intensity ROI-mask after interpolation and resegmentation,diag_mean_int_interp_reseg,2,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,,,,,,,,,, -Diagnostic,Max intensity in intensity ROI-mask after interpolation and resegmentation,diag_max_int_interp_reseg,3,377,377,377,377,377,377,377,377,377,377,377,377,,,,,,,,,, -Diagnostic,Min intensity in intensity ROI-mask after interpolation and resegmentation,diag_min_int_interp_reseg,4,-1000,-997,-1000,-997,-1000,-997,-1000,-997,-1000,-997,-1000,-997,,,,,,,,,, -Statistics,Mean,stat_mean,Q4LE,-46.9756,-46.4075,-49.8816,-49.8926,-2.4409,-2.9424,148.258,141.8271,102.9942,40.24,-0.18505,-0.19165,,,,,,,,,, -Statistics,Variance,stat_var,ECT3,53338.7497,52636.8857,46616.9379,44392.8445,555.6829,719.6975,17953.6433,11118.4954,1036.2306,230.562,427.2793,258.4748,,,,,,,,,, -Statistics,Skewness,stat_skew,KE2A,-2.1668,-2.1794,-2.1266,-2.1286,0.2953,0.42212,0.87706,0.64455,1.314,1.5747,0.083694,0.15965,,,,,,,,,, -Statistics,(Excess) kurtosis,stat_kurt,IPH6,3.6451,3.7126,3.5277,3.5863,7.0161,6.1333,-0.27877,-0.71065,2.8417,4.3373,7.7218,8.7531,,,,,,,,,, -Statistics,Median,stat_median,Y12H,41,41,38.08,37.336,-0.58489,-0.91947,88.7164,113.1384,97.0368,37.1933,0.045594,0.058616,,,,,,,,,, -Statistics,Minimum,stat_min,1GSF,-1000,-997,-888.92,-906.176,-178.0502,-172.907,15.452,28.4672,31.3725,9.5348,-245.1464,-143.9796,,,,,,,,,, -Statistics,10th percentile,stat_p10,QG58,-434,-427,-402.364,-389.3224,-27.102,-32.1572,26.877,35.5697,68.8025,24.6298,-18.8451,-14.1429,,,,,,,,,, -Statistics,90th percentile,stat_p90,8DWT,93,92,79.84,77.248,13.2345,17.391,346.961,292.6233,144.5656,59.2863,17.7175,12.4719,,,,,,,,,, -Statistics,Maximum,stat_max,84IY,377,377,334.16,316.312,190.6673,204.2998,672.2096,524.8028,353.6986,174.5559,201.6358,154.4726,,,,,,,,,, -Statistics,Interquartile range,stat_iqr,SALO,69,67,82,92.584,8.7437,11.4459,219.2627,187.655,37.1797,17.3522,15.7707,9.8874,,,,,,,,,, -Statistics,Range,stat_range,2OJQ,1377,1374,1223.08,1222.488,368.7175,377.2068,656.7576,496.3355,322.3261,165.0212,446.7822,298.4521,,,,,,,,,, -Statistics,Mean absolute deviation,stat_mad,4FUA,160.0892,158.9223,152.5869,149.3422,13.1507,15.4966,116.0725,92.4481,24.2066,11.2782,13.0301,9.5143,,,,,,,,,, -Statistics,Robust mean absolute deviation,stat_rmad,1128,64.4227,63.5967,67.7311,68.1352,4.9768,6.3688,92.892,75.9196,15.7577,7.3098,6.8152,4.4259,,,,,,,,,, -Statistics,Median absolute deviation,stat_medad,N72L,121.7435,120.5444,115.8276,113.8108,12.9032,15.2606,110.7334,90.813,23.7017,10.9943,13.0283,9.5107,,,,,,,,,, -Statistics,Coefficient of variation,stat_cov,7TET,-4.9164,-4.9438,-4.3284,-4.223,-9.6576,-9.1174,0.90377,0.74347,0.31255,0.37734,-111.7049,-83.8886,,,,,,,,,, -Statistics,Quartile coefficient of dispersion,stat_qcod,9S40,1,0.94366,1.8502,2.9728,-2.9306,-2.3389,0.77305,0.69926,0.18686,0.22554,491.1043,-156.1466,,,,,,,,,, -Statistics,Energy,stat_energy,N8CA,6956402357,19604163821,6149826557,16774513585,70338761.75,260607009.4,5001263504,11175381810,1458276196,661870210,53515894.29,92495949.33,,,,,,,,,, -Statistics,Root mean square,stat_rms,5ZWQ,235.6808,234.0738,221.5967,216.5228,23.699,26.9881,199.8351,176.7298,107.9075,43.0096,20.6716,16.0783,,,,,,,,,, +family,feature_name,feature_tag,ibsi_identifier,1a,1b,2a,2b,3a,3b,4a,4b,5a,5b,6a,6b +Diagnostic,Number of voxels in ROI before interpolation,diag_n_voxel,0,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256,125256 +Diagnostic,Number of voxels in intensity ROI-mask after interpolation and resegmentation,diag_n_voxel_interp_reseg,1,125238,357802,125238,357802,125238,357802,125238,357802,125238,357802,125238,357802 +Diagnostic,Mean intensity in intensity ROI-mask after interpolation and resegmentation,diag_mean_int_interp_reseg,2,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075,-46.9756,-46.4075 +Diagnostic,Max intensity in intensity ROI-mask after interpolation and resegmentation,diag_max_int_interp_reseg,3,377,377,377,377,377,377,377,377,377,377,377,377 +Diagnostic,Min intensity in intensity ROI-mask after interpolation and resegmentation,diag_min_int_interp_reseg,4,-1000,-997,-1000,-997,-1000,-997,-1000,-997,-1000,-997,-1000,-997 +Statistics,Mean,stat_mean,Q4LE,-46.9756,-46.4075,-49.8816,-49.8926,-2.4409,-2.9424,148.258,141.8271,102.9942,40.24,-0.18505,-0.19165 +Statistics,Variance,stat_var,ECT3,53338.7497,52636.8857,46616.9379,44392.8445,555.6829,719.6975,17953.6433,11118.4954,1036.2306,230.562,427.2793,258.4748 +Statistics,Skewness,stat_skew,KE2A,-2.1668,-2.1794,-2.1266,-2.1286,0.2953,0.42212,0.87706,0.64455,1.314,1.5747,0.083694,0.15965 +Statistics,(Excess) kurtosis,stat_kurt,IPH6,3.6451,3.7126,3.5277,3.5863,7.0161,6.1333,-0.27877,-0.71065,2.8417,4.3373,7.7218,8.7531 +Statistics,Median,stat_median,Y12H,41,41,38.08,37.336,-0.58489,-0.91947,88.7164,113.1384,97.0368,37.1933,0.045594,0.058616 +Statistics,Minimum,stat_min,1GSF,-1000,-997,-888.92,-906.176,-178.0502,-172.907,15.452,28.4672,31.3725,9.5348,-245.1464,-143.9796 +Statistics,10th percentile,stat_p10,QG58,-434,-427,-402.364,-389.3224,-27.102,-32.1572,26.877,35.5697,68.8025,24.6298,-18.8451,-14.1429 +Statistics,90th percentile,stat_p90,8DWT,93,92,79.84,77.248,13.2345,17.391,346.961,292.6233,144.5656,59.2863,17.7175,12.4719 +Statistics,Maximum,stat_max,84IY,377,377,334.16,316.312,190.6673,204.2998,672.2096,524.8028,353.6986,174.5559,201.6358,154.4726 +Statistics,Interquartile range,stat_iqr,SALO,69,67,82,92.584,8.7437,11.4459,219.2627,187.655,37.1797,17.3522,15.7707,9.8874 +Statistics,Range,stat_range,2OJQ,1377,1374,1223.08,1222.488,368.7175,377.2068,656.7576,496.3355,322.3261,165.0212,446.7822,298.4521 +Statistics,Mean absolute deviation,stat_mad,4FUA,160.0892,158.9223,152.5869,149.3422,13.1507,15.4966,116.0725,92.4481,24.2066,11.2782,13.0301,9.5143 +Statistics,Robust mean absolute deviation,stat_rmad,1128,64.4227,63.5967,67.7311,68.1352,4.9768,6.3688,92.892,75.9196,15.7577,7.3098,6.8152,4.4259 +Statistics,Median absolute deviation,stat_medad,N72L,121.7435,120.5444,115.8276,113.8108,12.9032,15.2606,110.7334,90.813,23.7017,10.9943,13.0283,9.5107 +Statistics,Coefficient of variation,stat_cov,7TET,-4.9164,-4.9438,-4.3284,-4.223,-9.6576,-9.1174,0.90377,0.74347,0.31255,0.37734,-111.7049,-83.8886 +Statistics,Quartile coefficient of dispersion,stat_qcod,9S40,1,0.94366,1.8502,2.9728,-2.9306,-2.3389,0.77305,0.69926,0.18686,0.22554,491.1043,-156.1466 +Statistics,Energy,stat_energy,N8CA,6956402357,19604163821,6149826557,16774513585,70338761.75,260607009.4,5001263504,11175381810,1458276196,661870210,53515894.29,92495949.33 +Statistics,Root mean square,stat_rms,5ZWQ,235.6808,234.0738,221.5967,216.5228,23.699,26.9881,199.8351,176.7298,107.9075,43.0096,20.6716,16.0783 diff --git a/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_pyCERR_features.csv b/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_pyCERR_features.csv index 3ec235f..b408e51 100644 --- a/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_pyCERR_features.csv +++ b/cerr/datasets/referenceValuesForTests/IBSI2Phase2/IBSIphase2-2_pyCERR_features.csv @@ -1,24 +1,24 @@ -family,feature_name,feature_tag,ibsi_identifier,1.A,1.B,2.A,2.B,3.A,3.B,4.A,4.B,5.A,5.B,6.A,6.B,7.A,7.B,8.A,8.B,9.A,9.B,10.A,10.B,11.A,11.B -Diagnostic,Number of voxels in ROI before interpolation,diag_n_voxel,0,125238.0,125256.0,125256.0,125256.0,125256.0,125256.0,125256.0,125256.0,125256.0,125256.0 -Diagnostic,Number of voxels in intensity ROI-mask after interpolation and resegmentation,diag_n_voxel_interp_reseg,1,125238.0,357802.0,125238.0,357802.0,125238.0,357802.0,125238.0,357802.0,125238.0,357802.0 -Diagnostic,Mean intensity in intensity ROI-mask after interpolation and resegmentation,diag_mean_int_interp_reseg,2,-46.97563838451588,-46.40749099828464,-46.97563838451588,-46.40749099828464,-46.97563838451588,-46.40749099828464,-46.97563838451588,-46.40749099828464,-46.97563838451588,-46.40749099828464 -Diagnostic,Max intensity in intensity ROI-mask after interpolation and resegmentation,diag_max_int_interp_reseg,3,377.0,376.7755325019381,377.0,376.7755325019381,377.0,376.7755325019381,377.0,376.7755325019381,377.0,376.7755325019381 -Diagnostic,Min intensity in intensity ROI-mask after interpolation and resegmentation,diag_min_int_interp_reseg,4,-1000.0,-997.030303696017,-1000.0,-997.030303696017,-1000.0,-997.030303696017,-1000.0,-997.030303696017,-1000.0,-997.030303696017 -Statistics,Mean,stat_mean,Q4LE,-46.97563838451588,-46.40749099828464,-49.88164359060348,-49.89258972680369,-2.4408754088815736,-2.9424149883864574,148.25798562596728,142.4188857733838,102.99421672100829,71.47018673040962 -Statistics,Variance,stat_var,ECT3,53338.74969795679,52636.7286868684,46616.93794924291,44392.83419645578,555.6828572577746,719.6864903000615,17953.643251879654,11195.327690804028,1036.230639175716,757.9227175353013 -Statistics,Skewness,stat_skew,KE2A,-2.166831042665432,-2.179400020160456,-2.1265747488741114,-2.1286165322341777,0.2952963703462455,0.4221437796530981,0.8770552593177072,0.6439902107482389,1.3140051787792175,1.5041168342481015 -Statistics,(Excess) kurtosis,stat_kurt,IPH6,3.645064037863542,3.7126341426482945,3.527669551797513,3.586281257238843,7.016077340383301,6.133260785549078,-0.278771384156971,-0.7116861989659244,2.8416690183248665,3.74316191292717 -Statistics,Median,stat_median,Y12H,41.0,41.0833460595811,38.080000000000005,37.33463632075471,-0.5848899952174589,-0.9198120550937116,88.71640904946153,113.70322416658112,97.03680870315856,66.08519181294875 -Statistics,Minimum,stat_min,1GSF,-1000.0,-997.030303696017,-888.92,-906.1368537692572,-178.05019123168566,-172.90512989713065,15.452027577668343,28.60111105583241,31.37248241131941,15.220188911248158 -Statistics,10th percentile,stat_p10,QG58,-434.0,-427.43458584843574,-402.3640000000001,-389.306058995879,-27.102035523388754,-32.156848593105025,26.876952885160005,35.765818672081075,68.80251318055299,42.93920633896374 -Statistics,90th percentile,stat_p90,8DWT,93.0,91.85262399631102,79.84,77.2524898683258,13.234451811367812,17.39127107265911,346.9610047982787,293.74229242661573,144.5655561200588,105.8833597425989 -Statistics,Maximum,stat_max,84IY,377.0,376.7755325019381,334.16,316.3054605533659,190.66727967301955,204.29876591016327,672.2096472626997,525.780815249277,353.6986181285824,300.10738937470103 -Statistics,Interquartile range,stat_iqr,SALO,69.0,67.14688473633115,82.0,92.58713048560756,8.743707155819122,11.444044292328059,219.2627342715902,188.339211003091,37.179654076832975,31.58386559365492 -Statistics,Range,stat_range,2OJQ,1377.0,1373.8058361979552,1223.08,1222.4423143226231,368.71747090470524,377.2038958072939,656.7576196850314,497.1797041934446,322.32613571726296,284.88720046345287 -Statistics,Mean absolute deviation,stat_mad,4FUA,160.0892419183896,158.92207535778408,152.58689907681142,149.3422032397174,13.150717465226382,15.49636358279002,116.07253819897251,92.76793779171138,24.20657762915204,20.503383917224177 -Statistics,Robust mean absolute deviation,stat_rmad,1128,64.42273689332126,63.67883685459265,67.73077764687119,68.13532729334926,4.976791418822372,6.368654826379528,92.89201139515781,76.18133676427004,15.757706083537347,13.296109718908596 -Statistics,Median absolute deviation,stat_medad,N72L,121.74350436768393,120.54542149008331,115.82762611986779,113.81138744292333,12.903186488003982,15.260431783443583,110.7333726816394,91.1321133265485,23.701672947452625,20.01787332378261 -Statistics,Coefficient of variation,stat_cov,7TET,-4.916417149269833,-4.94374835307397,-4.3284371586536015,-4.22299327065032,-9.657570507696898,-9.117331610758123,0.9037705814592698,0.742935004576645,0.3125470294312087,0.38520112380819654 -Statistics,Quartile coefficient of dispersion,stat_qcod,9S40,1.0,0.948773842953741,1.850180505415162,2.973319846033453,-2.930602874451151,-2.3384055088164613,0.7730473603726004,0.6989088047718193,0.18686012996573467,0.23128608161090308 -Statistics,Energy,stat_energy,N8CA,6956402357.0,19604108942.915787,6149826557.2512,16774510828.053043,70338761.74617681,260603045.89183128,5001263503.724439,11263058347.823832,1458276196.0011995,2098834440.314596 -Statistics,Root mean square,stat_rms,5ZWQ,235.68084415070646,234.07345835789306,221.59674256753618,216.5227579403674,23.69896052613822,26.987854606543717,199.83511591747126,177.4217199661196,107.90754986167438,76.58923102378637 +family,feature_name,feature_tag,ibsi_identifier,1a,1b,2a,2b,3a,3b,4a,4b,5a,5b,6a,6b +Diagnostic,Number of voxels in ROI before interpolation,diag_n_voxel,0,125256,125256,125256,125256,125256,125256,125256,125256,125256,,, +Diagnostic,Number of voxels in intensity ROI-mask after interpolation and resegmentation,diag_n_voxel_interp_reseg,1,125238,357802,125238,357802,125238,357802,125238,357802,125238,,, +Diagnostic,Mean intensity in intensity ROI-mask after interpolation and resegmentation,diag_mean_int_interp_reseg,2,-46.97563838,-46.407491,-46.97563838,-46.40784568,-46.97563838,-46.40784568,-46.97563838,-46.40784568,-46.97563838,,, +Diagnostic,Max intensity in intensity ROI-mask after interpolation and resegmentation,diag_max_int_interp_reseg,3,377,376.7755325,377,377,377,377,377,377,377,,, +Diagnostic,Min intensity in intensity ROI-mask after interpolation and resegmentation,diag_min_int_interp_reseg,4,-1000,-997.0303037,-1000,-997,-1000,-997,-1000,-997,-1000,,, +Statistics,Mean,stat_mean,Q4LE,-46.97563838,-46.407491,-49.88164359,-49.89294868,-2.440875409,-2.942396622,148.2579856,142.4226729,102.9942167,,, +Statistics,Variance,stat_var,ECT3,53338.7497,52636.72869,46616.93795,44392.73712,555.6828573,719.7033146,17953.64325,11195.69491,1036.230639,,, +Statistics,Skewness,stat_skew,KE2A,-2.166831043,-2.17940002,-2.126574749,-2.128614881,0.29529637,0.422115112,0.877055259,0.643958364,1.314005179,,, +Statistics,(Excess) kurtosis,stat_kurt,IPH6,3.645064038,3.712634143,3.527669552,3.586259663,7.01607734,6.133255368,-0.278771384,-0.711763874,2.841669018,,, +Statistics,Median,stat_median,Y12H,41,41.08334606,38.08,37.336,-0.584889995,-0.919303407,88.71640905,113.7125821,97.0368087,,, +Statistics,Minimum,stat_min,1GSF,-1000,-997.0303037,-888.92,-906.176,-178.0501912,-172.9069655,15.45202758,28.60261863,31.37248241,,, +Statistics,10th percentile,stat_p10,QG58,-434,-427.4345858,-402.364,-389.3224,-27.10203552,-32.15721532,26.87695289,35.76572259,68.80251318,,, +Statistics,90th percentile,stat_p90,8DWT,93,91.852624,79.84,77.248,13.23445181,17.39119778,346.9610048,293.7538664,144.5655561,,, +Statistics,Maximum,stat_max,84IY,377,376.7755325,334.16,316.312,190.6672797,204.2998042,672.2096473,525.7934946,353.6986181,,, +Statistics,Interquartile range,stat_iqr,SALO,69,67.14688474,82,92.584,8.743707156,11.44593638,219.2627343,188.34116,37.17965408,,, +Statistics,Range,stat_range,2OJQ,1377,1373.805836,1223.08,1222.488,368.7174709,377.2067697,656.7576197,497.190876,322.3261357,,, +Statistics,Mean absolute deviation,stat_mad,4FUA,160.0892419,158.9220754,152.5868991,149.342009,13.15071747,15.49659999,116.0725382,92.76975039,24.20657763,,, +Statistics,Robust mean absolute deviation,stat_rmad (*maad),1128,64.42273689,63.67883685,67.73077765,68.13490298,4.976791419,6.368768802,92.8920114,76.18333242,15.75770608,,, +Statistics,Median absolute deviation,stat_medad,N72L,121.7435044,120.5454215,115.8276261,113.8108724,12.90318649,15.26065907,110.7333727,91.13405317,23.70167295,,, +Statistics,Coefficient of variation,stat_cov,7TET,-4.916417149,-4.943748353,-4.328437159,-4.222958271,-9.657570508,-9.117495089,0.903770581,0.742927434,0.312547029,,, +Statistics,Quartile coefficient of dispersion,stat_qcod,9S40,1,0.948773843,1.850180505,2.972771641,-2.930602874,-2.338898031,0.77304736,0.698895046,0.18686013,,, +Statistics,Energy,stat_energy,N8CA,6956402357,19604108943,6149826557,16774488909,70338761.75,260609027,5001263504,11263575709,1458276196,,, +Statistics,Root mean square,stat_rms,5ZWQ,235.6808442,234.0734584,221.5967426,216.5226165,23.69896053,26.9881643,199.8351159,177.4257948,107.9075499,,, diff --git a/cerr/radiomics/ibsi1.py b/cerr/radiomics/ibsi1.py index aa39297..9321746 100644 --- a/cerr/radiomics/ibsi1.py +++ b/cerr/radiomics/ibsi1.py @@ -403,12 +403,12 @@ def createFieldNameFromParameters(imageType, settingS): else: settingsStr += f"_OrientAvg_{thetaV}" fieldName = f"{imageType}_{settingsStr}" - elif imageType == 'lawsconvolution': + elif imageType in ['lawsconvolution','rotationinvariantlawsconvolution']: settingsStr = f"{settingS['Direction']}_type{settingS['Type']}_norm{settingS['Normalize']}" if 'RotationInvariance' in settingS and settingS['RotationInvariance'] and settingS['RotationInvariance']: settingsStr += f"_rot{settingS['RotationInvariance']['Dim']}_agg{settingS['RotationInvariance']['AggregationMethod']}" fieldName = f"{imageType}_{settingsStr}" - elif imageType == 'lawsenergy': + elif imageType in['lawsenergy','rotationinvariantlawsenergy']: energyKernelSize = '_'.join(map(str, settingS['EnergyKernelSize'])) energyKernelSize = energyKernelSize.replace(' ', 'x') settingsStr = f"{settingS['Direction']}_type{settingS['Type']}_norm{settingS['Normalize']}" \ diff --git a/tests/test_IBSI2_features.py b/tests/test_IBSI2_features.py index 995847f..425b72e 100644 --- a/tests/test_IBSI2_features.py +++ b/tests/test_IBSI2_features.py @@ -7,46 +7,12 @@ """ import os +import sys import numpy as np import pandas as pd from cerr import plan_container from cerr.radiomics import ibsi1 -# Paths to data and settings -currPath = os.path.abspath(__file__) -cerrPath = os.path.join(os.path.dirname(os.path.dirname(currPath)), 'cerr') -dataPath = os.path.join(cerrPath, 'datasets', 'IBSIradiomicsDICOM', 'IBSI2Phase2') -settingsPath = os.path.join(cerrPath, 'datasets', 'radiomics_settings', 'IBSIsettings', 'IBSI2Phase2') - -# Read reference values -refFile = os.path.join(cerrPath, 'datasets', 'referenceValuesForTests', 'IBSI2Phase2', - 'IBSIphase2-2_pyCERR_features.csv') -refData = pd.read_csv(refFile) -refColNames = list(refData.head())[4:] -# refFeatNames = refData['feature_tag'][5:] - -# Features to compare -diagList = ['Number of voxels in intensity ROI-mask before interpolation', \ - 'Number of voxels in intensity ROI-mask after interpolation and resegmentation', \ - 'Mean intensity in intensity ROI-mask after interpolation and resegmentation', \ - 'Max intensity in intensity ROI-mask after interpolation and resegmentation', \ - 'Min intensity in intensity ROI-mask after interpolation and resegmentation'] -featList = ['mean', 'var', 'skewness', 'kurtosis', 'median', 'min', 'P10', 'P90', 'max', \ - 'interQuartileRange', 'range', 'meanAbsDev', 'robustMeanAbsDev', 'medianAbsDev', \ - 'coeffVariation', 'coeffDispersion', 'energy', 'rms'] - -# List required output fields -outFieldC = ['mean', 'var', 'skewness', 'kurtosis', 'median', 'min', 'P10', \ - 'P90', 'max', 'interQuartileRange', 'range', 'meanAbsDev', \ - 'robustMeanAbsDev', 'medianAbsDev', 'coeffVariation', \ - 'coeffDispersion', 'energy', 'rms'] -numStats = len(outFieldC) - -diagFieldC = ['NumVoxOrig', 'numVoxelsInterpReseg', \ - 'MeanIntensityInterpReseg', 'MaxIntensityInterpReseg', \ - 'MinIntensityInterpReseg'] - - def loadData(niiDir): """ Import data to plan container""" @@ -59,79 +25,160 @@ def loadData(niiDir): return planC - -def dispDiff(diffValsV, type): +def dispDiff(pctDiffFeatV, ibsiFeatList): """ Report on differences in feature values """ - tol = 1e-4 - if np.max(np.abs(diffValsV)) < tol: - if type == 'feat': - print('Success! Results match reference std.') - print('-------------') + tol = 1 + if np.max(np.abs(pctDiffFeatV)) < tol: + print('Success! Results match reference std.') + print('-------------') else: - checkV = np.abs(diffValsV) > tol + checkV = np.abs(pctDiffFeatV) > tol idxV = np.where(checkV)[0] - if type == 'diag': - print('Diagnostic features differ:') - diffS = dict(zip([diagList[idx] for idx in idxV], [diffValsV[idx] for idx in idxV])) - print(diffS) - elif type == 'feat': - print('First-order features differ:') - diffS = dict(zip([featList[idx] for idx in idxV], [diffValsV[idx] for idx in idxV])) - print(diffS) - print('-------------') - - -def compareVals(imType, calcFeatS, diagS, refValsV): + print('IBSI2 features differ:') + diffS = dict(zip([ibsiFeatList[idx] for idx in idxV], [pctDiffFeatV[idx] for idx in idxV])) + print(diffS) + print('-------------') + +def getRefFeatureVals(cerrFeatS, refValsV): """ Indicate if features match reference, otherwise display differences.""" - # Extract diagnostic features computed with pyCERR - calcDiagV = np.array(list(diagS.values())) - # Extract radiomic features computed with pyCERR - calcFeatV = np.array([calcFeatS[imType + '_firstOrder_' + key+ '_3D'] for key in featList]) - # Extract reference diagnositc & radiomic features - refDiagV = refValsV[0:5] - refFeatV = refValsV[5:] + cerrFeatList = list(cerrFeatS.keys()) + numFeat = len(cerrFeatList) - # Compare pyCERR calculations to reference std - diffDiagV = calcDiagV - refDiagV - diffFeatV = calcFeatV - refFeatV + if numFeat == 0: + raise Exception('Feature calculation failed.') - dispDiff(diffDiagV, 'diag') - dispDiff(diffFeatV, 'feat') + # Loop over radiomic features computed with pyCERR + diffFeatV = [] + refV = [] + cerrV = [] + ibsiFeatList = [] - np.testing.assert_almost_equal(calcDiagV, refDiagV, decimal=4) - np.testing.assert_almost_equal(calcFeatV, refFeatV, decimal=4) + for featIdx in range(numFeat): + featName = cerrFeatList[featIdx] + sepIdxV = [idx for idx, s in enumerate(featName) if '_' in s] -def test_phase2(): - """ Calc. radiomics features using IBSI-2 phase-2 configurations """ + # Find matching reference feature value + if len(sepIdxV)==0: + matchName = featName + else: + matchName = featName[sepIdxV[-2]+1:] - # Load data - planC = loadData(dataPath) + if matchName in refFeatNames: + matchIdx = refFeatNames.index(matchName) + refV.append(refValsV[matchIdx]) + cerrV.append(float(cerrFeatS[featName])) + diffFeatV.append((cerrV[-1] - refV[-1])*100/(refV[-1] + sys.float_info.epsilon)) # pct diff + #diffFeatV.append(cerrV[-1] - refV[-1]) # abs diff + ibsiFeatList.append(matchName) + + pctDiffFeatV = np.asarray(diffFeatV) + refV = np.asarray(refV) + cerrV = np.asarray(cerrV) + + return refV, cerrV, pctDiffFeatV, ibsiFeatList + +def test_calc_features(config): + print('Testing config '+config) scanNum = 0 structNum = 0 + settingsFile = os.path.join(settingsPath, 'IBSIPhase2-2ID' + config + '.json') + tol = 10^-4 + + calcFeatS, diagS = ibsi1.computeScalarFeatures(scanNum, structNum, settingsFile, planC) + cerrFeatS = {**diagS, **calcFeatS} + refValsV = np.array(refData[config]) + refV, cerrV, pctDiffFeatV, ibsiFeatList = getRefFeatureVals(cerrFeatS, refValsV) + dispDiff(pctDiffFeatV,ibsiFeatList) + for i in range(len(refV)): + np.testing.assert_allclose(refV[i], cerrV[i], rtol=tol, atol=tol) + #np.testing.assert_allclose(refV[i], cerrV[i], rtol=0.01) #For comparison with Matlab CERR + +def test_stats_original(): + config = '1a' + test_calc_features(config) + +def test_stats_resampled(): + config = '1b' + test_calc_features(config) + +def test_stats_mean_2d(): + config = '2a' + test_calc_features(config) + +def test_stats_mean_3d(): + config = '2b' + test_calc_features(config) + +def test_stats_LoG_2d(): + config = '3a' + test_calc_features(config) + +def test_stats_LoG_3d(): + config = '3b' + test_calc_features(config) + +def test_stats_rot_inv_laws_energy_2d(): + config = '4a' + test_calc_features(config) + +def test_stats_rot_inv_laws_energy_3d(): + config = '4b' + test_calc_features(config) + +# def test_stats_gabor_2d(): +# config = '5a' +# test_calc_features(config) +# +# def test_stats_gabor_25d(): +# config = '5b' +# test_calc_features(config) - configList = ['1a','1b','2a','2b','3a','3b','4a','4b','5a','5b'] - # TBD:'6a', '6b'. Wavelets not currently supported. +def test_phase2(): + """ Calc. radiomics features using IBSI-2 phase-2 configurations """ + + test_stats_original() + + test_stats_resampled() + + test_stats_mean_2d() + + test_stats_mean_3d() - # Loop over configurations - for idx in range(len(configList)): - config = configList[idx] - colID = refColNames[idx] + test_stats_LoG_2d() - print('Testing setting ' + config) - # Read filter settings - settingsFile = os.path.join(settingsPath, 'IBSIPhase2-2ID' + config + '.json') + test_stats_LoG_3d() - # Calc. radiomics features - calcFeatS, diagS = ibsi1.computeScalarFeatures(scanNum, structNum, settingsFile, planC) + test_stats_rot_inv_laws_energy_2d() - imType = list(calcFeatS.keys())[0].split('_')[0] + test_stats_rot_inv_laws_energy_3d() - # Compare to reference std - refValsV = np.array(refData[colID]) - compareVals(imType, calcFeatS, diagS, refValsV) + #Commented out due to long runtime + #test_stats_gabor_2d() + + #test_stats_gabor_25d() if __name__ == "__main__": + + # Paths to data and settings + currPath = os.path.abspath(__file__) + cerrPath = os.path.join(os.path.dirname(os.path.dirname(currPath)), 'cerr') + dataPath = os.path.join(cerrPath, 'datasets', 'IBSIradiomicsDICOM', 'IBSI2Phase2') + settingsPath = os.path.join(cerrPath, 'datasets', 'radiomics_settings', 'IBSIsettings', 'IBSI2Phase2') + + # Read reference values + #--- For comparison with matlab CERR ---- + #refFile = os.path.join(cerrPath, 'datasets', 'referenceValuesForTests', 'IBSI2Phase2', + # 'IBSIphase2-2_CERR_features.csv') + #---- Test to ensure pyCERR calculations are consistent ---- + refFile = os.path.join(cerrPath, 'datasets', 'referenceValuesForTests', 'IBSI2Phase2', + 'IBSIphase2-2_pyCERR_features.csv') + refData = pd.read_csv(refFile) + refColNames = list(refData.head())[4:] + refFeatNames = list(refData['feature_tag']) + + # Load data + planC = loadData(dataPath) test_phase2()