+ Fp->seekg( 0, std::ios::beg);
+
+ // Load 'non string' values
+
+ std::string PhotometricInterpretation = GetEntryValue(0x0028,0x0004);
+ if ( PhotometricInterpretation == "PALETTE COLOR " )
+ {
+ // FIXME
+ // Probabely this line should be outside the 'if'
+ // Try to find an image sample holding a 'gray LUT'
+ LoadEntryBinArea(0x0028,0x1200); // gray LUT
+
+ /// FIXME
+ /// The tags refered by the three following lines used to be CORRECTLY
+ /// defined as having an US Value Representation in the public
+ /// dictionary. BUT the semantics implied by the three following
+ /// lines state that the corresponding tag contents are in fact
+ /// the ones of a BinEntry.
+ /// 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
+ /// whether the following tags are either :
+ /// - multivaluated US, and hence loaded as ValEntry, but afterwards
+ /// also used as BinEntry, which requires the proper conversion,
+ /// - OW, and hence loaded as BinEntry, but afterwards also used
+ /// as ValEntry, which requires the proper conversion.
+ LoadEntryBinArea(0x0028,0x1201); // R LUT
+ LoadEntryBinArea(0x0028,0x1202); // G LUT
+ LoadEntryBinArea(0x0028,0x1203); // B LUT
+
+ // Segmented Red Palette Color LUT Data
+ LoadEntryBinArea(0x0028,0x1221);
+ // Segmented Green Palette Color LUT Data
+ LoadEntryBinArea(0x0028,0x1222);
+ // Segmented Blue Palette Color LUT Data
+ LoadEntryBinArea(0x0028,0x1223);
+ }
+
+ //FIXME later : how to use it?
+ SeqEntry *modLutSeq = GetSeqEntry(0x0028,0x3000);
+ if ( modLutSeq !=0 )
+ {
+ SQItem *sqi= modLutSeq->GetFirstSQItem();
+ if ( sqi != 0 )
+ {
+ BinEntry *b = sqi->GetBinEntry(0x0028,0x3006);
+ if ( b != 0 )
+ {
+ if ( b->GetLength() != 0 )
+ {
+ LoadEntryBinArea(b); //LUT Data (CTX dependent)
+ }
+ }
+ }
+ }
+
+ CloseFile();
+
+ // ----------------------------
+ // Specific code to allow gdcm to read ACR-LibIDO formated images
+ // Note: ACR-LibIDO is an extension of the ACR standard that was
+ // used at CREATIS. For the time being (say a couple of years)
+ // we keep this kludge to allow CREATIS users
+ // reading their old images.
+ //
+ // if recognition code tells us we deal with a LibIDO image
+ // we switch lineNumber and columnNumber
+ //
+ std::string RecCode;
+ RecCode = GetEntryValue(0x0008, 0x0010); // recognition code (RET)
+ if (RecCode == "ACRNEMA_LIBIDO_1.1" ||
+ RecCode == "CANRME_AILIBOD1_1." ) // for brain-damaged softwares
+ // with "little-endian strings"
+ {
+ Filetype = ACR_LIBIDO;
+ std::string rows = GetEntryValue(0x0028, 0x0010);
+ std::string columns = GetEntryValue(0x0028, 0x0011);
+ SetValEntry(columns, 0x0028, 0x0010);
+ SetValEntry(rows , 0x0028, 0x0011);
+ }
+ // --- End of ACR-LibIDO kludge ---
+
+ return true;