Parcourir la source

ENH support connection to DCM4CHEE pacs which requires specification of
the peer ATTitle.

The following now works, for example:

$ ./CTK-build/bin/ctkDICOMDemoSCU 174.129.38.17 11112 MI2B2
I: Requesting Association
I: Association Accepted (Max Send PDV: 16340
Successfully sent DICOM Echo to host 174.129.38.17 on port 11112

which should correspond to:

echoscu 174.129.38.17 11112 -aec MI2B2

using dcmtk tools.

Steve Pieper il y a 14 ans
Parent
commit
60457e4380
1 fichiers modifiés avec 13 ajouts et 3 suppressions
  1. 13 3
      Applications/ctkDICOMDemoSCU/ctkDICOMDemoSCUMain.cpp

+ 13 - 3
Applications/ctkDICOMDemoSCU/ctkDICOMDemoSCUMain.cpp

@@ -29,8 +29,9 @@
 void print_usage()
 {
   std::cerr << "Usage: \n";
-  std::cerr << "  ctkDICOMDemoSCU peer port\n";
+  std::cerr << "  ctkDICOMDemoSCU peer port [peerAETitle]\n";
   std::cerr << "     Issues ECHO request to the given host and given port.\n"; 
+  std::cerr << "     Optional peerAETitle tells what application entity to address.\n"; 
   return;
 }
 
@@ -45,10 +46,15 @@ int main(int argc, char** argv)
   
   std::string host = argv[1];
   unsigned int port = atoi(argv[2]);
-  
+  std::string peerAET  = "";
+  if (argc > 3)
+  {
+    peerAET = argv[3];
+  }
+    
   // Setup SCU
   DcmSCU scu;
-  scu.setPeerHostName(OFString(host.c_str()));
+  scu.setPeerHostName(host);
   scu.setPeerPort(port);
   OFString verificationSOP = UID_VerificationSOPClass;
   OFList<OFString> ts;
@@ -56,6 +62,10 @@ int main(int argc, char** argv)
   ts.push_back(UID_BigEndianExplicitTransferSyntax);  
   ts.push_back(UID_LittleEndianImplicitTransferSyntax);
   scu.addPresentationContext(verificationSOP, ts);
+  if (peerAET != "")
+  {
+    scu.setPeerAETitle(peerAET);
+  }
   OFCondition result = scu.initNetwork();
   if (result.bad())
   {