X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=2bf79ead5b000e767932fba248527d599996b0ea;hb=a23a0d4b82cc44b7fa2adada4454cde3e1431c1e;hp=031fe2922185d5ebce358de1897041246f50c6da;hpb=0b31e4c3ee25732c2fc63acf647213f4e3a7745e;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 031fe292..2bf79ead 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/10/27 11:55:45 $ - Version: $Revision: 1.315 $ + Date: $Date: 2005/10/28 15:52:46 $ + Version: $Revision: 1.320 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -187,7 +187,7 @@ bool Document::DoTheLoadingDocumentJob( ) /// In order to fix things "Quick and Dirty" the dictionary was /// altered on PURPOSE but now contains a WRONG value. /// In order to fix things and restore the dictionary to its - /// correct value, one needs to decided of the semantics by deciding + /// correct value, one needs to decide of the semantics by deciding /// whether the following tags are either : /// - multivaluated US, and hence loaded as ValEntry, but afterwards /// also used as BinEntry, which requires the proper conversion, @@ -552,7 +552,6 @@ double Document::SwapDouble(double a) return a; } - // // -----------------File I/O --------------- /** @@ -761,11 +760,17 @@ void Document::LoadEntryBinArea(DataEntry *entry) uint32_t i; unsigned short vrLgth = Global::GetVR()->GetAtomicElementLength(entry->GetVR()); - if( entry->GetVR() == "OW" ) - vrLgth = 1; + +// FIXME : trouble expected if we read an ... OW Entry (LUT, etc ..) +// if( entry->GetVR() == "OW" ) +// vrLgth = 1; switch(vrLgth) { + case 1: + { + break; + } case 2: { uint16_t *data16 = (uint16_t *)data; @@ -1534,7 +1539,7 @@ VRKey Document::FindDocEntryVR() // we used a heuristic that found "UL" in the first tag and/or // 'Transfer Syntax' told us it is. // Alas this doesn't guarantee that all the tags will be in explicit VR. - // In some cases one finds implicit VR tags mixed within an explicit VR file + // In some cases one finds implicit VR tags mixed within an explicit VR file. // Hence we make sure the present tag is in explicit VR and try to fix things // if it happens not to be the case. @@ -1785,12 +1790,12 @@ bool Document::CheckSwap() if ( net2host ) { SwapCode = 4321; - gdcmDebugMacro( "HostByteOrder != NetworkByteOrder"); + gdcmDebugMacro( "HostByteOrder != NetworkByteOrder, SwapCode = 4321"); } else { SwapCode = 1234; - gdcmDebugMacro( "HostByteOrder = NetworkByteOrder"); + gdcmDebugMacro( "HostByteOrder = NetworkByteOrder, SwapCode = 1234"); } // Position the file position indicator at first tag @@ -2126,12 +2131,18 @@ void Document::HandleOutOfGroup0002(uint16_t &group, uint16_t &elem) { Group0002Parsed = true; // we just came out of group 0002 - // if Transfer syntax is Big Endian we have to change CheckSwap + // if Transfer Syntax is Big Endian we have to change CheckSwap std::string ts = GetTransferSyntax(); + if ( ts == GDCM_UNKNOWN ) + { + gdcmDebugMacro("True DICOM File, with NO Transfer Syntax (?!) " ); + return; + } if ( !Global::GetTS()->IsTransferSyntax(ts) ) { - gdcmDebugMacro("True DICOM File, with NO Tansfer Syntax: " << ts ); + gdcmWarningMacro("True DICOM File, with illegal Transfer Syntax: [" + << ts << "]"); return; } @@ -2140,9 +2151,9 @@ void Document::HandleOutOfGroup0002(uint16_t &group, uint16_t &elem) if ( Global::GetTS()->GetSpecialTransferSyntax(ts) == TS::ImplicitVRLittleEndian ) - { - Filetype = ImplicitVR; - } + { + Filetype = ImplicitVR; + } // FIXME Strangely, this works with //'Implicit VR BigEndian Transfer Syntax (GE Private)