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

AttributeError: 'RadiomicsFirstOrder' object has no attribute 'calculateFeatures' #776

Open rawanalyahya opened 2 years ago

rawanalyahya commented 2 years ago

I am getting this error: AttributeError: 'RadiomicsFirstOrder' object has no attribute 'calculateFeatures'

when running this code:

image =sitk.ReadImage(image)
mask =sitk.ReadImage(mask)
firstOrderFeatures = firstorder.RadiomicsFirstOrder(image,mask)
firstOrderFeatures.enableAllFeatures()  # On the feature class level, all features are disabled by default.
firstOrderFeatures.calculateFeatures()
for (key,val) in six.iteritems(firstOrderFeatures.featureValues):
    print("\t%s: %s" % (key, val))

which I got from the repo. I plotted both mask and image and made sure that I have read them correctly, not sure what the problem is. They are both NIFTI files.

Version: