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.17k stars 497 forks source link

Extracting b Hyperimage Feature Error #580

Closed zhangji1234 closed 2 years ago

zhangji1234 commented 4 years ago

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. image

It's my results, and no features have been extracted.

JoostJM commented 4 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).

JoostJM commented 4 years ago

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.

JoostJM commented 4 years ago

https://pyradiomics.readthedocs.io/en/latest/faq.html#what-modalities-does-pyradiomics-support-2d-3d-color

markvvw commented 4 years ago

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. image

It's my results, and no features have been extracted.

qq286500567 我告诉你