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

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

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

瀏覽:27日期: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 編程
相關文章:
主站蜘蛛池模板: 日韩爱爱 | 亚洲综合激情网 | 亚洲欧美日韩中文在线 | 国产一级片毛片 | 成人综合网站 | 日韩a视频 | av男人的天堂在线 | www性欧美 | 亚洲国产mv| 欧美一级黄色片 | 中文字幕精品久久 | 亚洲免费小视频 | 国产精品一区二区久久久 | 国产黄色的视频 | 羞羞答答一区 | 国产午夜精品一区二区三区四区 | 亚洲va在线观看 | 午夜影院一区 | 义姐是不良妈妈在线观看 | 色姑娘综合 | 久久久久久免费毛片精品 | 欧美亚洲影院 | 黄色片aaaa | 二区中文字幕 | 中文字幕第二页 | 欧美精品日韩在线观看 | 91国内视频 | 免费av看片| 亚洲女同一区二区 | 国产视频一区二区在线 | 能看的毛片 | 性高潮视频在线观看 | 国产精选自拍 | 黄色网zhan| 国内av自拍 | 日韩欧美一区在线观看 | 欧美三级 欧美一级 | 国产激情网 | 亚洲黄色一区二区三区 | 糖心vlog在线免费观看 | 色婷婷av777 亚洲精品日韩精品 |