OFString::compare (const OFString& str) is failing

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
rakeshd
Posts: 11
Joined: Wed, 2014-01-15, 08:43
Location: South Korea

OFString::compare (const OFString& str) is failing

#1 Post by rakeshd »

Hi,
We are facing an issue with OFString compare method.

In DcmPresentationState::createFromImage method, line 928
else if ((aString != "MONOCHROME2")&&(aString != "MONOCHROME 2"))
is failing for sString value "MONOCHROME2"

This is what I found, it is failing for image where the padding used is NULL instead of SPACE.
For bad case, sString size is 12 (while NULL padding), because of this OFString::compare method is returning false.

But for good case, sString size is 11 (while SPACE padding).

The dataset was downloaded from Osirix, so I am not sure what is wrong.

Please suggest.

Thanks
Rakesh

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

Re: OFString::compare (const OFString& str) is failing

#2 Post by J. Riesmeier »

Using a zero (0x00) byte instead of a space (0x20) for padding a CS value violates the DICOM standard, if this was the question.

rakeshd
Posts: 11
Joined: Wed, 2014-01-15, 08:43
Location: South Korea

Re: OFString::compare (const OFString& str) is failing

#3 Post by rakeshd »

Yes, thats was the doubt I have.. so can we report that as violation of DICOM std.?

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

Re: OFString::compare (const OFString& str) is failing

#4 Post by J. Riesmeier »

If you want to refer to the DICOM standard, here is the definition of the corresponding VR: http://medical.nema.org/medical/dicom/c ... able_6.2-1

Post Reply

Who is online

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