Hello,
I did not yet try to set a VOI window, but i'll try as soon as I finished the Query/Retrieve part.
I have two questions :
The first is related to storescp and SCP in general.
I built storescp as a shared library for Android, and used the
dcmscu example to send move requests. It works, but the problem is that I cannot stop the server once I retrieved the study. It results in a background thread that I cannot stop properly.
I would like to start the server each time I want to retrieve a study, but with different parameters (port, output directory).
Is it possible to stop the storeSCP after retrieving a study, for instance using option --exec-on-eostudy ?
I also wanted to implement a c-get request. However it does not work. Here is my code :
--------------
Get.cpp
--------------
Code:
//init scu and JNI stuff...
scu.setACSETimeout(5);
scu.setPacs(jHost, jPort, jPeerAeTitle, jCallingAeTitle);
OFList<OFString> ts;
ts.push_back(UID_LittleEndianExplicitTransferSyntax);
ts.push_back(UID_BigEndianExplicitTransferSyntax);
ts.push_back(UID_LittleEndianImplicitTransferSyntax);
scu.addPresentationContext(UID_GETStudyRootQueryRetrieveInformationModel, ts);
scu.addPresentationContext(UID_VerificationSOPClass, ts);
OFCondition result = scu.initNetwork();
if (result.bad())
{
scu.setLastError(result.text());
scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
return 1;
}
result = scu.negotiateAssociation();
if (result.bad())
{
OFString s("Unable to negotiate association: ");
scu.setLastError(s + result.text());
scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
return 2;
}
T_ASC_PresentationContextID presID = scu.findUncompressedPC(UID_GETStudyRootQueryRetrieveInformationModel);
if (presID == 0)
{
scu.setLastError("There is no uncompressed presentation context for Study Root FIND");
return 3;
}
OFString storageDir = env->GetStringUTFChars(jStorageDir, NULL);
scu.setStorageDir(storageDir);
OFString uid = env->GetStringUTFChars(jUid, NULL);
DcmDataset *req = new DcmDataset;
req->putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "SERIES");
LOGI("%s", uid.c_str());
req->putAndInsertOFStringArray(DCM_SeriesInstanceUID, uid, true);
OFList<RetrieveResponse *> responses;
result = scu.sendCGETRequest(presID, req, &responses);
if (result.bad())
{
scu.setLastError("C-GET request failed");
return 4;
}
scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
return 0;
}
-------
DicomSCU.cpp
The DicomSCU class inherits
DcmSCU
-------
Code:
OFCondition DicomSCU::handleCGETResponse(const T_ASC_PresentationContextID presID,
RetrieveResponse *response,
OFBool &continueCGETSession)
{
LOGI("%s", response->m_affectedSOPClassUID.c_str());
LOGI("Failed : %d", response->m_numberOfFailedSubops);
LOGI("Completed : %d", response->m_numberOfCompletedSubops);
LOGI("Remaining : %d", response->m_numberOfRemainingSubops);
return
DcmSCU::handleCGETResponse(presID, response, continueCGETSession);
}
LOGI refers to Android Log.
The output is :
Failed : 22
Completed : 0
Remaining : 0
The study I want to retrieve has effectively 22 elements, however the single C-GET response tell me it failed.
How to solve it ? Is it due to a bad presentation context?
Could you provide a C-GET example?
Thanks by Advance