苏州网站建设上往建站软件外包公司的一生

news/2025/10/3 3:32:19/文章来源:
苏州网站建设上往建站,软件外包公司的一生,企业信息查询系统官网上海,电商网站订烟平台官网DICOMDICOM#xff08;Digital Imaging and Communications in Medicine#xff09;即医学数字成像和通信#xff0c;是医学图像和相关信息的国际标准#xff08;ISO 12052#xff09;。它定义了质量能满足临床需要的可用于数据交换的医学图像格式#xff0c;可用于处理、…DICOMDICOMDigital Imaging and Communications in Medicine即医学数字成像和通信是医学图像和相关信息的国际标准ISO 12052。它定义了质量能满足临床需要的可用于数据交换的医学图像格式可用于处理、存储、打印和传输医学影像信息。DICOM可以便捷地交换于两个满足DICOM格式协议的工作站之间。目前该协议标准不仅广泛应用于大型医院而且已成为小型诊所和牙科诊所医生办公室的标准影像阅读格式。 DICOM被广泛应用于放射医疗、心血管成像以及放射诊疗诊断设备X射线CT核磁共振超声等并且在眼科和牙科等其它医学领域得到越来越深入广泛的应用。在数以万计的在用医学成像设备中DICOM是部署最为广泛的医疗信息标准之一。当前大约有百亿级符合DICOM标准的医学图像用于临床使用。 目前越来越多的DICOM应用程序和分析软件被运用于临床医学促使越来越多的编程语言开发出支持DICOM API的框架。今天就让我来介绍一下Python语言下支持的DICOM模块以及如何完成基本DICOM信息分析和处理的编程方法。 Pydicom Pydicom是一个处理DICOM文件的纯Python软件包。它可以通过非常容易的“Pythonic”的方式来提取和修改DICOM数据修改后的数据还会借此生成新的DICOM文件。作为一个纯Python包Pydicom可以在Python解释器下任何平台运行除了必须预先安装Numpy模块外几乎无需其它任何配置要求。其局限性之一是无法处理压缩像素图像如JPEG其次是无法处理分帧动画图像如造影电影。 SimpleITK Insight Segmentation and Registration Toolkit (ITK)是一个开源、跨平台的框架可以提供给开发者增强功能的图像分析和处理套件。其中最为著名的就是SimpleITK是一个简化版的、构建于ITK最顶层的模块。SimpleITK旨在易化图像处理流程和方法。 PIL Python Image Library (PIL) 是在Python环境下不可缺少的图像处理模块支持多种格式并提供强大的图形与图像处理功能而且API却非常简单易用。 OpenCV OpenCV的全称是Open Source Computer Vision Library。OpenCV是一个基于BSD许可开源发行的跨平台计算机视觉库可以运行在Linux、Windows和Mac OS操作系统上。它轻量级而且高效——由一系列 C 函数和少量 C 类构成同时提供了Python、Ruby、MATLAB等语言的接口实现了图像处理和计算机视觉方面的很多通用算法。 下面就让我以实际Python代码来演示如何编程处理心血管冠脉造影DICOM图像信息。 1. 导入主要框架SimpleITK、pydicom、PIL、cv2和numpy import SimpleITK as sitk from PIL import Image import pydicom import numpy as np import cv2 2. 应用SimpleITK框架来读取DICOM文件的矩阵信息。如果DICOM图像是三维螺旋CT图像则帧参数则代表CT扫描层数而如果是造影动态电影图像则帧参数就是15帧/秒的电影图像帧数。 def loadFile(filename):ds sitk.ReadImage(filename)img_array sitk.GetArrayFromImage(ds)frame_num, width, height img_array.shapereturn img_array, frame_num, width, height 3. 应用pydicom来提取患者信息。 def loadFileInformation(filename):information {}ds pydicom.read_file(filename) information[PatientID] ds.PatientIDinformation[PatientName] ds.PatientNameinformation[PatientBirthDate] ds.PatientBirthDateinformation[PatientSex] ds.PatientSexinformation[StudyID] ds.StudyIDinformation[StudyDate] ds.StudyDateinformation[StudyTime] ds.StudyTimeinformation[InstitutionName] ds.InstitutionNameinformation[Manufacturer] ds.Manufacturerinformation[NumberOfFrames] ds.NumberOfFrames return information 4. 应用PIL来检查图像是否被提取。 def showImage(img_array, frame_num 0):img_bitmap Image.fromarray(img_array[frame_num])return img_bitmap 5. 采用CLAHE (Contrast Limited Adaptive Histogram Equalization)技术来优化图像。 def limitedEqualize(img_array, limit 4.0):img_array_list []for img in img_array:clahe cv2.createCLAHE(clipLimit limit, tileGridSize (8,8))img_array_list.append(clahe.apply(img))img_array_limited_equalized np.array(img_array_list)return img_array_limited_equalized 这一步对于整个图像处理起到很重要的作用可以根据不同的原始DICOM图像的窗位和窗宽来进行动态调整以达到最佳的识别效果。 最后应用OpenCV的Python框架cv2把每帧图像组合在一起生成通用视频格式。 def writeVideo(img_array):frame_num, width, height img_array.shapefilename_output filename.split(.)[0] .avi video cv2.VideoWriter(filename_output, -1, 16, (width, height)) for img in img_array:video.write(img)video.release() VTK加载DICOM数据 import vtk from vtk.util import numpy_support import numpy PathDicom ./dir_with_dicom_files/ reader vtk.vtkDICOMImageReader() reader.SetDirectoryName(PathDicom) reader.Update() # Load dimensions using GetDataExtent _extent reader.GetDataExtent() ConstPixelDims [_extent[1]-_extent[0]1, _extent[3]-_extent[2]1, _extent[5]-_extent[4]1] # Load spacing values ConstPixelSpacing reader.GetPixelSpacing() # Get the vtkImageData object from the reader imageData reader.GetOutput() # Get the vtkPointData object from the vtkImageData object pointData imageData.GetPointData() # Ensure that only one array exists within the vtkPointData object assert (pointData.GetNumberOfArrays()1) # Get the vtkArray (or whatever derived type) which is needed for the numpy_support.vtk_to_numpy function arrayData pointData.GetArray(0) # Convert the vtkArray to a NumPy array ArrayDicom numpy_support.vtk_to_numpy(arrayData) # Reshape the NumPy array to 3D using ConstPixelDims as a shape ArrayDicom ArrayDicom.reshape(ConstPixelDims, orderF) PYDICOM加载DICOM数据 可以在https://github.com/darcymason/pydicom的test里面看怎么用代码。 import dicom import os import numpy PathDicom ./dir_with_dicom_series/ lstFilesDCM [] # create an empty list for dirName, subdirList, fileList in os.walk(PathDicom): for filename in fileList: if .dcm in filename.lower(): # check whether the files DICOM lstFilesDCM.append(os.path.join(dirName,filename)) # Get ref file RefDs dicom.read_file(lstFilesDCM[0]) # Load dimensions based on the number of rows, columns, and slices (along the Z axis) ConstPixelDims (int(RefDs.Rows), int(RefDs.Columns), len(lstFilesDCM)) # Load spacing values (in mm) ConstPixelSpacing (float(RefDs.PixelSpacing[0]), float(RefDs.PixelSpacing[1]), float(RefDs.SliceThickness)) # The array is sized based on ConstPixelDims ArrayDicom numpy.zeros(ConstPixelDims, dtypeRefDs.pixel_array.dtype) # loop through all the DICOM files for filenameDCM in lstFilesDCM: # read the file ds dicom.read_file(filenameDCM) # store the raw image data ArrayDicom[:, :, lstFilesDCM.index(filenameDCM)] ds.pixel_array 转换VTK built-in types to SimpleITK/ITK built-ins and vice-versa import vtk import SimpleITK dctITKtoVTK {SimpleITK.sitkInt8: vtk.VTK_TYPE_INT8, SimpleITK.sitkInt16: vtk.VTK_TYPE_INT16, SimpleITK.sitkInt32: vtk.VTK_TYPE_INT32, SimpleITK.sitkInt64: vtk.VTK_TYPE_INT64, SimpleITK.sitkUInt8: vtk.VTK_TYPE_UINT8, SimpleITK.sitkUInt16: vtk.VTK_TYPE_UINT16, SimpleITK.sitkUInt32: vtk.VTK_TYPE_UINT32, SimpleITK.sitkUInt64: vtk.VTK_TYPE_UINT64, SimpleITK.sitkFloat32: vtk.VTK_TYPE_FLOAT32, SimpleITK.sitkFloat64: vtk.VTK_TYPE_FLOAT64} dctVTKtoITK dict(zip(dctITKtoVTK.values(), dctITKtoVTK.keys())) def convertTypeITKtoVTK(typeITK): if typeITK in dctITKtoVTK: return dctITKtoVTK[typeITK] else: raise ValueError(Type not supported) def convertTypeVTKtoITK(typeVTK): if typeVTK in dctVTKtoITK: return dctVTKtoITK[typeVTK] else: raise ValueError(Type not supported) VTK-SimpleITK绘制数据 #!/usr/bin/python import SimpleITK as sitk import vtk import numpy as np from vtk.util.vtkConstants import * def numpy2VTK(img,spacing[1.0,1.0,1.0]): # evolved from code from Stou S., # on http://www.siafoo.net/snippet/314 importer vtk.vtkImageImport() img_data img.astype(uint8) img_string img_data.tostring() # type short dim img.shape importer.CopyImportVoidPointer(img_string, len(img_string)) importer.SetDataScalarType(VTK_UNSIGNED_CHAR) importer.SetNumberOfScalarComponents(1) extent importer.GetDataExtent() importer.SetDataExtent(extent[0], extent[0] dim[2] - 1, extent[2], extent[2] dim[1] - 1, extent[4], extent[4] dim[0] - 1) importer.SetWholeExtent(extent[0], extent[0] dim[2] - 1, extent[2], extent[2] dim[1] - 1, extent[4], extent[4] dim[0] - 1) importer.SetDataSpacing( spacing[0], spacing[1], spacing[2]) importer.SetDataOrigin( 0,0,0 ) return importer def volumeRender(img, tf[],spacing[1.0,1.0,1.0]): importer numpy2VTK(img,spacing) # Transfer Functions opacity_tf vtk.vtkPiecewiseFunction() color_tf vtk.vtkColorTransferFunction() if len(tf) 0: tf.append([img.min(),0,0,0,0]) tf.append([img.max(),1,1,1,1]) for p in tf: color_tf.AddRGBPoint(p[0], p[1], p[2], p[3]) opacity_tf.AddPoint(p[0], p[4]) # working on the GPU # volMapper vtk.vtkGPUVolumeRayCastMapper() # volMapper.SetInputConnection(importer.GetOutputPort()) # # The property describes how the data will look # volProperty vtk.vtkVolumeProperty() # volProperty.SetColor(color_tf) # volProperty.SetScalarOpacity(opacity_tf) # volProperty.ShadeOn() # volProperty.SetInterpolationTypeToLinear() # working on the CPU volMapper vtk.vtkVolumeRayCastMapper() compositeFunction vtk.vtkVolumeRayCastCompositeFunction() compositeFunction.SetCompositeMethodToInterpolateFirst() volMapper.SetVolumeRayCastFunction(compositeFunction) volMapper.SetInputConnection(importer.GetOutputPort()) # The property describes how the data will look volProperty vtk.vtkVolumeProperty() volProperty.SetColor(color_tf) volProperty.SetScalarOpacity(opacity_tf) volProperty.ShadeOn() volProperty.SetInterpolationTypeToLinear() # Do the lines below speed things up? # pix_diag 5.0 # volMapper.SetSampleDistance(pix_diag / 5.0) # volProperty.SetScalarOpacityUnitDistance(pix_diag) vol vtk.vtkVolume() vol.SetMapper(volMapper) vol.SetProperty(volProperty) return [vol] def vtk_basic( actors ): Create a window, renderer, interactor, add the actors and start the thing Parameters ---------- actors : list of vtkActors Returns ------- nothing # create a rendering window and renderer ren vtk.vtkRenderer() renWin vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(600,600) # ren.SetBackground( 1, 1, 1) # create a renderwindowinteractor iren vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) for a in actors: # assign actor to the renderer ren.AddActor(a ) # render renWin.Render() # enable user interface interactor iren.Initialize() iren.Start() ##### filename toto.nii.gz img sitk.ReadImage( filename ) # SimpleITK object data sitk.GetArrayFromImage( img ) # numpy array from scipy.stats.mstats import mquantiles q mquantiles(data.flatten(),[0.7,0.98]) q[0]max(q[0],1) q[1] max(q[1],1) tf[[0,0,0,0,0],[q[0],0,0,0,0],[q[1],1,1,1,0.5],[data.max(),1,1,1,1]] actor_list volumeRender(data, tftf, spacingimg.GetSpacing()) vtk_basic(actor_list) 下面一个不错的软件 https://github.com/bastula/dicompyler 还有一个python的库mudicomhttps://github.com/neurosnap/mudicom import mudicom mu mudicom.load(mudicom/tests/dicoms/ex1.dcm) # returns array of data elements as dicts mu.read() # returns dict of errors and warnings for DICOM mu.validate() # basic anonymization mu.anonymize() # save anonymization mu.save_as(dicom.dcm) # creates image object img mu.image # before v0.1.0 this was mu.image() # returns numpy array img.numpy # before v0.1.0 this was mu.numpy() # using Pillow, saves DICOM image img.save_as_pil(ex1.jpg) # using matplotlib, saves DICOM image img.save_as_plt(ex1_2.jpg) 本文转自 http://mp.weixin.qq.com/s?__bizMzAxOTk4NTIwMwmid2247483968idx1sn2844930d81f3e1f45260338dae21d8eachksm9c3fe41cab486d0aa9d03a6494865c0ffdbb0e878f4804227a73d2d403382432fe22e9c03b71mpshare1scene23srcid0122xHKRmyLclSvbojaS1ICX## http://blog.csdn.net/langb2014/article/details/54667905# http://www.jianshu.com/p/df64088e9b6b

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/925512.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站建设属于哪个类目网址大全导航

以下是详细步骤。 创建大小为 V 的最小堆,其中 V 是给定图中的顶点数。最小堆的每个节点包含顶点编号和顶点的距离值。 以源顶点为根初始化最小堆(分配给源顶点的距离值为0)。分配给所有其他顶点的距离值为 INF(无限)。 当最小堆不为空时,执行以下操作: 从最小堆中提取…

discuz做商城网站第三方交易网站怎么做

for语句for语句是C语言所提供的一种功能广泛的循环语句。下图为for语句的标准形式:表达式1:通常用于给循环变量赋初值,一般是赋值表达式。表达式2:通常用于设立循环条件,一般为关系表达式或逻辑表达式。表达式3&#x…

专业网站建设科技公司成都最好的网站建设

复制文件 要求: 1、将原文件xxx.txt中的内容复制到新的文件里 2、新文件的文件名为xxx(复制).txt,即原文件名复制进行命名 大框架: 1、输入想要复制的文件xxx.txt input() 2、创建一个文件xxx(复制).txt f1 open(&quo…

最便宜网站空间成都设计公司排行建筑设计公司

共享办公室,也称为联合办公空间,是一种现代的工作空间模式,它允许不同公司或个体在一个共享的环境下工作,同时提供必要的办公设施和服务。这种模式打破了传统办公室的局限,提供了更高的灵活性和社区感。 共享办公室它通…

怎么添加网站背景音乐网站建设有哪些常用行为

类 类的大小 和结构体大小求法一致。但需注意,普通空类也会占用 1 字节大小,因为普通空类可以实例化对象。 而 抽象空类占 4 字节(32 位机中),因为抽象空类中含有虚指针(含有虚函数的非抽象空类同理&am…

网站欢迎页面设计沈阳市建设工程项目管理中心网站

基于控制台的四则运算 代码地址 a.需求分析 运算符为 , −, , 除了整数以外,还要支持真分数的四则运算,真分数的运算,例如:1/6 1/8 7/24要求能处理用户输入的真分数, 如 1/2, 5/12 等并且要求能处理用户的输入&#…

巢湖网 网站网站建设需要多钱

现在距离2024年初中生古诗文大会初选还有不到4个月(11月3日正式开赛),我们继续来看10道选择题真题和详细解析。为帮助孩子自测和练习,题目的答案和解析统一附后。 本专题持续分享。 一、上海初中古诗文大会历年真题精选(参考答案…

设计网站的优势免费建站哪里找

本篇的主题是将单元格内一串文本,找出所有数字并求和,如下图。难度较高,新手建议仅了解下,先学会数组运用,再研究此知识点。废话少说,步入正题。重点说明:本篇只针对文本内整数的数字进行提取并…

刚备案的域名如何做网站2015微信网站设计

Navicat是一套快速、可靠并价格相当便宜的数据库管理工具,专为简化数据库的管理及降低系统管理成本而设。它的设计符合数据库管理员、开发人员及中小企业的需要。Navicat 是以直觉化的图形用户界面而建的,让你可以以安全并且简单的方式创建、组织、访问并…

网站如何做路由器cos wordpress

先看几个概念: 时间戳:从1970年1月1日00:00:00开始按秒计算的偏移量。举个例子,现在是2017年6月11的下午16:54:32,那么print(time.time())输出的值是1497171320.99就代表现在的时间戳。 元组(struct_time)…

网站开发合作运营平台合同网站建设及经营应解决好的问题

本系列文章简介: 在当今快速发展的软件开发领域,API(Application Programming Interface,应用程序编程接口)作为不同软件应用之间通信的桥梁,其重要性日益凸显。随着微服务架构的兴起,API的数量…

怎么做便民信息网站网上免费个人网站

文章目录 前言引入1、链表定义及结构链表的分类3、单向不带头链表实现实现完整代码 4、带头双向循环链表实现实现完整代码 前言 引入 在上一篇文章中,我们认识了顺序表,但是在许多情况中,顺序表在处理一些事件时还存在许多问题,比…

泉州网站建设轩奇网讯网络营销工具与方法

前言 本章内容为VUE工作过程与相关使用讨论。 上一篇文章地址: Vue 3:玩一下web前端技术(二)_Lion King的博客-CSDN博客 下一篇文章地址: Vue 3:玩一下web前端技术(四)_Lion Ki…

网站建站在线制作个人网站备注模板

想做网站,内容跟外链缺一不可,如果真的要说哪个更重要,那内容依旧是网站的核心,而外链则是额外的加分项 内容永远是王道,不管谷歌seo的算法怎么变,只要你的内容没问题,那就肯定不会牵扯到你的网…

招聘类网站怎么做网络推广团队哪家好

1.ICMP是什么协议?处于哪一层? ICMP(Internet Control Message Protocol)是一种网络协议,用于在IP网络中传递控制消息和错误报告。它是在IP协议之上运行的协议。 ICMP主要用于在网络中的不同主机和路由器之间传…

营销型网站建设案例分析wordpress短视频模版

R语言中 fread 怎么用? 今天分享的笔记内容是数据读取神器fread,速度嘎嘎快。在R语言中,fread函数是data.table包中的一个功能强大的数据读取函数,可以用于快速读取大型数据文件,它比基本的read.table和read.csv函数更…

备案 网站名字电子商务系统网站开发总结

在使用 Axios 时处理 AxiosError 有几种常见的方法: 使用 try-catch 语句捕获异常: try {const response await axios.get(/api/data);// 处理响应数据 } catch (error) {if (error.response) {// 请求成功但状态码不在 2xx 范围console.log(error.response.data);console.l…

asp.net网站管理工具手机wap网站开发

思维导图 学习内容 在介绍完一些基本指令后,我们需要进行对权限以后一个全新的认识,比如文件的权限、目录的权限等等…… 学习内容 通过上面的学习目标,我们可以列出要学习的内容: shell命令以及运行原理Linux权限的概念Linux权…

医疗营销网站建设注册公司流程和费用最新

无论是将文件读入脚本,还是将数据从脚本输出到文件,都会用到文件重定向,这是一种很 常见的操作。本节中的示例脚本两种功能皆有。它会读取 CSV 格式的数据文件,输出 SQL INSERT 语句,并将数据插入数据库。 shell 脚本使…

做网站百度营销型网站建设营销型网站建设

理解反射对学习Java框架有很大的帮助,如Spring框架的核心就是使用Java反射实现的,而且对做一些Java底层的操作会很有帮助。一、Class类的使用1、万事万物皆对象,(当然,基本数据类型,静态成员不是面向对象(属于类的))&a…