Closed zhangji1234 closed 2 years ago
Your input images are in .png
format, which is stored as a vector image (3 colors). This is not supported for the image. For the mask, it is treated as a segmentation object with 3 separate channels (i.e. 3 segmentations).
There are multiple issues already posted regarding this issue, including some pointers as to what you could do. It has not been addressed in the code, as there are several ways to deal with this (e.g. create a single-channel image through some arithmetic, or to treat each channel as a separate image and calculate features for each channel separately).
Still I think it might be a good idea to have PyRadiomics issue a clear waring regarding this error, as multiple users run into this issue.
import radiomics.featureextractor as FEE import csv
main_path = r'E:\XX' ori_name = r'\3.png' lab1_name = r'\4.png' para_name = r'\Params.yaml' ori_path = main_path + ori_name lab1_path = main_path + lab1_name para_path = main_path + para_name print("originl path: " + ori_path) print("label path: " + lab1_path) print("parameter path: " + para_path) extractor = FEE.RadiomicsFeaturesExtractor(para_path) print ("Extraction parameters:\n\t", extractor.settings) print ("Enabled filters:\n\t", extractor._enabledImagetypes) print ("Enabled features:\n\t", extractor._enabledFeatures)
GTV1
result = extractor.execute(ori_path,lab1_path) print ("Result type:", type(result)) print ("") print ("Calculated features") out=open("E:\XX\GTV4.csv",'w') csvWriter = csv.writer(out,dialect=result) for key,value in result.items(): csvWriter.writerow([key,value]) out.close() for key, value in result.items(): print ("\t", key, ":", value)
That's my code.
It's my results, and no features have been extracted.
qq286500567 我告诉你
import radiomics.featureextractor as FEE import csv
main_path = r'E:\XX' ori_name = r'\3.png' lab1_name = r'\4.png' para_name = r'\Params.yaml'
ori_path = main_path + ori_name lab1_path = main_path + lab1_name para_path = main_path + para_name print("originl path: " + ori_path) print("label path: " + lab1_path) print("parameter path: " + para_path)
extractor = FEE.RadiomicsFeaturesExtractor(para_path) print ("Extraction parameters:\n\t", extractor.settings) print ("Enabled filters:\n\t", extractor._enabledImagetypes) print ("Enabled features:\n\t", extractor._enabledFeatures)
GTV1
result = extractor.execute(ori_path,lab1_path) print ("Result type:", type(result)) print ("") print ("Calculated features") out=open("E:\XX\GTV4.csv",'w') csvWriter = csv.writer(out,dialect=result) for key,value in result.items(): csvWriter.writerow([key,value]) out.close() for key, value in result.items(): print ("\t", key, ":", value)
That's my code.
It's my results, and no features have been extracted.