av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁技術文章
文章詳情頁

在python中讀取* .mhd / *。raw格式

瀏覽:3日期:2022-08-07 14:08:13
如何解決在python中讀取* .mhd / *。raw格式?

最簡單的方法是使用SimpleITK(MedPy也將ITK用于.mhd / .raw文件)。命令

pip install SimpleITK

適用于許多python版本。要讀取.mhd /.raw,可以從kaggle使用此代碼

import SimpleITK as sitkimport numpy as np’’’This funciton reads a ’.mhd’ file using SimpleITK and return the image array, origin and spacing of the image.’’’def load_itk(filename): # Reads the image using SimpleITK itkimage = sitk.ReadImage(filename) # Convert the image to a numpy array first and then shuffle the dimensions to get axis in the order z,y,x ct_scan = sitk.GetArrayFromImage(itkimage) # Read the origin of the ct_scan, will be used to convert the coordinates from world to voxel and vice versa. origin = np.array(list(reversed(itkimage.Getorigin()))) # Read the spacing along each dimension spacing = np.array(list(reversed(itkimage.GetSpacing()))) return ct_scan, origin, spacing解決方法

誰能告訴我如何讀取包含python中的 .mhd / .raw文件的數據集的方式?

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 日韩一级黄色片 | 国产精品av在线 | 美日韩精品 | 福利小视频在线观看 | 久久精品欧美一区二区 | 亚洲精品aaa| 青青草视频污 | 国产黄色av | 久热中文字幕 | 日本黄色三级视频 | 国产高清视频 | 精品久久影院 | 色婷婷av一区二区三区之e本道 | 国产一区不卡 | 日韩一区二区三区在线播放 | 欧美精品一区在线观看 | 色播亚洲 | 国产成人精品一区 | 偷偷操网站| 中国农村毛片免费播放 | 国产寡妇亲子伦一区二区三区四区 | 国产精品自拍一区 | 亚洲黄色在线视频 | 欧美精品在线视频 | 国产欧美精品 | 日本黄色免费网站 | 午夜激情影视 | 亚洲午夜一区 | 天天干b| 欧美三级精品 | 欧美狠狠操 | 久久超 | 久久久国产视频 | 特级毛片爽www免费版 | 狠狠干狠狠干 | 国产日韩免费 | 狠狠狠狠干 | 亚洲特黄 | 亚洲福利一区 | 国产一区二区三区 | 久久久久久成人 |