日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【pyradiomics学习】——安装pyradiomics以及简单示例

發(fā)布時間:2023/12/10 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【pyradiomics学习】——安装pyradiomics以及简单示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

目錄

數(shù)據(jù)集下載:

示例代碼?

參考文獻(xiàn):

bug修復(fù)

運(yùn)行結(jié)果:


數(shù)據(jù)集下載:

  • https://www.jianguoyun.com/p/DcEwQq0Q45bOBxj09JYC (訪問密碼: gd8dmv)

示例代碼?

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2022/1/10 20:27 # @Author : @linlianqin # @Site : # @File : main.py # @Software: PyCharm # @description: ''' pyradiomics學(xué)習(xí) ''' import radiomics from radiomics import featureextractor as FEE# 文件名 ori_name = r'brain1_image.nrrd' lab_name = r'brain1_label.nrrd' para_name = r'Params.yaml'# 文件全部路徑 ori_path =ori_name lab_path = lab_name para_path = para_name print("originl path: " + ori_path) print("label path: " + lab_path) print("parameter path: " + para_path)# 使用配置文件初始化特征抽取器 # extractor = FEE.RadiomicsFeaturesExtractor(para_path) extractor = FEE.RadiomicsFeatureExtractor(para_path) print("Extraction parameters:\n\t", extractor.settings) print("Enabled filters:\n\t", extractor.enabledImagetypes) print("Enabled features:\n\t", extractor.enabledFeatures)# 運(yùn)行 result = extractor.execute(ori_path, lab_path) # 抽取特征 print("Result type:", type(result)) # result is returned in a Python ordered dictionary print("") print("Calculated features") for key, value in result.items(): # 輸出特征print("\t", key, ":", value)

參考文獻(xiàn):

【影像組學(xué)pyradiomics教程】 (二) pyradiomics 使用示例_JianJuly的博客-CSDN博客_pyradiomics的應(yīng)用本系列博客后續(xù)將更新于個人微信公眾號,歡迎關(guān)注。測試用的圖片:pyradiomics\data\brain1_image.nrrd 和 pyradiomics\data\brain1_label.nrrd’測試用的配置文件:pyradiomics\examples\exampleSettings\Params.yaml測試文...https://blog.csdn.net/JianJuly/article/details/79017272

注:在以上文章中會出現(xiàn)以下幾個問題,目前均已經(jīng)解決,上述我寫的代碼沒有問題

bug修復(fù)

1、報(bào)錯AttributeError: module 'radiomics.featureextractor' has no attribute 'RadiomicsFeaturesExtractor'

將RadiomicsFeaturesExtractor庫修改為RadiomicsFeatureExtractor

2、ruamel.yaml.constructor.DuplicateKeyError: while constructing a mapping in "D:/Params.yaml", line 34, column 3 found duplicate key "shape" with value "None" (original value: "None") in "D:/Params.yaml", line 37, column 3 To suppress this check see:?Departure from previous API — Python YAML package documentation-keys Duplicate keys will become an error in future releases, and are errors by default when using the new API.

將yaml配置文件中的第37行注釋掉即可

3、AttributeError: 'RadiomicsFeatureExtractor' object has no attribute '_enabledImagetypes'

將:

print("Enabled filters:\n\t", extractor._enabledImagetypes) print("Enabled features:\n\t", extractor._enabledFeatures)

修改為:

print("Enabled filters:\n\t", extractor.enabledImagetypes) print("Enabled features:\n\t", extractor.enabledFeatures)

運(yùn)行結(jié)果:

?

?

?

總結(jié)

以上是生活随笔為你收集整理的【pyradiomics学习】——安装pyradiomics以及简单示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。