Hello everybody,
I trying to connect my new application to PACS Network.
I found this code :
Code:
connection(QString qipAdress, QString qport, QString qaet)
{
T_ASC_Network *net; // network struct, contains DICOM upper layer FSM etc.
//ASC_initializeNetwork(NET_REQUESTOR, 0, 1000 /* timeout */, &net);
ASC_initializeNetwork(NET_REQUESTOR, 104, 1000, &net);
T_ASC_Parameters *params; // parameters of association request
ASC_createAssociationParameters(¶ms, ASC_DEFAULTMAXPDU);
// set calling and called AE titles
ASC_setAPTitles(params, "ECHOSCU", "ANY-SCP", NULL);
// the DICOM server accepts connections at server.nowhere.com port 104
QString XXX = "server.nowhere.com:"+qport;
ASC_setPresentationAddresses(params, qipAdress, XXX);
// list of transfer syntaxes, only a single entry here
const char* ts[] = { UID_LittleEndianImplicitTransferSyntax };
// add presentation context to association request
ASC_addPresentationContext(params, 1, UID_VerificationSOPClass, ts, 1);
// request DICOM association
T_ASC_Association *assoc;
if (ASC_requestAssociation(net, params, &assoc).good())
{
QMessageBox::information(0,"","Parametre ok");
if (ASC_countAcceptedPresentationContexts(params) == 1)
{
QMessageBox::information(0,"","Connexion ok");
// the remote SCP has accepted the Verification Service Class
DIC_US id = assoc->nextMsgID++; // generate next message ID
DIC_US status; // DIMSE status of C-ECHO-RSP will be stored here
DcmDataset *sd = NULL; // status detail will be stored here
// send C-ECHO-RQ and handle response
DIMSE_echoUser(assoc, id, DIMSE_BLOCKING, 0, &status, &sd);
delete sd; // we don't care about status detail
}
}
ASC_releaseAssociation(assoc); // release association
ASC_destroyAssociation(&assoc); // delete assoc structure
ASC_dropNetwork(&net); // delete net structure
return 0;
}
But I do not understand it.
What is "server.nowhere.com" ???
I suppose that I need to give who I am and where I want to be connected. So, in my example, "server.nowhere.com" could be qipAdress and qipAdress could be my ip adress ? Isn't it ?
--------
And (AFTER), with this code, how I can ask some question to the server and download some Dicom pictures ??