DCMTK DCMSCU例子
转载:http://forum.dcmtk.org/viewtopic.php?f=1&t=2812&hilit=DCMNET
?
Go to page?1AuthorMessage?Post subject:?connect to PACS system biginner question
Posted:?Wed, 2011-01-26, 13:57?
?????Post subject:
Posted:?Wed, 2011-01-26, 14:59?
?????Post subject:
Posted:?Wed, 2011-01-26, 15:03?
?????Post subject:
Posted:?Wed, 2011-01-26, 15:33?
?????Post subject:
Posted:?Thu, 2011-01-27, 09:12?
?????Post subject:
Posted:?Thu, 2011-01-27, 11:49?
Best regards,?
Michael
?????Post subject:Posted:?Thu, 2011-01-27, 11:59?
Best regards,
Michael
how can I do that in xcode , there're no direct compiler flag?
there're?
OpenMP linker flags?
other linker flags?
symbol ordering flags?
warning linker flag?
I tried add it to other linker flags , but the same error appeared?
I tried also to add?
#undef verifty?
#define INCLUDE_CSTDIO?
#include <dcmtk/config/osconfig.h>?
#include <dcmtk/dcmimgle/dcmimage.h>?
but the error /DCMTK_BINARY/include/dcmtk/ofstd/ofstream.h:80:0 /DCMTK_BINARY/include/dcmtk/ofstd/ofstream.h:80:2: error: #error DCMTK needs stringstream or strstream type?
still appear in ofstream.h?
#include <iostream.h>?
#include <fstream.h>?
// For old STREAMS library: preference for strstream?
#if defined(HAVE_STRSTREA_H) || defined(HAVE_STRSTREAM_H)?
#ifdef HAVE_STRSTREA_H?
#include <strstrea.h>?
#else?
#include <strstream.h>?
#endif?
#elif defined(HAVE_SSTREAM_H)?
#include <sstream.h>?
#define USE_STRINGSTREAM?
#else?
#error DCMTK needs stringstream or strstream type?
#endif?
#include <iomanip.h>
?????Post subject:Posted:?Thu, 2011-01-27, 12:10?
?????Post subject:
Posted:?Thu, 2011-01-27, 12:34?
?????Post subject:
Posted:?Thu, 2011-01-27, 12:38?
?????Post subject:
Posted:?Thu, 2011-01-27, 13:30?
?????Post subject:
Posted:?Thu, 2011-01-27, 13:51?
?????Post subject:
Posted:?Thu, 2011-01-27, 13:57?
?????Post subject:
Posted:?Thu, 2011-01-27, 14:54?
?????Post subject:
Posted:?Thu, 2011-01-27, 14:57?
????
?
Go to page?1
DICOM @ OFFIS?Logout [ qimo601 ]??FAQ?? ?
?Search? ?
?Members? ?
?User Control Panel
?
Go to page?Previous??1AuthorMessage?Post subject:
Posted:?Thu, 2011-01-27, 16:43?
?????Post subject:
Posted:?Sat, 2011-03-19, 19:12?
?????Post subject:
Posted:?Mon, 2011-03-21, 11:07?
?????Post subject:
Posted:?Mon, 2011-03-21, 15:30?
?????Post subject:
Posted:?Mon, 2011-05-16, 20:04?
? ? return 2;
? }
??
? // Negotiate association
? result = scu.negotiateAssociation();
? if (result.bad())
? {
? ? std::cerr << "Error negotiating association: " << result.text() << "\n";
? ? return 2;
? }
??
? // Issue ECHO request and let scu find presentation context itself (0)
? result = scu.sendECHORequest(0);
? if (result.bad())
? {
? ? std::cerr << "Error issuing ECHO request or received rejecting response: " << result.text() << "\n";
? ? return 2;
? }
? std::cout << "Successfully sent DICOM Echo to host " << host << " on port " << port << "\n";
? return 0;
}
with this import :?#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
#include "dcmtk/?????Post subject:Posted:?Mon, 2011-05-23, 10:24?
?????Post subject:
Posted:?Mon, 2011-05-23, 16:50?
?????Post subject:
Posted:?Wed, 2011-05-25, 13:03?
?????Post subject:
Posted:?Wed, 2011-05-25, 16:44?
?????Post subject:
Posted:?Wed, 2011-05-25, 17:14?
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 on peer machine
#define PEERPORT 11112
// application entity title of the peer machine
#define PEERAPPLICATIONTITLE "MOVESCP"
// MOVE target 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)
? ? scu.findPresentationContextID(sopClass, UID_BigEndianExplicitTransferSyntax);
? if (pc == 0)
? ? 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 */
? FINDResponses 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.numResults() << " 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(FINDResponse*) study = findResponses.begin();
? Uint32 studyCount = 1;
? OFBool failed = OFFalse;
? while (study != findResponses.end() && result.good())
? {
? ? // Every loop run will get all image for a specific study
? ? MOVEResponses moveResponses;
? ? // 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, &moveResponses);
? ? ? ? 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());
? }
? /* Release association */
? scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
? return 0;
}
P.S: The header file would be trivial:?
?????Post subject:?Can't find the method scu.sendMOVERequestPosted:?Sun, 2011-07-24, 05:17?
Thanks in advance?
with regards?
Manoj Kumar D?????Post subject:Posted:?Tue, 2011-07-26, 11:54?
I recommend you to use the?lastest snapshot.?
MIchael
?????Post subject:Posted:?Thu, 2011-08-04, 23:49?
?
But on this way - i wanna say thank you for the example and the dcmtk code.??
Thank you
?????Post subject:Posted:?Fri, 2011-08-05, 12:05?
?????Post subject:?Getting Will not wait for further C-MOVE responses
Posted:?Fri, 2011-08-12, 17:42?
Please help me out I m a beginner for PACS Server.?
Thanx in advance.?????
Go to page?Previous??1
DICOM @ OFFIS?Logout [ qimo601 ]??FAQ?? ?
?Search? ?
?Members? ?
?User Control Panel
?
Go to page?Previous??1AuthorMessage?Post subject:
Posted:?Mon, 2011-08-15, 09:14?
????