+ SwitchByteSwapCode();
+ }
+}
+
+/**
+ * \brief Group 0002 is always coded Little Endian
+ * whatever Transfer Syntax is
+ * @return no return
+ */
+void Document::HandleOutOfGroup0002(uint16_t group)
+{
+ // Endian reversion. Some files contain groups of tags with reversed endianess.
+ if ( !Group0002Parsed && group != 0x0002)
+ {
+ Group0002Parsed = true;
+ // we just came out of group 0002
+ // if Transfer syntax is Big Endian we have to change CheckSwap
+
+ TagKey key = DictEntry::TranslateToKey(0x0002, 0x0010);
+ if ( !TagHT.count(key))
+ {
+ gdcmVerboseMacro("True DICOM File, with NO Tansfer Syntax ?!?");
+ return;
+ }
+
+ // FIXME Strangely, this works with
+ //'Implicit VR Transfer Syntax (GE Private)
+
+ if ( ((ValEntry *)TagHT.find(key)->second)->GetValue()
+ == "Explicit VR - Big Endian" )
+ {
+ gdcmVerboseMacro("Tansfer Syntax = Explicit VR - Big Endian");
+ SwitchByteSwapCode();
+ }