no FINDResponses class in scu.h of snapshot 3.6.1
Moderator: Moderator Team
no FINDResponses class in scu.h of snapshot 3.6.1
FINDResponses was a class defined in the dcmnet/scu.h of the official first release og 3.6.0 but sendMOVERequest wasnt.
As per the instructions at the end of howto, I used the snapshot 3.6.1 to include sendMOVERequest handler but there is no FINDResponses class in the new scu.h
So, the code on howto page is giving errors.
Suggestions please?
Thank You.
As per the instructions at the end of howto, I used the snapshot 3.6.1 to include sendMOVERequest handler but there is no FINDResponses class in the new scu.h
So, the code on howto page is giving errors.
Suggestions please?
Thank You.
-
- DCMTK Developer
- Posts: 2517
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Sir,
After reading and comparing the APIs of both scu.h, I guessed that much but the method numResults(), which was initially declared in the FINDResponses class is not available in the snapshot. What should I do to replace that method?
Also, is QRResponse class exactly analogous to FINDResponses class? I mean should I replace FINDResponses class declaration with QRResponse class in the code?
After reading and comparing the APIs of both scu.h, I guessed that much but the method numResults(), which was initially declared in the FINDResponses class is not available in the snapshot. What should I do to replace that method?
Also, is QRResponse class exactly analogous to FINDResponses class? I mean should I replace FINDResponses class declaration with QRResponse class in the code?
Mr. Riesmeier,
After reading and comparing the APIs of both scu.h, I guessed that much but the methods such as numResults(), which was initially declared in the FINDResponses class is not available in the snapshot. What should I do to replace those methods?
Also, is QRResponse class exactly analogous to FINDResponses class? I mean should I replace FINDResponses class declaration with QRResponse class in the code?
After reading and comparing the APIs of both scu.h, I guessed that much but the methods such as numResults(), which was initially declared in the FINDResponses class is not available in the snapshot. What should I do to replace those methods?
Also, is QRResponse class exactly analogous to FINDResponses class? I mean should I replace FINDResponses class declaration with QRResponse class in the code?
Hi Shaeto,
What i did is that I copied FINDResponse class declaration and definition in the snapshot's scu.h so that there shouldn't be any problem.
Main problem is that : last parameter of sendMOVERequest is of type OFList<QRResponse*> (in the snapshot scu.h), so I created an instance of this class and passed it to the sendMOVERequest method but every other thing in the code is referenced via FINDResponse instance.
Initially, the last parameter of sendMOVERequest is of type FINDResponses*. My problem is that although I created an instance of OFList<QRResponse*> type but this instance finds its utility only in the parameter (so as to avoid typecasting error) and nowhere. Will it work?
I am posting my code snippet for your better understanding. I just wanted to run that sample code of DCMScu.
What i did is that I copied FINDResponse class declaration and definition in the snapshot's scu.h so that there shouldn't be any problem.
Main problem is that : last parameter of sendMOVERequest is of type OFList<QRResponse*> (in the snapshot scu.h), so I created an instance of this class and passed it to the sendMOVERequest method but every other thing in the code is referenced via FINDResponse instance.
Initially, the last parameter of sendMOVERequest is of type FINDResponses*. My problem is that although I created an instance of OFList<QRResponse*> type but this instance finds its utility only in the parameter (so as to avoid typecasting error) and nowhere. Will it work?
I am posting my code snippet for your better understanding. I just wanted to run that sample code of DCMScu.
Code: Select all
/* Assemble and send C-FIND request */
FINDResponses findResponses;
OFList<QRResponse*> qrresponse;
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, &qrresponse);
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
OFList<RetrieveResponse*> retrieveResponses;
// 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, &retrieveResponses);
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;
}
hmmm
actually i don't see FINDResponses class in last snapshot, so, you have to use OFList, for example:
....
OFList<QRResponse*> qrresponse;
......
result = scu.sendFINDRequest(presID, &req, &qrresponse);
if (result.good()) {
// get real number of c-find responses
int num = qrresponse.size();
// now iterate
OFListIterator(OFList<QRResponse*>) first = qrresponse.begin();
OFListIterator(OFList<QRResponse*>) last = qrresponse.end();
while (first != last) {
........
first++;
}
}
....
actually i don't see FINDResponses class in last snapshot, so, you have to use OFList, for example:
....
OFList<QRResponse*> qrresponse;
......
result = scu.sendFINDRequest(presID, &req, &qrresponse);
if (result.good()) {
// get real number of c-find responses
int num = qrresponse.size();
// now iterate
OFListIterator(OFList<QRResponse*>) first = qrresponse.begin();
OFListIterator(OFList<QRResponse*>) last = qrresponse.end();
while (first != last) {
........
first++;
}
}
....
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi,
I will modify the example within the next days so it fits the current code. Sorry for the inconenience -- since the SCU class is or was pretty new and was extended over time, some design decisions were re-considered from practical experience of DCMTK users and the DCMTK team. I will notify in the forum when the example is fixed. Thanks for helping other users, Shaeto.
Best,
Michael
I will modify the example within the next days so it fits the current code. Sorry for the inconenience -- since the SCU class is or was pretty new and was extended over time, some design decisions were re-considered from practical experience of DCMTK users and the DCMTK team. I will notify in the forum when the example is fixed. Thanks for helping other users, Shaeto.
Best,
Michael
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hey,
FYI: I just fixed the DcmSCU example in the howto section. Hope it works for you.
Best regards,
Michael
FYI: I just fixed the DcmSCU example in the howto section. Hope it works for you.
Best regards,
Michael
Who is online
Users browsing this forum: Google [Bot] and 0 guests