Hi I'am a newbie with DCMTK and I'm writing a small application that deals to send DICOM file using DCMTK libraries.
At this moment, I load the file in memory usinf dcm.loadFile(), but how can I do to send it?
I have tried to network example or tutorial, and I also
compiled ECHOSCU example but I have no idea for what I have to write.
DcmFileFormat dcm;
OFCondition cond;
cond = dcm.loadFile("/Users/Nicolo/DICOM_TESTFILE.dcm"); //dcm contains the dicom file
if (cond.bad()) {
printf("%s\n", cond.text());
} else {
std::cout << "DICOM load status: " << cond.text() << endl;
}
T_ASC_Network *net;
ASC_initializeNetwork(NET_REQUESTOR, 0, 1000 /* timeout */, &net);
T_ASC_Parameters *params;
ASC_createAssociationParameters(¶ms, ASC_DEFAULTMAXPDU);
ASC_setAPTitles(params, "STORESCU", "NICO", NULL);
ASC_setPresentationAddresses(params, "157.27.31.90", "157.27.31.90:11112");
const char* ts[] = { UID_LittleEndianImplicitTransferSyntax };
ASC_addPresentationContext(params, 1, UID_VerificationSOPClass, ts, 1);
T_ASC_Association *assoc;
if (ASC_requestAssociation(net, params, &assoc).good()){
if (ASC_countAcceptedPresentationContexts(params) == 1){
DIC_US id = assoc->nextMsgID++; // generate next message ID
DIC_US status;
DcmDataset *sd = NULL;
DIMSE_echoUser(assoc, id, DIMSE_BLOCKING, 0, &status, &sd);
delete sd;
}
}
ASC_releaseAssociation(assoc);
ASC_destroyAssociation(&assoc);
ASC_dropNetwork(&net);
Thank you a lot for your help!!
Help to send DICOM file
Moderator: Moderator Team
Hi,
You are looking at the wrong example I think. You have to look at StoreSCU instead. I'm trying to learn this also.
What I did was to trace through the entire program to pick out the parts that I need. Perhaps you can refer to this thread:
viewtopic.php?p=5670&highlight=#5670
You are looking at the wrong example I think. You have to look at StoreSCU instead. I'm trying to learn this also.
What I did was to trace through the entire program to pick out the parts that I need. Perhaps you can refer to this thread:
viewtopic.php?p=5670&highlight=#5670
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
-
- Posts: 4
- Joined: Mon, 2008-09-08, 21:24
Who is online
Users browsing this forum: Google [Bot] and 1 guest