Project

General

Profile

Actions

Bug #463

closed

Assumption of length field size in workaround for wrong attribute VR

Added by Michael Onken almost 13 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Library
Target version:
Start date:
2012-11-22
Due date:
% Done:

100%

Estimated time:
2:00 h
Module:
dcmdata
Operating System:
Compiler:

Description

The dcmdata parser has the possibility to override the wrong VR given in a DICOM file for an attribute by the official dictionary definition. See option "-ev" in current dcmdump code.

However, the assumption about the size of the length field (2 byte versus 4 bytes) is not corrected, i.e. the parser selects the correct VR, but does keep the wrong length field size if it was different for the wrong VR for that attribute.

Instead, the parser should also consider that the length field size may have changed too, in order to parse the attribute correctly. Maybe both behaviours make sense, so think whether this is worth an extra option.


Files

useDictForLengthField.patch (1.12 KB) useDictForLengthField.patch Uli Schlachter, 2012-11-27 15:55
useDictForLengthField2.patch (9.95 KB) useDictForLengthField2.patch Working(?) patch + tests for this feature Uli Schlachter, 2012-12-04 16:55
Actions #1

Updated by Uli Schlachter almost 13 years ago

The current behavior seems to be the way it is on purpose: (dcitem.cc, line 966)

/* determine VR read from dataset, because this VR specifies the number of bytes for the length-field */

Attached patch should implement the requested behavior. However, it is completely untested (this is definitely something that needs unit tests!)

Actions #3

Updated by Uli Schlachter over 12 years ago

  • % Done changed from 0 to 80

The parser-related parts of this are implemented with commit 7a4dc9fa31058dd675b7cf2fc62d58c904aba3f9.

Does anyone else want to add the command line options for this to the various tools?

Actions #4

Updated by Marco Eichelberg over 8 years ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

It does not make sense to add command line options to tools other than dcmdump and dcmconv, which both support the --ignore-explicit-vr and can thus be used for debugging and fixing files with incorrect VRs. It also does not make much sense in my view to add a command line option to enable the dcmPreferLengthFieldSizeFromDataDictionary flag, which re-enables an incorrect behaviour of the parser. Closing bug.

Actions

Also available in: Atom PDF