How to get value as EVR_SS from EVR_UNKNOWN element

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Shingo Satou
Posts: 4
Joined: Fri, 2005-01-14, 05:40

How to get value as EVR_SS from EVR_UNKNOWN element

#1 Post by Shingo Satou » Fri, 2005-01-14, 05:43

Hi to everyone !! :D

I want to get value as EVR_SS, EVR_FD, and EVR_PN from EVR_UNKNOWN element.

Any idea that could help me ?? :(



Shingo Satou

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 » Mon, 2005-01-17, 11:47

What is the background of your question? If you intend to add support for private tags you should follow the "official" way by adding these tags to the "private.dic" file.

Shingo Satou
Posts: 4
Joined: Fri, 2005-01-14, 05:40

#3 Post by Shingo Satou » Tue, 2005-01-18, 03:16

I'm developing the viewer software that can read DICOM files of various manufacturers.
When DICOM files of a manufacturer is read, private tag is included in that.
For this case, all the tag numbers cannot be anticipated beforehand.
Therefore, all the tag numbers cannot be written in "Private.dic" file beforehand.
Then, I want to get value from EVR_UNKNOWN element by EVR_SS, EVR_FD, and EVR_PN form.

Code: Select all

Example:

void DisplayUnknown(DcmElement *UnknownObject, DcmEVR FormatVR)
{
    switch(FormatVR)
    {
    case EVR_FL:
        {
            Float32 Val = 0.0;
            UnknownObject->getFloat32(Val, 0);
            printf(%f, Val);
        }
        break;
    case EVR_UI:
        {
            OFString Val = "";
            UnknownObject->getOFString(Val, 0);
            printf(%s, Val);
        }
        break;
    /* code for other VRs */
    }
}
However, getOFString() doesn't operate normally.

Any idea that could help me ??

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 » Tue, 2005-01-18, 12:07

As you can see in the source code data elements with unknown VR are mapped to either DcmOtherByteOtherWord or DcmSequenceOfItems (depending on the value of the length attribute).

Nevertheless, my question still remains: how do you know to which VR you want to map the unknown VR if you do not know the private attribute? Maybe I'm missing something.

Shingo Satou
Posts: 4
Joined: Fri, 2005-01-14, 05:40

#5 Post by Shingo Satou » Wed, 2005-01-19, 05:48

I don't know VR of private tag, and I want to get value
guessing that VR is SS, FD, and PN.

If processing that helps it exists in DCMTK, I want to use it.

Value example:
  • 0x48 0x45 0x4c 0x4c 0x4f 0x21 0x21 0x21
Output example:
  • If this VR is SS, the value is [17736 19532 8527 8481].
    If this VR is FD, the value is [4.187e-1497].
    If this VR is PN, the value is [HELLO!!!].

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

#6 Post by Jörg Riesmeier » Wed, 2005-01-19, 12:07

There is no support for guessing the VR of an unknown data element in DCMTK and I doubt that it is possible to find a general solution for this problem. For example, how would you determine that the guessed VR is correct - I mean automatically.

If the unknown data element is stored as a DcmOtherByteOtherWord you could access the binary information directly using the appropriate getXXX() method and apply your own heuristics to this value.

Shingo Satou
Posts: 4
Joined: Fri, 2005-01-14, 05:40

#7 Post by Shingo Satou » Thu, 2005-01-20, 02:23

Thanks Jorg Riesmeier.

I will write processing by myself.

Post Reply

Who is online

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