After C-Move operation successful ?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

After C-Move operation successful ?

#1 Post by tariq2305 »

I think I am missing theoretical concept of using dcmtk.

After successful sending C-Echo request and C-Find. I have called send MOVE request.

Console Response:

Code: Select all

D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type                  : C-MOVE RSP
D: Presentation Context ID       : 3
D: Message ID Being Responded To : 3
D: Affected SOP Class UID        : MOVEStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations       : none
D: Completed Suboperations       : 224
D: Failed Suboperations          : 0
D: Warning Suboperations         : 0
D: Data Set                      : none
D: DIMSE Status                  : 0x0000: Success
D: ======================= END DIMSE MESSAGE =======================
D: Handling C-MOVE Response
D: Received final C-MOVE response, no more C-MOVE responses expected

So here I can see my C-Move operation is successful. What is the next step I have to apply so that I can fetch DICOM images ?

Please help!!!

Roadrunner
Posts: 56
Joined: Mon, 2010-06-14, 16:41

Re: After C-Move operation successful ?

#2 Post by Roadrunner »

You should start or have already started a storescp which receives the the images.

There is a storescp example which receives the images and save it.
viewtopic.php?f=1&t=3213&p=12722#p12722


Frank

tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

Re: After C-Move operation successful ?

#3 Post by tariq2305 »

Hi!
I want to download all the images of a series.
But I am stuck in creating the dataset for sending the image download request. I don't know what tags/parameters , i have to set for downloading the images. Here is my code:

Code: Select all

    
OFList<QRResponse*> OFfindResponses; 
    
    DcmDataset req; 
    req.putAndInsertOFStringArray ( DCM_QueryRetrieveLevel, "IMAGE"); 
    req.putAndInsertOFStringArray ( DCM_SeriesInstanceUID, "1.2.840.113747.1078798801.1964.3000.1762082110160.0");
    req.putAndInsertOFStringArray ( DCM_StudyInstanceUID, "1.3.12.2.1107.5.2.12.21264.4.0.8969333128827685" );
    req.putAndInsertOFStringArray ( DCM_PatientID, "7Q6,^71" );
    req.putAndInsertOFStringArray ( DCM_SOPInstanceUID, "");
     
    T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, scu); 
    if (presID == 0) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
    } 
    result = scu.sendFINDRequest(presID, &req, &OFfindResponses); 
    if (result.bad()) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
        
    } 
    else 
    { 
        
    } 
    presID = findUncompressedPC(UID_MOVEStudyRootQueryRetrieveInformationModel, scu); 
    if (presID == 0) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
        
    } 
    OFListIterator(QRResponse*) instance = OFfindResponses.begin(); 
    Uint32 instanceCount = 1; 
    OFBool failed = OFFalse; 
    while (instance != OFfindResponses.end() && result.good()) 
    { 
        OFList<RetrieveResponse*> moveResponses;       //MOVEResponses moveResponses; 
        if ( (*instance)->m_dataset != NULL) //Il faut etre certain que ce n'est pas la derniere réponse, elle ne contient pas d'information 
        { 
            OFString imageID;
            result = (*instance)->m_dataset->findAndGetOFStringArray(DCM_SOPInstanceUID, imageID);
            
            // only try to get study if we actually have study instance uid, otherwise skip it 
           
            if (result.good()) 
            { 
                //      [NSThread detachNewThreadSelector:@selector(launchStoreSCP) toTarget:self withObject:nil];

                req.putAndInsertOFStringArray(DCM_SOPInstanceUID, imageID); 
                // fetches all images of this particular study 
                OFString OFmonAet = OFmonAet; 
                result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, NULL 
                                             // we are not interested into responses
                                             ); 
                
                if (result.good()) 
                { 
                    DCMNET_INFO("Received Image  #" << std::setw(7) << instanceCount << ": " << imageID);
                    instanceCount++;      
                } 
            } 
        } 
        instance++; 
    } 
Can anyone suggest me the exact tags/parameters to be set for image downloading ?

omarelgazzar
Posts: 101
Joined: Wed, 2009-07-08, 16:06
Location: Oldenburg, Germany

Re: After C-Move operation successful ?

#4 Post by omarelgazzar »

DcmDataset req;
req.putAndInsertOFStringArray ( DCM_QueryRetrieveLevel, "IMAGE");
req.putAndInsertOFStringArray ( DCM_SeriesInstanceUID, "1.2.840.113747.1078798801.1964.3000.1762082110160.0");
req.putAndInsertOFStringArray ( DCM_StudyInstanceUID, "1.3.12.2.1107.5.2.12.21264.4.0.8969333128827685" );
req.putAndInsertOFStringArray ( DCM_PatientID, "7Q6,^71" );
req.putAndInsertOFStringArray ( DCM_SOPInstanceUID, "");
This request dataset can be used to download list of images if you provide list of SOP instance UIDs to be downloaded in the unique key attribute DCM_SOPInstanceUID. The only difference between C-Find request dataset and C-Move request dataset is that in C-Move request dataset, you should be able to provide specific values for unique key attributes patient id, Study Instance UIDs, Series Instance UIDs and SOP Instance UIDs down to the level of query/retrieve.

Best Regards,
Omar

tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

Re: After C-Move operation successful ?

#5 Post by tariq2305 »

Hi Omar!
Thanks for your reply.
But, I am doing the same thing what u have suggested. After getting the DCM_SOPInstanceUID through C-Find request, I am providing the same DCM_SOPInstanceUID for c-move request through the code :

Code: Select all

OFString imageID;
            result = (*instance)->m_dataset->findAndGetOFStringArray(DCM_SOPInstanceUID, imageID);
            if (result.good()) 
            { 
                req.putAndInsertOFStringArray(DCM_SOPInstanceUID, imageID); 
                result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, NULL 
                                             // we are not interested into responses
                                             ); 
                if (result.good()) 
                { 
                    DCMNET_INFO("Received Image  #" << std::setw(7) << instanceCount << ": " << imageID);
                    instanceCount++;      
                } 
As output, it shows the status of move response is successful.
One more thing, I am running the code viewtopic.php?f=1&t=3213&p=12722#p12722 for receiving C-StoreRequests, saving files and sending the C-StoreResponse in background thread using the same MOVEAPPLICATIONTITLE and port.
But it's handleincomingrequest method is not being called.
I am little bit confused about whether I should use the same port or not for receiving C-StoreRequests.

omarelgazzar
Posts: 101
Joined: Wed, 2009-07-08, 16:06
Location: Oldenburg, Germany

Re: After C-Move operation successful ?

#6 Post by omarelgazzar »

Hello,
You should specify the application entity title (AET) to which you wish to store the images in the sendMoveRequest() using the parameter "moveDestinationAETitle". The SCP should be configured to associate this AET to a certain host (port, ip address) to initiate store request. You should use storescp to listen for incoming connections on the port number you used to configure the MOVE SCP. The port used for receiving store requests should be a different port from the one used for move request.

tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

Re: After C-Move operation successful ?

#7 Post by tariq2305 »

Hi Omar!
Thanks for reply.
I have done same thing . but still images are not being downloaded.
This is the complete code.

Code: Select all


@implementation SITViewController

static Uint8 findUncompressedPC(const OFString& sopClass, 
                                DcmSCU& scu) 
{ 
    Uint8 pc; 
    pc = scu.findPresentationContextID(sopClass, UID_LittleEndianExplicitTransferSyntax); 
    if (pc == 0) 
        pc = scu.findPresentationContextID(sopClass, UID_BigEndianExplicitTransferSyntax); 
    if (pc == 0) 
        pc = scu.findPresentationContextID(sopClass, UID_LittleEndianImplicitTransferSyntax); 
     
    return pc; 
} 

 
 - (void)viewDidLoad
 {
 [super viewDidLoad];
 // Do any additional setup after loading the view, typically from a nib.
 
 NSMutableArray *tempArray   = [[NSMutableArray alloc]init];
 self.resultArray            = tempArray;
 [tempArray release];
     [self performSelectorInBackground:@selector(startStoreSCP) withObject:nil];
     [self performSelector:@selector(downloadImage) withObject:nil afterDelay:10];
}


-(void)startStoreSCP
{
       // DicomEmpfangen *scp; // put this in a headerfile if you use a class and not a main!
        scp = new DicomEmpfangen();
        scp->setPort(USERPEERPORT);
        scp->setAETitle(MOVEAPPLICATIONTITLE);
      
    NSString *pathname = [[NSBundle mainBundle] pathForResource:@"storescp" ofType:@"cfg"] ;
    const OFString path = (char * )[pathname UTF8String];
    if (scp->loadAssociationCfgFile(path).good())
        {
            NSLog(@"SCP-Config-File gefunden :-)");
            NSLog(@"dime-timeout: %@", scp->getDIMSETimeout());
            if (scp->setAndCheckAssociationProfile("Default").good())
            {
                NSLog(@"listen gestartet um");
                
                scp->setDIMSETimeout(ULONG_MAX);
                scp->setDIMSEBlockingMode(DIMSE_NONBLOCKING);
                
                if (scp->getDIMSEBlockingMode() == DIMSE_NONBLOCKING )
                {
                    NSLog(@"scp is in non-blocking mode: ");
                    scp->setConnnectionTimeout(ULONG_MAX);
                    if (scp->getDIMSEBlockingMode() == DIMSE_BLOCKING )
                        NSLog(@"2nd try: scp is in blocking mode: ");
                    else NSLog(@"scp is still in non-blocking mode: ");
                }
                else {
                    NSLog(@"scp is in blocking mode: ");
                }
                
                if (scp->listen().bad())
                {
                    NSLog(@"error during listening!");
                }
                //NSLog(@"listen stops at: " << QTime::currentTime();
                NSLog(@"listen stops at: ");
            }
        }
        else
            NSLog(@"SCP-Config file not found :-(");
}

-(void) downloadImage
{
    // Setup DICOM connection parameters  
    OFLog::configure(OFLogger::DEBUG_LOG_LEVEL); 
    DcmSCU scu; 
    // set AE titles 
    scu.setAETitle(APPLICATIONTITLE); //calling Application Entity title
    //scu.setAETitle(MOVEAPPLICATIONTITLE); //calling Application Entity title
    scu.setPeerHostName(PEERHOSTNAME); 
    scu.setPeerPort(PEERPORT); 
    scu.setPeerAETitle(PEERAPPLICATIONTITLE); //called Application Entity title
    // 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);
    
    //ts.push_back(UID_JPEGLSLosslessTransferSyntax);
    
    scu.addPresentationContext(UID_FINDStudyRootQueryRetrieveInformationModel, ts); 
    scu.addPresentationContext(UID_MOVEStudyRootQueryRetrieveInformationModel, ts); 
    
     //scu.addPresentationContext(UID_GETStudyRootQueryRetrieveInformationModel, ts); 
     //ts.push_back(UID_JPEGLSLosslessTransferSyntax);
    scu.addPresentationContext(UID_VerificationSOPClass, ts); 
    
    // scu.addPresentationContext(UID_SecondaryCaptureImageStorage, ts); 
    // ts.push_back(UID_JPEG2000TransferSyntax); 
    
    // Initialize network  
    
    OFCondition result = scu.initNetwork(); 
    if (result.bad()) 
    { 
        DCMNET_ERROR("Unable to set up the network: " << result.text()); 
        return ; 
    } 
    
    // Negotiate Association  
    result = scu.negotiateAssociation(); 
    if (result.bad()) 
    { 
        DCMNET_ERROR("Unable to negotiate association: " << result.text()); 
        return ; 
    } 
    
    // 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 ; 
    } 
    
    
    //Construction et envoi d'une requete C-FIND, pour trouver les examens 
    //FINDResponses findResponses; 
    OFList<QRResponse*> OFfindResponses; 
    
    DcmDataset req; 
    req.putAndInsertOFStringArray ( DCM_QueryRetrieveLevel, "IMAGE"); 
    req.putAndInsertOFStringArray ( DCM_SeriesInstanceUID, "1.2.840.113747.1078798801.1964.3000.1762082110160.0");
    req.putAndInsertOFStringArray ( DCM_StudyInstanceUID, "1.3.12.2.1107.5.2.12.21264.4.0.8969333128827685" );
    req.putAndInsertOFStringArray ( DCM_PatientID, "7Q6,^71" );
    req.putAndInsertOFStringArray ( DCM_SOPInstanceUID, "1.2.840.113747.1078798801.1964.3000.1762082110160.6");
  
    //CONSTRUCTION DE LA REQUETE 
    //Avec les numéro ID des series selectionnées 
    //  OFString OFNumeroIDStudy = OFNumeroIDStudy; 
    // req.putAndInsertOFStringArray(DCM_StudyInstanceUID, OFNumeroIDStudy); 
    
    T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, scu); 
    //  presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, scuN); 
    if (presID == 0) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
    } 
    result = scu.sendFINDRequest(presID, &req, &OFfindResponses); 
    if (result.bad()) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
        
    } 
    else 
    { 
        
    } 
    presID = findUncompressedPC(UID_MOVEStudyRootQueryRetrieveInformationModel, scu); 
    if (presID == 0) 
    {
        DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND"); 
        return ; 
    } 
    OFListIterator(QRResponse*) instance = OFfindResponses.begin(); 
    Uint32 instanceCount = 1; 
    OFBool failed = OFFalse; 
    while (instance != OFfindResponses.end() && result.good()) 
    { 
        // Pour chaque boucle en réponse, soit chaque examen, toutes les images seront récupérées 
        OFList<RetrieveResponse*> moveResponses;       //MOVEResponses moveResponses; 
        if ( (*instance)->m_dataset != NULL) //Il faut etre certain que ce n'est pas la derniere réponse, elle ne contient pas d'information 
        { 
            OFString imageID;
            result = (*instance)->m_dataset->findAndGetOFStringArray(DCM_SOPInstanceUID, imageID);
             if (result.good()) 
            { 
                    OFString OFmonAet = OFmonAet; 
                  ts.push_back(UID_JPEGLSLosslessTransferSyntax);                           
                scu.addPresentationContext(UID_MOVEStudyRootQueryRetrieveInformationModel, ts); 
                 result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, &moveResponses);                
                if (result.good()) 
                { 
                    DCMNET_INFO("Received Image  #" << std::setw(7) << instanceCount << ": " << imageID);
                    instanceCount++;      
                    
                } 
            } 
        } 
        instance++; 
    } 
    
    if (result.bad()) 
    { 
        DCMNET_ERROR("Unable to retrieve all studies: " << result.text()); 
    }
    while (!OFfindResponses.empty())
    {
        delete OFfindResponses.front();
        OFfindResponses.pop_front();
    }
    scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION); 
 
}


and its output is like this :
2012-05-29 12:23:28.260 PACS Cam[14022:4a03] SCP-Config-File gefunden :-)
2012-05-29 12:23:28.261 PACS Cam[14022:4a03] dime-timeout: (null)
2012-05-29 12:23:28.265 PACS Cam[14022:4a03] listen gestartet um
2012-05-29 12:23:28.265 PACS Cam[14022:4a03] scp is in non-blocking mode:
2012-05-29 12:23:28.266 PACS Cam[14022:4a03] scp is still in non-blocking mode:
....
..
...
...

===================== OUTGOING DIMSE MESSAGE ====================
D: Message Type : C-MOVE RQ
D: Presentation Context ID : 3
D: Message ID : 3
D: Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel
D: Data Set : present
D: Priority : low
D: Move Destination : PACS
D: -----------------------------------------------------------------
D: # Dicom-Data-Set
D: # Used TransferSyntax: Little Endian Explicit
D: (0008,0018) UI [1.2.840.113747.1078798801.1964.3000.1762082110160.6======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-MOVE Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type : C-MOVE RSP
D: Presentation Context ID : 3
D: Message ID Being Responded To : 3
D: Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations : 0
D: Completed Suboperations : 1
D: Failed Suboperations : 0
D: Warning Suboperations : 0
D: Data Set : none
D: DIMSE Status : 0xff00: Pending
D: ======================= END DIMSE MESSAGE =======================
D: Handling C-MOVE Response
D: One or more pending C-MOVE responses
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-MOVE Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type : C-MOVE RSP
D: Presentation Context ID : 3
D: Message ID Being Responded To : 3
D: Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations : none
D: Completed Suboperations : 1
D: Failed Suboperations : 0
D: Warning Suboperations : 0
D: Data Set : none
D: DIMSE Status : 0x0000: Success
D: ======================= END DIMSE MESSAGE =======================
D: Handling C-MOVE Response
D: Received final C-MOVE response, no more C-MOVE responses expected
I: Received Image # 1: 1.2.840.113747.1078798801.1964.3000.1762082110160.6
I: Releasing Association



Can u plz tell what are the mistakes which I am doing here ?

omarelgazzar
Posts: 101
Joined: Wed, 2009-07-08, 16:06
Location: Oldenburg, Germany

Re: After C-Move operation successful ?

#8 Post by omarelgazzar »

Did you try to listen for incoming connections using storescp on the port you specified for the PACS?

tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

Re: After C-Move operation successful ?

#9 Post by tariq2305 »

Hi Omar!
Yaah, I am listening for incoming connection by calling startStoreSCP() method in background thread in viewdidload().
startStoreSCP() method is like this:

Code: Select all

-(void)startStoreSCP
{
       // DicomEmpfangen *scp; // put this in a headerfile if you use a class and not a main!
         scp = new DicomEmpfangen();
        scp->setPort(USERPEERPORT);
        scp->setAETitle(MOVEAPPLICATIONTITLE);
    NSString *pathname = [[NSBundle mainBundle] pathForResource:@"storescp" ofType:@"cfg"] ;
    const OFString path = (char * )[pathname UTF8String];
    if (scp->loadAssociationCfgFile(path).good())
        {
            NSLog(@"SCP-Config-File gefunden :-)");
            NSLog(@"dime-timeout: %@", scp->getDIMSETimeout());
            if (scp->setAndCheckAssociationProfile("Default").good())
            {
                // NSLog(@"listen gestartet um: %@", QTime::currentTime());
                NSLog(@"listen gestartet um");
                
                scp->setDIMSETimeout(ULONG_MAX);
                scp->setDIMSEBlockingMode(DIMSE_NONBLOCKING);
                
                if (scp->getDIMSEBlockingMode() == DIMSE_NONBLOCKING )
                {
                    NSLog(@"scp is in non-blocking mode: ");
                    scp->setConnnectionTimeout(ULONG_MAX);
                    //scp->setDIMSEBlockingMode(DIMSE_BLOCKING);
                    if (scp->getDIMSEBlockingMode() == DIMSE_BLOCKING )
                        NSLog(@"2nd try: scp is in blocking mode: ");
                    else NSLog(@"scp is still in non-blocking mode: ");
                }
                else {
                    NSLog(@"scp is in blocking mode: ");
                }

                if (scp->listen().bad())
                {
                    NSLog(@"error during listening!");
                }
                //NSLog(@"listen stops at: " << QTime::currentTime();
                NSLog(@"listen stops at: ");
            }
        }
        else
            NSLog(@"SCP-Config file not found :-(");
}

DicomEmpfangen.mm file is like this :

Code: Select all


#include "dicomempfangen.h"
DicomEmpfangen::DicomEmpfangen()
{
}
OFCondition DicomEmpfangen::handleIncomingCommand(T_DIMSE_Message *msg,
                                                  const DcmPresentationContextInfo &info)
{
    OFCondition cond;
    switch(msg->CommandField)
    {
        case DIMSE_C_ECHO_RQ :{
            // Process C-ECHO request
            cond = handleECHORequest( msg->msg.CEchoRQ, info.presentationContextID );
            break;
        }// ende DIMSE_C_ECHO_RQ
            
        case DIMSE_C_STORE_RQ:{
            
            //qDebug() << "data/files to save ... !!! :-)";
            NSLog(@"data/files to save ... !!! :-)");
            
            T_DIMSE_C_StoreRSP response;
            T_DIMSE_C_StoreRQ request = msg->msg.CStoreRQ;
            DcmDataset *statusDetail = NULL;
            
            T_ASC_PresentationContextID presID = info.presentationContextID;
            DcmDataset *dataObject = new DcmDataset();
            
            if (receiveDIMSEDataset(&presID, &dataObject,NULL,NULL).good())
            {
                if (dataObject != NULL)
                {
                   // NSLog(@ "Daten empfangen: " << QTime::currentTime();
                    NSLog(@"Daten empfangen: ");

                    dateiname.clear();
                    if (dataObject->findAndGetOFString(DCM_SOPInstanceUID, dateiname,0, true).good())
                        //qDebug() << "SOP IUID: "<< dateiname.c_str();
                        NSLog(@"SOP IUID: %@", dateiname.c_str());
                    
                    dataObject->saveFile(dateiname.c_str());
                    
                    bzero((char*)&response, sizeof(response));
                    response.DimseStatus = STATUS_Success;  /* assume */
                    response.MessageIDBeingRespondedTo = request.MessageID;
                    response.DataSetType = DIMSE_DATASET_NULL;  /* always for C-STORE-RSP */
                    strcpy(response.AffectedSOPClassUID, request.AffectedSOPClassUID);
                    strcpy(response.AffectedSOPInstanceUID, request.AffectedSOPInstanceUID);
                    response.opts = (O_STORE_AFFECTEDSOPCLASSUID | O_STORE_AFFECTEDSOPINSTANCEUID);
                    if (request.opts & O_STORE_RQ_BLANK_PADDING) response.opts |= O_STORE_RSP_BLANK_PADDING;
                    if (dcmPeerRequiresExactUIDCopy.get()) response.opts |= O_STORE_PEER_REQUIRES_EXACT_UID_COPY;
                    
                    OFCondition cond = sendSTOREResponse(presID, request, response, statusDetail);
                    if( cond.bad() ) DCMNET_INFO("Cannot send C-Store Response: " );
                    else DCMNET_INFO("C-STORE Response successfully sent");
                    
                }
                else  NSLog(@"no data received");
            }
            else  NSLog(@"no dcmdataset.");
            break;
        }
        default:{
            // We cannot handle this kind of message. Note that the condition will be returned
            // and that the caller is responsible to end the association if desired.
            OFString tempStr;
            DCMNET_ERROR("Cannot handle this kind of DIMSE command (0x"
                         << STD_NAMESPACE hex << STD_NAMESPACE setfill('0') << STD_NAMESPACE setw(4)
                         << OFstatic_cast(unsigned int, msg->CommandField) << ")");
            DCMNET_DEBUG(DIMSE_dumpMessage(tempStr, *msg, DIMSE_INCOMING));
            cond = DIMSE_BADCOMMANDTYPE;
        }// Ende default
    }// Ende case
    return cond;
}

During execution it shows the alert box having message: "Do you want the applicatio to accept incoming network connectios?"


but, DicomEmpfangen::handleIncomingCommand(T_DIMSE_Message *msg, const DcmPresentationContextInfo &info) method is not being called .
I can't understand, why this is happenning.

omarelgazzar
Posts: 101
Joined: Wed, 2009-07-08, 16:06
Location: Oldenburg, Germany

Re: After C-Move operation successful ?

#10 Post by omarelgazzar »

To check that you are really listening on the right port you specified for the PACS, use echoscu or storescu to test your storescp application? The log you have shown indicates that the operation was successful. Also, If you have access to the PACS log, check it. You can use also dcmqrscp commandline tool for testing your cmove scu application.

tariq2305
Posts: 16
Joined: Tue, 2012-04-03, 13:44

Re: After C-Move operation successful ?

#11 Post by tariq2305 »

Hi Omar!
Thanks again.

Actually, I have created a method for storescp in the same project , which i have called in the background thread.
As log shows , association is successful, but , i can' t undersatnd, why such type of reponse is coming at the end :


Context ID: 171 (Accepted)
D: Abstract Syntax: =XRayAngiographicImageStorage
D: Proposed SCP/SCU Role: Default
D: Accepted SCP/SCU Role: Default
D: Accepted Transfer Syntax: =JPEG2000
D: Context ID: 173 (Accepted)
D: Abstract Syntax: =XRayRadiofluoroscopicImageStorage
D: Proposed SCP/SCU Role: Default
D: Accepted SCP/SCU Role: Default
D: Accepted Transfer Syntax: =JPEG2000
D: Context ID: 175 (Accepted)
D: Abstract Syntax: =XRayRadiationDoseSRStorage
D: Proposed SCP/SCU Role: Default
D: Accepted SCP/SCU Role: Default
D: Accepted Transfer Syntax: =LittleEndianExplicit
D: Context ID: 177 (Abstract Syntax Not Supported)
D: Abstract Syntax: 1.3.46.670589.7.8.1618510091
D: Proposed SCP/SCU Role: Default
D: Accepted SCP/SCU Role: Default
D: Context ID: 179 (Abstract Syntax Not Supported)
D: Abstract Syntax: 1.3.12.2.1107.5.9.1
D: Proposed SCP/SCU Role: Default
D: Accepted SCP/SCU Role: Default
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation: none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response: none

D: ======================= END A-ASSOCIATE-AC ======================
I: Received Association Release Request
D: DcmSCP: Association Terminated

D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
I: Received C-MOVE Response
D: ===================== INCOMING DIMSE MESSAGE ====================
D: Message Type : C-MOVE RSP
D: Presentation Context ID : 3
D: Message ID Being Responded To : 8
D: Affected SOP Class UID : MOVEStudyRootQueryRetrieveInformationModel
D: Remaining Suboperations : none
D: Completed Suboperations : 0
D: Failed Suboperations : 6
D: Warning Suboperations : 0
D: Data Set : present
D: DIMSE Status : 0xa702: Error: Refused - Out of resources - Suboperations
D: ======================= END DIMSE MESSAGE =======================
D: DcmDataset::read() TransferSyntax="Little Endian Explicit"
D: Received dataset on presentation context 3
D: Handling C-MOVE Response
W: Status is 0xa702 (unknown)
W: Will not wait for further C-MOVE responses
I: Received Image # 6: 1.2.840.113747.1078798801.1964.3000.1762082110160.6
I: Releasing Association
D: +++++++++++++++++++++++++++++
D: +++++++++++++++++++++++++++++ion and network structures


Here Received Image # 6: 1.2.840.113747.1078798801.1964.3000.1762082110160.6 statement is just output of c-find request.
You can see the complete code in my earlier post.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest