AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.14k stars 492 forks source link

Range filter and removing outliers for re-segmentation #751

Open tatsunidas opened 2 years ago

tatsunidas commented 2 years ago

Hi, @JoostJM

I'm testing range filtering. I don't know why, I cannot get expected values with following settings.

settings['resegmentRange'] = [-1000,400]
settings['resegmentMode'] = 'absolute' # corresponding to the gray values in the image

firstOrderFeatures = firstorder.RadiomicsFirstOrder(image, mask, **settings)
firstOrderFeatures.enableFeatureByName('Mean', True)
firstOrderFeatures.enableFeatureByName("Minimum", True)
firstOrderFeatures.enableFeatureByName("Maximum", True)
# firstOrderFeatures.enableAllFeatures()

print('Calculating first order features...')
results = firstOrderFeatures.execute()
print('done')

print('Calculated first order features: ')
for (key, val) in six.iteritems(results):
  print('  ', key, ':', val)

then, will out put,

Calculating first order features...
done
Calculated first order features: 
   Mean : -46.88272018905282
   Minimum : -1000.0
   Maximum : 723.0 # why not 400 ??

I'm using pyradiomics 3.0.1 on google colab. Notebook is here. I appreciate it if you let me know some advice.

tatsuaki

JoostJM commented 2 years ago

@tatsunidas, this is because you are not using the RadiomicsFeatureExtractor, but implementing the feature classes directly. If you follow this example, it should work.

tatsunidas commented 2 years ago

@JoostJM

Thank you for your response. I see, would like to try it. Thank you again.