findAndGetOFStringArray doesn't work for me

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

findAndGetOFStringArray doesn't work for me

#1 Post by ChoCChoK »

Hello,

Thank you for accepting me to register here.

I started to use DCMTK to create a DICOM viewer. I tried the code that you give as an example of DcmSCU (http://support.dcmtk.org/redmine/projec ... wto_DcmSCU). All seem to work, since I'm able to see the number of studies available in http://www.dicomserver.co.uk, but when I want to verify that there is a study instance ID (see below the code), it doesn't work.

Here is the entire code, after the number of studies available:

Code: Select all

while (study != findResponses.end() && result.good())
  {
    // 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()) /* ---This condition is never true--- */
      {
        req.putAndInsertOFStringArray(DCM_StudyInstanceUID, studyInstanceUID);
        // fetches all images of this particular study
        result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, NULL /* we are not interested into responses*/);
        if (result.good())
        {
          DCMNET_INFO("Received study #" << std::setw(7) << studyCount << ": " << studyInstanceUID);
          studyCount++;
        }
      }
    }
    study++;
  }
Just to be clear, I also tried with other tags (like PatientName, for example), but it doesn't work, and always with the same error: "Tag not found". I tried with an other PACS, at work, and again, it's the same problem... And the findAndGetOFString function doesn't work neither.

Thanks,
ChoCChoK.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: findAndGetOFStringArray doesn't work for me

#2 Post by J. Riesmeier »

Of course, you have to query the PACS for Patient's Name (0010,0010) if you want to get it from the response dataset(s). The referenced example does not query for it.

ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

Re: findAndGetOFStringArray doesn't work for me

#3 Post by ChoCChoK »

Hi,

Thanks for the reply...

It was an example... My real problem is that it's not working, even for the studyInstanceUID like in the code example!

Can anyone help?

Thank you,
ChoCChoK.

ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

Re: findAndGetOFStringArray doesn't work for me

#4 Post by ChoCChoK »

Hi again!

I found the solution to my problem! Thanks for your help.

Best regards,
ChoCChoK.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: findAndGetOFStringArray doesn't work for me

#5 Post by J. Riesmeier »

Could you tell us what the problem was?

ChoCChoK
Posts: 7
Joined: Mon, 2017-12-11, 12:50

Re: findAndGetOFStringArray doesn't work for me

#6 Post by ChoCChoK »

Yes, of course!

The problem was that I used a bad context... My bad.

Have a good day,
ChoCChoK.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest