我正在尝试使用 sitk.LabelIntensityStatisticsImageFilter 来计算图像中标签的一阶统计信息。
我的代码是
import SimpleITK as sitk
ADC600 = '/Users/omarkamal/PycharmProjects/DWI/Pt1/ADC600.nii'
ADC600_r = sitk.ReadImage(ADC600)
label = '/Users/omarkamal/PycharmProjects/DWI/Pt1/seg.nii.gz'
label = sitk.ReadImage(label)
labelstatsFilter = sitk.LabelIntensityStatisticsImageFilter
labelstatsFilter.Execute(ADC600_r, label)
Mean = labelstatsFilter.GetMean(1)
Kurtosis = labelstatsFilter.GetKurtosis(1)
print(Mean, Kurtosis)
我收到此错误:
Traceback (most recent call last):
File "/Users/omarkamal/PycharmProjects/DWI/Stats Extractor.py", line 21, in <module>
labelstatsFilter.Execute(ADC600_r, label)
File "/Users/omarkamal/anaconda3/envs/dicom/lib/python3.7/site-packages/SimpleITK/SimpleITK.py", line 41307, in Execute
return _SimpleITK.LabelIntensityStatisticsImageFilter_Execute(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'LabelIntensityStatisticsImageFilter_Execute'.
Possible C/C++ prototypes are:
itk::simple::LabelIntensityStatisticsImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &)
itk::simple::LabelIntensityStatisticsImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &,double,bool,bool,uint32_t)
显然这个模块是从 C/C++ 中的 itk 借来的?我该如何解决?
我还想计算在 simpleITK 中找不到的熵。有任何想法吗?