- 浏览: 3418504 次
- 性别:
- 来自: 苏州
文章分类
最新评论
-
sonichy:
Qt5改动很多,要改改了。
基于QItemDelegate的例子1 SpinBoxDelegate -
我的主页6:
楼主,2.2子查询的分页方式:SELECT * FROM ar ...
Mysql 分页语句Limit用法 -
liguoqi:
非常感谢楼主的用心指导,工具以及图片例子都提供了 赞!
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载 -
liguoqi:
问下这个图片怎么解压损坏呀
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载 -
liguoqi:
楼主讲解的非常详细,还附带工具和图片例子,非常感谢
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载
Howto: Accessing Compressed Data
If compressed DICOM images are loaded, DCMTK most of the time does the job of decompressing the image data itself, e.g. when the user feeds it into the DicomImage
class for visualization or directly calls chooseRepresentation()
to change the transfer syntax. However, sometimes it may be useful to access the original, compressed pixel data of a single- or multi-frame image. This may be the case if the compressed data should be decompressed by an external library (e.g. because DCMTK does not support this kind of compression codec like for MPEG2) or if the data should be decompressed at all since it should be inserted directly into to another file.
For uncompressed pixel data usually this is done very easily by just finding the Pixel Data element in the DICOM dataset by calling DcmItem's findAndGetElement()
routine and then call getUint8Array()
(for example) on the resulting element to access the uncompressed raw pixel data vaules. For compressed data, however, there are some intermediate steps necessary in order to parse the underlying DICOM structures.
The reason is that for compressed data, there is a pseudo-sequence embedded into the Pixel Data element that has to be parsed before actually accessing the compressed data (and individual frames if applicable). The first pseudo-item in that sequence is always the offset table indicating at which byte position each frame actually starts within the following raw data of the Pixel Data element. However, you cannot rely on that table since it may be empty (always empty for MPEG2, for example). Within the next items so-called fragments stored. Usually, one fragment refers to exactly one frame of the image, but that is not a requirement at all. For the rest of the example, at least, this is assumed since this covers 90% of all cases.
In order to access the pixel sequence and the items it is containing, you have to deal with the Pixel Sequence within the Pixel Data element, and that is done using the DcmPixelSequence
class in DCMTK. Here is a full (compiling) example how to accomplish that:
#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "dcmtk/dcmdata/dctk.h" #include "dcmtk/dcmdata/dcpxitem.h" int main(int argc, char *argv[]) { OFCondition result = EC_Normal; /* Load file and get pixel data element */ DcmFileFormat dfile; result = dfile.loadFile("example.dcm"); if (result.bad()) return 1; DcmDataset *data = dfile.getDataset(); if (data == NULL) return 1; DcmElement* element = NULL; result = data->findAndGetElement(DCM_PixelData, element); if (result.bad() || element == NULL) return 1; DcmPixelData *dpix = NULL; dpix = OFstatic_cast(DcmPixelData*, element); /* Since we have compressed data, we must utilize DcmPixelSequence in order to access it in raw format, e. g. for decompressing it with an external library. */ DcmPixelSequence *dseq = NULL; E_TransferSyntax xferSyntax = EXS_Unknown; const DcmRepresentationParameter *rep = NULL; // Find the key that is needed to access the right representation of the data within DCMTK dpix->getOriginalRepresentationKey(xferSyntax, rep); // Access original data representation and get result within pixel sequence result = dpix->getEncapsulatedRepresentation(xferSyntax, rep, dseq); if ( result == EC_Normal ) { DcmPixelItem* pixitem = NULL; // Access first frame (skipping offset table) dseq->getItem(pixitem, 1); if (pixitem == NULL) return 1; Uint8* pixData = NULL; // Get the length of this pixel item (i.e. fragment, i.e. most of the time, the lenght of the frame) Uint32 length = pixitem->getLength(); if (length == 0) return 1; // Finally, get the compressed data for this pixel item result = pixitem->getUint8Array(pixData); // Do something useful with pixData... } if (result.bad()) return 1; else return 0; }
------------------------------------------------------------------
柳北风儿
转载:http://support.dcmtk.org/wiki/dcmtk/howto/accessing-compressed-data
发表评论
-
DCMTK: DcmSCP, error:QueryRetrieveLevel larger remaining bytes
2012-11-06 09:48 2878最近在DcmSCU发送一个findRequest后,DcmSC ... -
DICOM标准(2011)
2012-10-22 10:31 2910DICOM标准(2011) 最新版,下载请看我的百度云网 ... -
DCMTK:wwwapp instalation
2012-10-18 15:55 3234问题 最近按照wwwapp.txt安装work ... -
workList in DCMTK问题总结
2012-10-17 19:37 3463最近正在配置DCMTK中的worklist,因为需要响应C-F ... -
web Server支持 perl
2012-10-17 10:06 3338最近使用DCMTK 安装worklist 需要用到webser ... -
DICOM C-GET vs C-MOVE
2012-10-08 17:01 6450DICOM中C-Get 和C-Move的区别。 C-Move ... -
【最新snapshot】DCMTK3.6.1(MD支持库)安装说明
2012-09-25 16:16 7283【前言】 最近,因为需要开发DICOM ... -
【原创】自定义Appender类,输出DCMTK日志
2012-09-24 10:30 5103就像DCMTK官方论坛说的 ... -
问题:自定义Appender输出DCMTK的oflog
2012-09-24 10:09 2733在我调试DCMTK的DcmNet过程中,发现在Oflog中,D ... -
DCMTK:Receiving Images from PACS using DCMSCU
2012-09-15 14:03 5085通过DCMTK的DCMSCU,从PACS获取图像,看看人 ... -
DCMTK: Set output directory to DcmSCP
2012-09-18 09:16 4485Author Message -
DCMTK:DCMSCU get series
2012-09-15 14:02 2722Author Message mano ... -
DCMTK DCMSCU例子
2012-09-15 14:01 5596转载:http://forum.dcmtk.org/viewt ... -
DCMTK DCMScu和DCMScp 细节讨论
2012-09-15 14:04 13561PACS connection Moderator: ... -
DCMTK Howto: User Identity Negotiation
2012-09-18 09:16 6126Howto: User Identity Negotia ... -
DCMTK:howto:dcmscu-example 网络客户端
2012-09-15 14:00 4277DcmSCU example program Th ... -
DCMTK Create a Mammography CAD SR Document
2012-09-18 09:17 2719Howto: Create a Mammography ... -
DCMTK create GSPS object with multiple image references
2012-09-18 09:17 2939Howto: Create GSPS object wi ... -
DCMTK提取Overlay Data
2012-09-14 14:07 4193Howto: Extract Overlay Data ... -
DCMTK读取多帧图像,不需要全部读取像素数据,即可处理数据
2012-09-14 14:06 5561Howto: Access multi-frame im ...
相关推荐
C++,dcmtk,gdcm实现dicom图像解压缩,信息读取,支持jpeg,jpeg2000,jpeg-ls等多种压缩格式,支持有损解压和无损解压
这是博文《第一个 DCMTK 程序:显示 DICOM 图像(DCMTK 3.6.4 + Qt 5.14.2 + VS2015)》的源码,详细内容见博客文章 https://blog.csdn.net/blackwoodcliff/article/details/109481195
dcmtk使用手册,医学领域的东东,有学习的可以下载看看,没学过,不知道好不好学
DCMTK编译文件说明。DCMTK3.6.0
通过对dcmtk的源代码修改调整后,编译,目前测试在win10下面运行,可以命令行直接运行 (默认参数 端口1024,也可以命令行输入端口数字 ,图像保存路径为程序所在的目录,存储的方式使用1~198 数字的目录hash方式...
名称:DCMTK 评级:★★★★★ 开源许可:BSD 功能: 影像处理,影像归档,影像管理,影像传输 标准:DICOM 语言:英语 客户端: 桌面 平台:跨平台 编程语言:C/C++ 官方网站:http://dicom.offis.de/
linux 系统下DCMTK3.6.0源码
DICOM DCMTK显示DICOM图像 VC DCMTKDICOM DCMTK显示DICOM图像 VC DCMTKDICOM DCMTK显示DICOM图像 VC DCMTK
Windows平台下,Qt(5.10)32位环境下编译的dcmtk(3.6.3)库,包含debug和release版
最全DCMTK攻略.doc
专栏博文“DICOM:基于DCMTK实现C-FIND SCU”中对应的源代码。基于dcmtk开源库中的findscu工程,实现的简单的C-FIND SCU,用于示范如何使用dcmtk操作实现具体的DICOM应用。
压缩文件包含了DCMTK和CMAKE的工具包,并有详细的使用文档,根据文档一步步的操作即可。希望对大家有用
dcmtk dcmtk-3.5.4 source code and documentation
dcmtk VS2013编译后的debug与release 库,可以直接用来处理dicom文件。
dcmtk程序包简介,欢迎下载,共同学习!
windows64位,visual2017,配合Cmake使用,需要的可以下载使用。dcmtk有多种工具集合,包括实现jpeg2000压缩dcm文件。
DCMTK工具下载,实现dicom传输文件等功能,包含各种脚本命令帮助
DCMTK 3.6.6 源码,下载自官网
DCMTK3.6.3源码:dcmtk-3.6.3.zip 以及英文帮助文档 : dcmtk-3.6.3-html-help.zip
DCMTK3.5.4的include库,已经编译好的,直接使用即可~~