Problems while reading the message length tag

Problems while reading the message length tag

Post by Craig D. von Lan » Mon, 18 May 1998 04:00:00




> Hello

> I have some difficulties in reading the message length tag in some Dicom
> files. When I read the tags, the group and the element attributes are fine ,
> but when I read the  32 bits message length element, the first two bytes are
> corresponding to the VR, thus leading to a wrong message length.
> Is there a way to recognize this kind of files ? Does it have to be parsed
> from the  dictionary ? What if the tag is not in the dictionary ?

These files use one of the Explicit VR Transfer Syntaxes.
You can tell if the data set is going to be Implicit VR or Explicit VR
by looking at the meta file header. The data element (0002,0010)
contains the transfer syntax used for the subsequent data set. I'm
guessing that you don't have DICOM part 10 standard files though, since
these have explicit VR in the header, and you would have had troubles
with them already. If the file is not a DICOM standard file with a
header, then you have to start parsing the file, and see if you
can figure out what the transfer syntax is from what you find there.

In the case of an Explicit VR data set, then the value length is not
always 32 bits as you suggest. For most elements you will have 2 bytes
for the VR and 2 bytes for the value length, but for OB, OW, and SQ
elements there is 2 bytes for the VR, 2 reserved bytes and then the
32 bit value length. See DICOM part 5, section 7 for details.

You do not have to use the data dictionary to parse a file stored in
Explicit VR - on the contrary - you need a data dictionary to parse
files stored with Implicit VR so that you can figure out what the
representation of the element is to decode it.

If a tag is not in your data dictionary, and the data set is encoded
in an Implicit VR transfer syntax, you might still be able to
parse the file. For data elements that you don't recognize, the
value length usually gives you enough information to skip over that
element and continue. If you come across a data element that is not
in your dictionary, and the value length is undefined (FFFFFFFFH)
then you're up the proverbial creek. This situation is not hopeless,
but it is too complicated to get into here.

_____________________________________________________________________


Computer Vision Centre                       http://www.cvc.uab.es
Building O                                   +34-93 581 27 80 (voice)
Autonomous University of Barcelona           +34-93 581 16 70 (fax)
08193 Bellaterra (Barcelona), Spain          +34-93 674 65 67 (home)
_____________________________________________________________________

 
 
 

Problems while reading the message length tag

Post by Marco Eichelbe » Tue, 19 May 1998 04:00:00



> If a tag is not in your data dictionary, and the data set is encoded
> in an Implicit VR transfer syntax, you might still be able to
> parse the file. For data elements that you don't recognize, the
> value length usually gives you enough information to skip over that
> element and continue. If you come across a data element that is not
> in your dictionary, and the value length is undefined (FFFFFFFFH)
> then you're up the proverbial creek. This situation is not hopeless,
> but it is too complicated to get into here.

Supplement 14 describes this scenario. It defines the UN (unknown)
Value Representation one would use to convert attributes not contained
in the data dictionary from implicit to explicit VR encoding.
To put it simple, if the tag is unknown and the length is undefined,
then it's a sequence (or its "UN" counterpart) and can be parsed
like any other ordinary sequence.

Regards,
Marco Eichelberg

---------------------------------------------------------------------

OFFIS - Oldenburger F&E-Institut fuer Informatik-Werkzeuge + Systeme
                Escherweg 2, D-26121 Oldenburg, Germany
           Phone: (+49)441-9722-147  Fax: (+49)441-9722-102

 
 
 

1. What is maximum length of ASN.1 tags in SNMP BER encoding?

Hi all,

I am a newbie in SNMP and looking at available docs confuses me no
end, (at this moment) so I dare ask here :-)

I have just developed a LDAP decoder/encoder and soon I will habe to
do the same for SNMP and now I am wondering (to optimize my BER
routines) what is the maximum length of the tags in SNMP BER encoding,
conveniently for LDAP the length is no more than 1 byte and it would
be great if that is the same for SNMP. Can someone confirm this?

Happy networking,

D.O.Brzezinski

2. process priority

3. Matching Structure Tag Lengths

4. Visual Basic CONVERTION

5. Compilation error whiling making version 4.2.52

6. Teaching OLE or MFC?

7. problem with reading workgroup messages

8. gethostname & Computer Name

9. problem with reading pgp-message

10. Message ordering for different tags.

11. Message tags in LAM 6.1

12. MPI_PROC_NULL and invalid message tags

13. Gamer Tag (Do testers get to keep there tag?)