dcm4che2-Java Library for DICOM

1 前言:

      DICOM是所有医疗行业工作者都熟知的标准医学图像格式,但它又不止是一个图像格式那么简单。DICOM标准是一套医疗影像行业内必须遵守的标准,不管是医学影像设备制造商,还是医疗软件公司,医院的PACS等等,都必须遵守。DICOM标准共分为十六个章节。

http://www.cnblogs.com/okaimee/archive/2010/07/19/1780863.html,这位博主对DICOM的相关知识点和研究非常全面,值得借鉴和学习。

      目前,多种主流编程语言都有相应的开源包提供对DICOM标准的解释和执行,通过对这些开源库的了解和运用,可以很方便地实现对DICOM图像的解析和处理。C++中比较著名的DICOM标准库是DCMTK,而Java中dcm4che是一个比较全面的函数库。

      由于目前项目中用Java进行服务器端编程。在进行影像导入前要对DICOM图像进行解析,以分析图像格式是否合法以及其所含有的TAG信息是否符合软件的需求。项目经理经过调研后让我使用dcm4che进行解析和图像压缩等。因此有必要对dcm4che进行了解。

 

2 dcm4che,a DICOM Implementation in JAVA

Dcm4che的官网(http://www.dcm4che.org/)上是这样描述的:

DICOM:

Dicom is a specification for the creation, transmission, and storage of digital medical image and report data. It defines a data dictionary, data structures, file format, client and server services, workflow, and compression, among other things. (Dicom是专门用来创建、传输和存储医学图像和报告数据。它定义了数据字典、数据结构、文件格式、客户和服务器服务、工作流和图像压缩及其他事务。)

Dcm4che:

Dcm4che is a collection of open source applications and utilities for the healthcare enterprise. These applications have been developed in the Java programming language for performance and portability, supporting deployment on JDK 1.4 and up. (dcm4che是医疗健康行业中一套开源应用程序和工具,采用Java语言开发,支持JDK1.4及以上版本。)

At the core of the dcm4che project is a robust implementation of the Dicom standard. The dcm4che-1.x DICOM toolkit is used in many production application across the world, while the current (2.x) version of the toolkit has been re-architected for high performance and flexibility. (dcm4che项目的核心是一个DICOM标准的健壮实现. Dcm4che-1.x工具箱已经被世界各地的很多产品使用,而目前的2.x版本是对dcm4che-1.x的重构,提供了应用的性能和灵活性。)

 

3 dcm4-che2在项目中的应用

3.1 读取dcm文件和解析tag

     作为解释DICOM标准的工具包,当然最基本的功能便是读入和解析DICOM文件了。这时需要用到该工具包中的几个类,分别是:DicomObject, DicomElement。以下是读入DICOM的例子代码:

DICOM files can be read from Java java.io.InputStream objects, and java.io.File objects. This is done through the org.dcm4che2.io.DicomInputStream class, which extends java.io.FilterInputStream. The DICOM file is typically read into a org.dcm4che2.data.DicomObject implementation.(dicom文件可以从Java的java.io.InputStream类和java.io.File类读取。这是通过dcm4che2的继承于java.io.FilterInputStream的DicomInputStream类完成的。DICOM文件将被读入为DicomObject类的实现)。

DicomObject dcmObj;

DicomInputStream dcmInputStream = null;

try {

dcmInputStream = new DicomInputStream(new File(“image.dcm”));

dcmObj = dcmInputStram.readDicomObject();

} catch (IOException e) {

e.printStackTrace();

return;

} finally{

try {

dcmInputSteam.close();

} catch (IOException ignore) {

}

}
待续......
 


你可能感兴趣的:(dcm4che2-Java Library for DICOM)