c – 使用gdcm的“CompositeNetworkFunctions”进行DICOM C_MOVE

我试图使用gdcm的
CompositeNetworkFunctions从服务器获取DICOMS.

我的测试服务器使用“Orthanc”设置.

当我运行Move请求时,我得到:

terminate called after throwing an instance of 'gdcm::Exception'

what():/ home / mameame / Build / GDCM / Source / Source / Common / gdcmException.h:74():

当我发现Exception时,我发现它是一个“未处理的异常”,没有更多的信息.因此,我没有捕获它,而是使用gdb运行程序.这是我得到的:

0x00007ffff3e4dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff3e4dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff3e510d8 in __GI_abort () at abort.c:89
#2  0x00007ffff44526b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff4450836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff4450863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff4450aa2 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x0000000000781772 in std::istream& gdcm::DataSet::ReadWithLength<gdcm::ExplicitDataElement, gdcm::SwapperNoOp>(std::istream&, gdcm::VL&) ()
#7  0x00000000007cd268 in gdcm::network::PresentationDataValue::ConcatenatePDVBlobsAsExplicit(std::vector<gdcm::network::PresentationDataValue, std::allocator<gdcm::network::PresentationDataValue> > const&) ()
#8  0x00000000007d6af1 in gdcm::network::ULConnectionManager::RunEventLoop(gdcm::network::ULEvent&, gdcm::network::ULConnection*, gdcm::network::ULConnectionCallback*, bool const&) ()
#9  0x00000000007d5190 in gdcm::network::ULConnectionManager::RunMoveEventLoop(gdcm::network::ULEvent&, gdcm::network::ULConnectionCallback*) ()
#10 0x00000000007d4acf in gdcm::network::ULConnectionManager::SendMove(gdcm::BaseRootQuery const*, gdcm::network::ULConnectionCallback*) ()
#11 0x00000000007c1750 in gdcm::CompositeNetworkFunctions::CMove(char const*, unsigned short, gdcm::BaseRootQuery const*, unsigned short, char const*, char const*, char const*) ()
#12 0x0000000000666c5c in PACSCMove::run (this=0x25a9dd0) at /home/myname/Projects/Hiwi/Source/src/PACSCMove.cpp:67
#13 0x00007ffff4798384 in ?? () from /home/myname/Qt/5.4/gcc_64/lib/libQt5Core.so.5
#14 0x00007ffff70fa182 in start_thread (arg=0x7fffd8cf5700) at pthread_create.c:312
#15 0x00007ffff3f1147d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

这是我的代码:

mQuery.InitializeDataSet( mQueryLevel );
setSearchParameter( gdcm::Tag( 0x20, 0x000d ), studyUID.toStdString() );    // Study UID
setSearchParameter( gdcm::Tag( 0x20, 0x000e ), seriesUID.toStdString() );   // Series UID

std::cout << "New Move Query: " << mQuery.ValidateQuery(true) << std::endl;


mQuery.WriteQuery("MoveQuery.dcm");


bool res = gdcm::CompositeNetworkFunctions::CMove(
                "localhost", 4242,
                &mQuery,
                11110,
                "IMHOTEP",
                NULL,
                "/home/myname/TestPatient" );

mQueryLevel是gdcm :: eSeries

有趣的是,使用书面查询文件“MoveQuery.dcm”,我可以使用movescu下载文件:

movescu -v -p -aet IMHOTEP -od /home/myname/TestPatient/ --port 11110 localhost 4242 MoveQuery.dcm

我试过了:

> AET和CALL的不同值
>相对和绝对路径
>不同的端口(虽然不应该这样 – 毕竟我的movecu呼叫使用相同的端口!)
> mQuery目前的类型为gdcm :: MovePatientRootQuery,但我尝试过MoveStudyRootQuery,FindPatientRootQuery,FindStudyRootQuery
>在堆栈跟踪之后深入了解GDCM代码 – 但我不了解发生了什么
>也将“PatientID”的值添加到查询中,或仅提供“SeriesUID”(相同的结果)

在PatientID中也添加了查询,这里是MoveQuery.dcm的内容:

$dcmdump MoveQuery.dcm 

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Unknown Transfer Syntax

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0052) CS [SERIES]                                 #   6, 1 QueryRetrieveLevel
(0010,0020) LO [4589301]                                #   8, 1 PatientID
(0020,000d) UI [1.2.840.113619.2.55.1.1762893669.2104.1060778173.267] #  52, 1 StudyInstanceUID
(0020,000e) UI [1.2.840.113619.2.55.1.1762893669.2104.1060778173.271] #  52, 1 SeriesInstanceUID

最佳答案 C-GET服务在DICOM标准中没有退役. C-GET使用相同的连接从SCP检索图像,但C-MOVE使用并行连接,服务器将其角色切换到SCU(客户端),并尝试连接以移动目标AE(目标服务器).在这种情况下,您需要在您身边有一个DICOM监听器(SCP)来处理传入连接.

我想你是说Calling AE Title(C-Move服务请求者)是“IMHOTEP”,你应该有一个DICOM监听器监听端口“11110”.您正在请求远程AE“ORTHANC”(称为AE)将系列移动到C-Move Destination AE(这应该是您的“IMHOTEP”的DICOM侦听器(SCP)).

点赞