午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

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

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

瀏覽:18日期: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 編程
相關文章:
主站蜘蛛池模板: 日韩欧美黄色 | 五月婷婷一区二区 | 波多野结衣亚洲 | 天天操天天爽天天干 | 国产精品久久久久久久免费看 | 一级片大全 | 国产美女激情视频 | 日韩男女视频 | 成人欧美片 | 99久久久久久久久 | 欧美黄色片在线观看 | 神马午夜888 | av在线资源 | 视频在线一区 | 成人国产网站 | 中文亚洲字幕 | av影音在线 | 中文字幕视频一区 | 男人的天堂毛片 | 99视频一区| 日韩精品一区二区在线播放 | 国产午夜影院 | 亚洲不卡影院 | 一起操在线观看 | 在线看片中文字幕 | 另类激情综合 | 亚洲精品无吗 | 黑人日少妇 | 成人h片在线观看 | 午夜一二三区 | 少妇特黄一区二区三区 | 色男人的天堂 | 欧美亚韩一区二区三区 | 狠狠搞狠狠干 | 中文字幕久久精品 | 97av视频在线 | 日韩在线色| 欧美亚洲在线 | 国产精品一区二区免费看 | 精品久久久久久久久久久久久久久 | 毛片最新网址 |