- 浏览: 3412133 次
- 性别:
- 来自: 苏州
文章分类
最新评论
-
sonichy:
Qt5改动很多,要改改了。
基于QItemDelegate的例子1 SpinBoxDelegate -
我的主页6:
楼主,2.2子查询的分页方式:SELECT * FROM ar ...
Mysql 分页语句Limit用法 -
liguoqi:
非常感谢楼主的用心指导,工具以及图片例子都提供了 赞!
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载 -
liguoqi:
问下这个图片怎么解压损坏呀
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载 -
liguoqi:
楼主讲解的非常详细,还附带工具和图片例子,非常感谢
两款免费DCIOM 图像浏览软件介绍和DICOM图像例子供下载
【前言】
最近,因为需要开发DICOM网管模块,必须使用DCMTK的DcmNet模块。但是DCMTK3.6.0在DcmNet模块中只提供两个实验阶段的网络类DcmSCU和DcmSCP。而且他们并没有完全实现DICOM的C-Echo、C-Find、C-Get、C-Move和C-store操作。只实现了C-Echo和C-Find操作。
调研了一番,发现DCMTK小组在最新的snapshot版本中(DCMTK3.6.1 2012-08-31),已经实现了DICOM全部操作。而且他们官方论坛中,开发人员在回答疑问时候,针对3.6.0中出现的bug等问题。他们也是鼓励大家直接用最新的DCMTK3.6.1.
当然他们也建议大家自己去通过底层代码实现DcmScu的其他的操作。不过对于我们这种新手来讲确实很困难,而且关键问题在后期的3.6.1版本的代码变化很大。我们自己手写的,以后不方便兼容。
所以最终我还是下载了最新的DCMTK3.6.1-20120831,但是他有一个问题,目前只支持在linux上编译和运行。windows环境,他们并没有提供支持库。于是又让我踌躇了一番,自己也手动试着基于3.6.0写了点代码,但是真的是超级难。最终下定决心在win7上编译3.6.1,并利用DCMTK3.6.0的support(MD)Library。在DCMTK官方论坛开发人员的帮助下,最终编译成功。也实现DcmScu的例子网络访问。
【开发环境】
操作系统:win7 32bit
开发工具:VS2008 + Qt4.7.4
1、DCMTK: DCMTK3.6.120120831
2、DCMTK support libraries for windows: dcmtk-3.6.0-win32-i386-support_MD.zip
3、CMake:cmake-2.8.9-win32-x86.exe
目前我的Qt项目都是基于MD/MDd的运行时库。
【安装过程】
1、将支持库中的相应lib文件,include文件,bin文件拷贝到VS2008安装目录的相应文件夹下。
2、CMake编译
A、设置source code 路径: D:\DCMTK\dcmtk-3.6.1_20120831
B、设置binaries路径: D:\DCMTK\DCMTK-bin
C、选择Configure:visual studio 9 2008
D、等待configure完毕后,会有很多find和not find,无所谓。
E、选中Advanced单选框,然后在红色区域设置:
set DCMTK_OVERWRITE_WIN32_COMPILER_FLAG = OFF;(不选中,这样可以使生成项目运行时库都是MD/MDd,而不是默认的MT/MTd)
set "DCMTK_WITH_ICONV" to "ON" (选中)
set "DCMTK_WITH_OPENSSL" to "ON"(选中)
set "DCMTK_WITH_PNG" to "ON" (选中)
set "DCMTK_WITH_TIFF" to "ON" (选中)
set "DCMTK_WITH_XML" to "ON" (选中)
set "DCMTK_WITH_ZLIB" to "ON" (选中)
F、点击Generate,很快就完成。这时候VS项目源码已经生成。
3、VS2008编译项目源码
A、用VS打开 D:\DCMTK\DCMTK-bin\DCMTK.sln
B、点击Build->Batch Build,选择ALL_BUILD项目的debug版,点击右边的Build。耐心等待。会有很多个warning,应该是由字符编码不统一引起的。最后会看到82个编译 成功,0个失败。
C、再选择Build->Batch Build,这次选择INSTALL项目的debug版本,点击右边的Build。最后会显示1个工程编译成功,这时在你选择的安装目录下(默认是C:\Program Files\DCMTK)就会有lib,bin,include,etc,share文件夹,里面就是之后写程序做医学图像处理所需要的库文件了
4、代码测试
F. Debug,ok,编译工程,运行成功。访问了www.dicomserver.co.uk的DICOM服务器。
源代码如下:
The code uses the public DICOM server at www.dicomserver.co.uk which is offered by Dave Harvey (MedicalObjects). There are also logs you can check at the server in order to debug your application.
/* * * Copyright (C) 2011-2012, OFFIS e.V. * All rights reserved. See COPYRIGHT file for details. * * This software and supporting documentation were developed by * * OFFIS e.V. * R&D Division Health * Escherweg 2 * D-26121 Oldenburg, Germany * * * Module: dcmnet * * Author: Michael Onken * * Purpose: Test for move feature of the DcmSCU class */ #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "dcmtk/dcmnet/testscu.h" #include "dcmtk/dcmnet/diutil.h" #define OFFIS_CONSOLE_APPLICATION "testscu" static OFLogger echoscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION); static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v" OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $"; // our application entity title used for calling the peer machine #define APPLICATIONTITLE "TEST-SCU" // host name of the peer machine #define PEERHOSTNAME "www.dicomserver.co.uk" // TCP/IP port to connect to the peer machine #define PEERPORT 11112 // application entity title of the peer machine #define PEERAPPLICATIONTITLE "MOVESCP" // MOVE destination AE Title #define MOVEAPPLICATIONTITLE "TEST-SCU" static Uint8 findUncompressedPC(const OFString& sopClass, DcmSCU& scu) { Uint8 pc; pc = scu.findPresentationContextID(sopClass, UID_LittleEndianExplicitTransferSyntax); if (pc == 0) pc = scu.findPresentationContextID(sopClass, UID_BigEndianExplicitTransferSyntax); if (pc == 0) pc = scu.findPresentationContextID(sopClass, UID_LittleEndianImplicitTransferSyntax); return pc; } // ******************************************** int main(int argc, char *argv[]) { /* Setup DICOM connection parameters */ OFLog::configure(OFLogger::DEBUG_LOG_LEVEL); DcmTestSCU scu; // set AE titles scu.setAETitle(APPLICATIONTITLE); scu.setPeerHostName(PEERHOSTNAME); scu.setPeerPort(PEERPORT); scu.setPeerAETitle(PEERAPPLICATIONTITLE); // Use presentation context for FIND/MOVE in study root, propose all uncompressed transfer syntaxes OFList<OFString> ts; ts.push_back(UID_LittleEndianExplicitTransferSyntax); ts.push_back(UID_BigEndianExplicitTransferSyntax); ts.push_back(UID_LittleEndianImplicitTransferSyntax); scu.addPresentationContext(UID_FINDStudyRootQueryRetrieveInformationModel, ts); scu.addPresentationContext(UID_MOVEStudyRootQueryRetrieveInformationModel, ts); scu.addPresentationContext(UID_VerificationSOPClass, ts); /* Initialize network */ OFCondition result = scu.initNetwork(); if (result.bad()) { DCMNET_ERROR("Unable to set up the network: " << result.text()); return 1; } /* Negotiate Association */ result = scu.negotiateAssociation(); if (result.bad()) { DCMNET_ERROR("Unable to negotiate association: " << result.text()); return 1; } /* Let's look whether the server is listening: Assemble and send C-ECHO request */ result = scu.sendECHORequest(0); if (result.bad()) { DCMNET_ERROR("Could not process C-ECHO with the server: " << result.text()); return 1; } /* Assemble and send C-FIND request */ OFList<QRResponse*> findResponses; DcmDataset req; req.putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "STUDY"); req.putAndInsertOFStringArray(DCM_StudyInstanceUID, ""); T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, scu); if (presID == 0) { DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); return 1; } result = scu.sendFINDRequest(presID, &req, &findResponses); if (result.bad()) return 1; else DCMNET_INFO("There are " << findResponses.size() << " studies available"); /* Assemble and send C-MOVE request, for each study identified above*/ presID = findUncompressedPC(UID_MOVEStudyRootQueryRetrieveInformationModel, scu); if (presID == 0) { DCMNET_ERROR("There is no uncompressed presentation context for Study Root MOVE"); return 1; } OFListIterator(QRResponse*) study = findResponses.begin(); Uint32 studyCount = 1; OFBool failed = OFFalse; // Every while loop run will get all image for a specific study while (study != findResponses.end() && result.good()) { // be sure we are not in the last response which does not have a dataset if ( (*study)->m_dataset != NULL) { OFString studyInstanceUID; result = (*study)->m_dataset->findAndGetOFStringArray(DCM_StudyInstanceUID, studyInstanceUID); // only try to get study if we actually have study instance uid, otherwise skip it if (result.good()) { req.putAndInsertOFStringArray(DCM_StudyInstanceUID, studyInstanceUID); // fetches all images of this particular study result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, NULL /* we are not interested into responses*/); if (result.good()) { DCMNET_INFO("Received study #" << std::setw(7) << studyCount << ": " << studyInstanceUID); studyCount++; } } } study++; } if (result.bad()) { DCMNET_ERROR("Unable to retrieve all studies: " << result.text()); } while (!findResponses.empty()) { delete findResponses.front(); findResponses.pop_front(); } /* Release association */ scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION); return 0; }
P.S: The header file would be trivial:
#ifndef TESTSCU_H #define TESTSCU_H #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "dcmtk/dcmnet/scu.h" /* Covers most common dcmdata classes */ class DcmTestSCU : public DcmSCU { public: DcmTestSCU() {} ~DcmTestSCU() {} }; #endif // TESTSCU_H
参考文章:
3、how to use DCMTK 3.6.1 on win7
------------------------------------
柳北风儿
http://qimo601.iteye.com
------------------------------------
DCMTK3.6.1编译失败总结
针对DCMTK3.6.1 编译的错误总结:
1、完全默认CMake配置, DCMTK编译成功。但无支持库externallibraries (OpenSSL, zlib, libtiff, libpng, libxml2 and libiconv)
结果:如果不加支持库,运行网上例子,肯定出错。1>Linking...1> LINK : fatal error LNK1181: cannot open input file 'zlib.lib'
2、设置了MD支持库,在VC里配置好文件,手动修改CMakeList.txt为MD/MDd。会出现如下错误:warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use等运行时库冲突错误。
3、按照DCMTK官方编译方法失败。官方配置CMake属性,加上3.6.0MD支持库,
set "DCMTK_WITH_PNG" to "ON" and
set "WITH_LIBPNGINC" e.g. to "C:\libpng-1.4.2"
libtiff support:
set "DCMTK_WITH_TIFF" to "ON" and
set "WITH_LIBTIFFINC" e.g. to "C:\tiff-3.9.2"
OpenSSL support:
set "DCMTK_WITH_OPENSSL" to "ON" and
set "WITH_OPENSSLINC" e.g. to "C:\openssl-1.0.0"
zlib support:
set "DCMTK_WITH_ZLIB" to "ON" and
set "WITH_ZLIBINC" e.g. to "C:\zlib-1.2.5"
libiconv support:
set "DCMTK_WITH_ICONV" to "ON" and
set "WITH_LIBICONVINC" e.g. to "C:\libiconv-1.14"
以及设置DCMTK_OVERWRITE_WIN32_COMPILER_FLAG = OFF;
缺少libiconv的编译后的支持库。
最后还是按照如上方法,完全实现DCMTK3.6.1在win7上的编译。
发表评论
-
DCMTK: DcmSCP, error:QueryRetrieveLevel larger remaining bytes
2012-11-06 09:48 2843最近在DcmSCU发送一个findRequest后,DcmSC ... -
DICOM标准(2011)
2012-10-22 10:31 2897DICOM标准(2011) 最新版,下载请看我的百度云网 ... -
DCMTK:wwwapp instalation
2012-10-18 15:55 3212问题 最近按照wwwapp.txt安装work ... -
workList in DCMTK问题总结
2012-10-17 19:37 3448最近正在配置DCMTK中的worklist,因为需要响应C-F ... -
web Server支持 perl
2012-10-17 10:06 3322最近使用DCMTK 安装worklist 需要用到webser ... -
DICOM C-GET vs C-MOVE
2012-10-08 17:01 6416DICOM中C-Get 和C-Move的区别。 C-Move ... -
【原创】自定义Appender类,输出DCMTK日志
2012-09-24 10:30 5093就像DCMTK官方论坛说的 ... -
问题:自定义Appender输出DCMTK的oflog
2012-09-24 10:09 2726在我调试DCMTK的DcmNet过程中,发现在Oflog中,D ... -
DCMTK:Receiving Images from PACS using DCMSCU
2012-09-15 14:03 5065通过DCMTK的DCMSCU,从PACS获取图像,看看人 ... -
DCMTK: Set output directory to DcmSCP
2012-09-18 09:16 4473Author Message -
DCMTK:DCMSCU get series
2012-09-15 14:02 2711Author Message mano ... -
DCMTK DCMSCU例子
2012-09-15 14:01 5566转载:http://forum.dcmtk.org/viewt ... -
DCMTK DCMScu和DCMScp 细节讨论
2012-09-15 14:04 13449PACS connection Moderator: ... -
DCMTK Howto: User Identity Negotiation
2012-09-18 09:16 6119Howto: User Identity Negotia ... -
DCMTK:howto:dcmscu-example 网络客户端
2012-09-15 14:00 4267DcmSCU example program Th ... -
DCMTK Create a Mammography CAD SR Document
2012-09-18 09:17 2708Howto: Create a Mammography ... -
DCMTK create GSPS object with multiple image references
2012-09-18 09:17 2927Howto: Create GSPS object wi ... -
DCMTK提取Overlay Data
2012-09-14 14:07 4174Howto: Extract Overlay Data ... -
DCMTK获取压缩后的pixel data
2012-09-14 14:06 6267Howto: Accessing Compressed ... -
DCMTK读取多帧图像,不需要全部读取像素数据,即可处理数据
2012-09-14 14:06 5541Howto: Access multi-frame im ...
相关推荐
SnapShot系统备份恢复
编译后的JNDIExploit-1.4-SNAPSHOT.jar,可以直接用,1.4版本支持tomcatBypass路由直接上线msf。
前端开源库-snapshot-diff快照diff,diffing jest snapshots实用程序
配置pom文件爆红,springsecurity-0.0.1-SNAPSHOT.jar下载不下来,这里面有 springsecurity-0.0.1-SNAPSHOT.jar 和它的安装执行语句
解决 Maven 无法下载 fastdfs-client-java-1.29-SNAPSHOT 依赖,直接下载之后用maven命令存储到本地maven仓库即可。 maven命令 mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java ...
实用资源,netapp存储配置练习_snapshot
vagrant-vbox-snapshot, 包装"VBoxManage snapshot"的nautilus插件 vagrant-vbox-snapshot公开 VBoxManage snapshot 命令的Vagrant插件。在Q4年,核心Vagrant提供了Vagrant快照命令。 考虑使用它优先于这个插件。...
sqlite-snapshot最新源码sqlite-snapshot源码sqlite-snapshot源码sqlite-snapshot源码
JNDIExploit-1.2-SNAPSHOT
【DATAGUARD】 将11g物理备库转换为Snapshot Standby【DATAGUARD】 将11g物理备库转换为Snapshot Standby【DATAGUARD】 将11g物理备库转换为Snapshot Standby
JAVA版jieba 1.0.3-SNAPSHOT最新版本jar包。。把它导入idea项目,添加到library和module就可以用啦,导入eclipse项目就更简单了不用我说了吧
v8_context_snapshot
最新snort规则集2.9.13 在1998年,Martin Roesch [1] 用C语言开发了开放源代码(Open Source)的入侵检测系统Snort。直至今天,Snort已发展成为一个具有多平台(Multi-Platform)、实时(Real-Time)流量分析、网络IP...
使用了WindowsNT驱动器技术,支持Windows NT/2000/XP/win7/win8/PE平台,SnapShot为带来了两项新的磁盘映像功能: 1.Snapshot Backup ——在windows运行时建立磁盘镜像 2.Snapshot View——以友好的方式浏览保存的...
snapshot_blob.bin
X264的库。 版本: x264-snapshot-20181217-2245库. 可以在Linux下编译使用。编译方法参见我的博客。
其实2000是带有这个工具的啦,但ACCESS97是没有这个工具的,你可以从这里下载<P> 创建报表快照后,用户即可单独发布生成的快照文件。使用Snapshot Viewer或Microsoft Access可以通过电子邮件传送报表快照
v8_context_snapshot.bin
<br> HTML Snapshot ActiveX控件 特别适合使用于服务器,并且可以容易地集成支持ActiveX的语言,譬如:Visual C++,Visual Basic, Delphi, C++ Builder和.Net 语言如 C#,VB.Net,Java,以及脚本语言如 Perl,...
java -cp target/marshalsec-0.0.1-SNAPSHOT-all.jar marshalsec.<Marshaller> [-a] [-v] [-t] [<gadget_type> []] 参数说明: -a:生成exploit下的所有payload(例如:hessian下的...