首页 > 其他分享 >DCMTK c-find简单示例

DCMTK c-find简单示例

时间:2023-11-21 11:25:14浏览次数:37  
标签:UID 示例 ts VerificationSOPClass dset DCMTK presID scu find

DcmSCU scu;
//设置连接信息
scu.setPeerAETitle(serverAETitle);
scu.setPeerHostName(serverHost);
scu.setPeerPort(serverPort);
scu.setAETitle(clientAETitle);

//设置协议上下文 传输编码格式
OFList<OFString> ts;
ts.push_back(UID_LittleEndianImplicitTransferSyntax);
ts.push_back(UID_LittleEndianExplicitTransferSyntax);
ts.push_back(UID_BigEndianExplicitTransferSyntax);

scu.addPresentationContext(UID_VerificationSOPClass, ts); //验证服务该服务是必须的

/* Initialize network */
OFCondition result = scu.initNetwork();
DcmFileFormat dcmff;
DcmDataset* dset = dcmff.getDataset();
dset->putAndInsertString(DCM_QueryRetrieveLevel, "PATIENT");
dset->putAndInsertString(DCM_PatientName, "*");
dset->putAndInsertString(DCM_SpecificCharacterSet, "ISO_IR 192");
Uint8 pc;
T_ASC_PresentationContextID presID = scu.findPresentationContextID(UID_VerificationSOPClass, UID_JPEGProcess1TransferSyntax);
if (presID == 0)
presID = scu.findPresentationContextID(UID_VerificationSOPClass, UID_LittleEndianImplicitTransferSyntax);
if (presID == 0)
presID = scu.findPresentationContextID(UID_VerificationSOPClass, UID_LittleEndianExplicitTransferSyntax);
if (presID == 0)
presID = scu.findPresentationContextID(UID_VerificationSOPClass, UID_BigEndianExplicitTransferSyntax);
OFList<QRResponse*> responses;
//查询
result = scu.sendFINDRequest(presID, dset, &responses);

if (result.good())
{
int asdasd = responses.size();
for (OFListIterator(QRResponse*) it = responses.begin(); it != responses.end(); ++it) {
QRResponse* response = *it;

// 获取DICOM数据集
DcmDataset* dataset = response->m_dataset;
if (dataset == nullptr)
{
continue;
}
// 从数据集中获取病人姓名
OFString patientName;
if (dataset->findAndGetOFString(DCM_PatientName, patientName).good()) {

// 处理病人姓名
std::cout << "Patient Name: " << patientName << std::endl;
}
// 可以继续从数据集中获取其他病人相关的信息
}
}

标签:UID,示例,ts,VerificationSOPClass,dset,DCMTK,presID,scu,find
From: https://www.cnblogs.com/QJZY/p/17846165.html

相关文章

  • ant design vue 1.x 和 3.x 自定义表单示例
    以下是项目中用到的自定义表单的写法,vue2vue3各记录一个。1.x(Forvue2)自定义表单的示例实现如下图的控件代码如下:import{Component,Prop,Vue,Watch}from'vue-property-decorator'import{Moment}from'moment'typeValue={left:Moment;right:Moment......
  • springboot中实现上传文件的功能简单示例
    在SpringBoot中实现文件上传可以通过以下步骤:配置文件上传相关的依赖:在项目的pom.xml文件中,添加以下依赖:<dependency>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-web</artifactId></dependency>创建文件上传接口:在......
  • C++与Lua交互之配置&交互原理&示例
    Lua简介Lua是一种轻量小巧的脚本语言,也是号称性能最高的脚本语言,它用C语言编写并以源代码形式开放。某些程序常常需要修改内容,而修改的内容不仅仅是数据,更要修改很多函数的行为。而修改函数行为这种事,很难用简单的更改数据的方式来实现,若在源代码层面上改又得重新编译生成,导......
  • 设计器demo示例数据库连接不上
    设计器demo示例数据库连接不上首先看下示例的 demo数据库是否启动。启动后可以看下左侧的控制台是否有错误,如果启动后链接还有问题,那么将设计器关闭,然后看下系统进程是否有重新连接。......
  • JAVA分批处理数据简单示例
    功能描述在处理业务时,经常遇到需要分批次处理数据的场景,例如有105条数据,每次推送20条,分批次推送最后不足20条数据时,一次性推送全部剩余数据DEMO示例packageshiguang.test;importjava.util.ArrayList;importjava.util.List;publicclassBatchProcessingExample{......
  • 通过PowerShellPlus示例脚本学习PowerShell-通过WIndows集成验证登录SQLServer
    ##=====================================================================##Title:Connect-MSSQL-IPWindowsAuth##Description:ConnecttoSQLServerusingIPaddress,instanceand##Windowsauthentication##Author:Idera......
  • Knative Eventing Parallel Flow 示例
    环境说明◼PingSource负责生成event◼Parallel中有两个Branch◆第一个分支接受时间为偶数的事件◆第二个分支接受时间为奇数的事件◼所有分支的最终结果均发往ksvc/event-display,内容格式化CloudEvent存储入日志创建名称空间#kubectlcreatensparallel-demo......
  • springboot 控制序列化反序列化示例(接口返回数据处理/接口接收数据处理)
    1.返回Long转JSONpackagecom.mingx.drone.config;importcom.fasterxml.jackson.core.JsonGenerator;importcom.fasterxml.jackson.databind.JsonSerializer;importcom.fasterxml.jackson.databind.SerializerProvider;importjava.io.IOException;/***@Descript......
  • Knative Eventing Sequence Flow 示例
    环境说明◼PingSource负责生成event◼Event由Sequence中的各Step顺次处理◆各Step都运行一个appender应用◆分别向收到的数据尾部附加自定义的专有数据项◼最终结果发往ksvc/event-display环境示意图创建名称空间#kubectlcreatenssequence-demonamespace/seq......
  • 深入了解Linux下的find命令
    在Linux系统中,find命令是一个强大的工具,用于在文件系统中查找文件和目录。它支持基于多种条件的搜索,并且可以执行各种操作。本文将深入探讨find命令的基本用法、常见选项以及一些高级用法,以帮助你更好地利用这个强大的工具。1.基本用法1.1.查找文件最基本的用法是按照文件名来......