我正在尝试使用gdcm的CompositeNetworkFunctions从服务器获取DICOMS。
我的测试服务器是使用“Orthanc”设置的。
当我运行Move请求时,我得到:
terminate called after throwing an instance of 'gdcm::Exception'
what():/home/myname/Builds/GDCM/Source/Source/Common/gdcmException.h:74():
当我捕获到该异常时,我发现它是“未处理的异常”,没有更多信息。因此,我没有捕获它,而是使用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
我试过了:
将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)来处理传入的连接。
我认为您说的是调用AE标题(C移动服务请求者)是“IMHOTEP”,并且您应该有一个DICOM侦听器在端口“11110”上侦听。您正在请求远程AE“ORTHANC”(称为AE)将系列移动到C移动目标AE(这应该是您的侧面DICOM侦听器(SCP),即“IMHOTEP”)。