Movescu Key problem?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Lucian
Posts: 2
Joined: Thu, 2006-07-27, 01:12

Movescu Key problem?

#1 Post by Lucian »

Greetings,
I am mantaining someone else's code and after upgrading dctk to 3.5.4, am having trouble calling movescu from the command line. I am using Linux FC5 and here is the command as it is being used:

movescu -v --study --port 15100 -aet ted1ae -aec med_imFIR -aem ted1ae -k 0008,0052=STUDY -k 0020,000D=1.2.124.113532.129.255.5.220.20030814.233437.2243986 med_im 104

and I get the following error:
15:36:21,611 ERROR dx.MediStoreClient - $dcmtk: movescu v3.5.4 2005-12-20 $
15:36:21,611 ERROR dx.MediStoreClient -
15:36:21,611 ERROR dx.MediStoreClient - movescu: DICOM retrieve (C-MOVE) SCU
15:36:21,612 ERROR dx.MediStoreClient - error: bad key format or key not found in dictionary: 0020,000D=1.2.124.113532.129.255.5.220.20030814.233437.2243986
15:36:21,611 ERROR MediPrimeClient.51 0 - Script error: java.io.IOException: $dcmtk: movescu v3.5.4 2005-12-20 $

I checked the Dicom.dic file and studyInstanceuid exists:

(0020,000D) UI StudyInstanceUID 1 dicom98

I then saw a post somwhere by Michael saying there was a known bug with using keys in move scu and a patch exists? If this is the case, is it possible for me to get a copy of the patch if you think it would help solve the above problem?

Regards,
Ted

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Here's the diff:

Code: Select all

diff -r1.59 -r1.60
24,25c24,25
<  *  Last Update:      $Author: meichel $
<  *  Update Date:      $Date: 2005/12/08 15:44:20 $
---
>  *  Last Update:      $Author: onken $
>  *  Update Date:      $Date: 2006/01/17 15:38:50 $
27c27
<  *  CVS/RCS Revision: $Revision: 1.59 $
---
>  *  CVS/RCS Revision: $Revision: 1.60 $
150a151
>     OFString dicName, valStr;
153d153
<
155d154
<     n = sscanf(s, "%x,%x=%s", &g, &e, val);
157,158c156,169
<     if (n != 2) {
<       // not a group-element pair, try to lookup in dictionary
---
>     // try to parse group and element number
>     n = sscanf(s, "%x,%x=%s", &g, &e, val);
>     if (n < 2) {
>       // try to parse dictionary name and value instead
>       OFString toParse = s;
>       size_t eqPos = toParse.find('=');
>       if (eqPos != string::npos)
>       {
>         dicName = toParse.substr(0,eqPos).c_str();
>         valStr = toParse.substr(eqPos+1,toParse.length());
>       }
>       else
>         dicName = s; // only dictionary name given (without value)
>       // try to lookup in dictionary
161c172
<       const DcmDictEntry *dicent = globalDataDict.findEntry(s);
---
>       const DcmDictEntry *dicent = globalDataDict.findEntry(dicName.c_str());
171,172c182,183
<         msg = "bad key format or key not found in dictionary: ";
<         msg += s;
---
>         msg = "bad key format or dictionary name not found in dictionary: ";
>         msg += dicName;
176,189c187,188
<     const char* spos = s;
<     char ccc;
<     do
<     {
<       ccc = *spos;
<       if (ccc == '=') break;
<       if (ccc == 0) { spos = NULL; break; }
<       spos++;
<     } while(1);
<
<     if (spos && *(spos+1)) {
<         strcpy(val, spos+1);
<     }
<
---
>     else
>       valStr = val;
200,201c199,200
<     if (strlen(val) > 0) {
<         elem->putString(val);
---
>     if (valStr.length() > 0) {
>         elem->putString(valStr.c_str());
206c205
<             msg += val;
---
>             msg += valStr;
1409a1409,1412
> ** Revision 1.60  2006/01/17 15:38:50  onken
> ** Fixed "--key" option, which was broken when using the optional assignment ("=")
> ** operation inside the option value
> **

Lucian
Posts: 2
Joined: Thu, 2006-07-27, 01:12

#3 Post by Lucian »

Well, the complete source would be easier to recompile as I am not that familiar with diff.
can it be sent to actaeus AT yahoo.com? Thanks :)

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

We are now providing a patched version of the findscu and movescu source code on our ftp server:
ftp://dicom.offis.de/pub/dicom/offis/so ... 354/patch/

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Google [Bot] and 1 guest