dcmtk-3.6.1 - odd length UIDS padded with null byte in LOG

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
gerhardh
Posts: 8
Joined: Tue, 2006-02-28, 17:10

dcmtk-3.6.1 - odd length UIDS padded with null byte in LOG

#1 Post by gerhardh »

Hi Offis Team,

compiled the actual dcmtk-3.6.1_20140617 Snapshot on linux (Centos 6.5 x64, gcc 4.4.7),

and found, that in the logger output of findscu, odd length UIDs are padded with null Bytes ( \0 ).
This is different to dcmtk-3.6.0, and generates problems in further processing (grep, cut, ..) of the Logfiles. ( "Binary" file is not accepted.)

This seems to be related to: 'what got changed in dcm2xml between 3.6.0 and 3.6.1 (NUL)?' viewtopic.php?f=1&t=3843&hilit=null


To see the \0 Byte in the logger output, you can use "cat -A" on linux:

Code: Select all

./dcmtk-3.6.1/bin/findscu   \
     --study  -k "(0008,0052)=STUDY" --key " (0020,000d)=1.3.12.2.1107.5.99.1.3221.30000014101306262733600000349" \
     127.0.0.1 11112 2>&1 |cat -A

I: ---------------------------$
I: Find Response: 1 (Pending)$
I: $
I: # Dicom-Data-Set$
I: # Used TransferSyntax: Little Endian Implicit$
....
I: (0008,0056) CS [ONLINE]                                 #   6, 1 InstanceAvailability$
I: (0020,0000) UL 64                                       #   4, 1 GenericGroupLength$
I: (0020,000d) UI [1.3.12.2.1107.5.99.1.3221.30000014101306262733600000349^@] #  56, 1 StudyInstanceUID$       <----------
....

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

Re: dcmtk-3.6.1 - odd length UIDS padded with null byte in L

#2 Post by J. Riesmeier »

You see the padding bytes because "findscu" disables their removal:

Code: Select all

    /*
    ** Don't let dcmdata remove trailing blank padding or perform other
    ** manipulations.  We want to see the real data.
    */
    dcmEnableAutomaticInputDataCorrection.set(OFFalse);
Also, I would not recommend to parse the log output because there is no guarantee that its format, structure and so on remains stable over time. It would be better to use the binary version of the C-FIND response messages (option -X or --extract).

Maybe, there should be options to enable/disable the removal of padding like in "dcmdump" (and others) also for "findscu":

Code: Select all

  automatic data correction:
    +dc  --enable-correction    enable automatic data correction (default)
    -dc  --disable-correction   disable automatic data correction

gerhardh
Posts: 8
Joined: Tue, 2006-02-28, 17:10

Re: dcmtk-3.6.1 - odd length UIDS padded with null byte in L

#3 Post by gerhardh »

Hello Joerg,

thanks for the Hint !

Setting dcmEnableAutomaticInputDataCorrection.set(OFTrue) works for me.

But nevertheless - I think a \0 Byte should not be written to a File / StdErr,
even if .... We want to see the real data. ...
Because you can not see a \0 . In the output I would expect a " " [Space] - to SEE it.

greets
Gerhard

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

Re: dcmtk-3.6.1 - odd length UIDS padded with null byte in L

#4 Post by J. Riesmeier »

I just committed a patch that introduces new "data correction" options (as in dcmdump): http://git.dcmtk.org/web?p=dcmtk.git;a= ... d64898edce

With regard to the output of invisible characters to the logger, we will discuss this internally...
By the way, dcmdump already has options for this purpose:

Code: Select all

  quoting:
    +Qn  --quote-nonascii       quote non-ASCII and control chars as XML markup
    +Qo  --quote-as-octal       quote non-ASCII and control ch. as octal numbers
    -Qn  --print-nonascii       print non-ASCII and control chars (default)

Post Reply

Who is online

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