]> Creatis software - gdcm.git/commitdiff
tiny patch to make e-film readable some e-film breaker MR Philips images
authorjpr <jpr>
Mon, 15 Mar 2004 15:38:31 +0000 (15:38 +0000)
committerjpr <jpr>
Mon, 15 Mar 2004 15:38:31 +0000 (15:38 +0000)
from Hoptial Guy de Chauliac, Montpellier

src/gdcmObject.cxx
src/gdcmParser.cxx

index a91aec1f9c1c635f43bdd5998731b86eab087bf5..debbfdd543160e55b1f4bf5580c643134af5db5f 100644 (file)
@@ -112,7 +112,6 @@ std::string gdcmObject::GetEntryByName(TagName name)  {
          gdcmHeaderEntry *Entry;
          TagKey key = gdcmDictEntry::TranslateToKey(group, element);
          if ( ! ptagHT->count(key)) {
-          // we assume the element belongs to a Public Group (not a shadow one)
           // we assume a Public Dictionnary *is* loaded
            gdcmDict *PubDict         = gdcmGlobal::GetDicts()->GetDefaultPubDict();
            // if the invoqued (group,elem) doesn't exist inside the Dictionary
index 3fa3cc97621bca32a74bda46cb621f3b772b966d..5bee740526e38d34d2cb0e458c0d05aa83d3873a 100644 (file)
@@ -1056,14 +1056,6 @@ void gdcmParser::WriteEntry(gdcmHeaderEntry *tag, FILE *_fp,FileType type)
    // TODO (?) tester les echecs en ecriture (apres chaque fwrite)
    int compte =0;
    itsTimeToWritePixels = false;
-     
-      // === Deal with the length
-      //     --------------------
-      if((tag->GetLength())%2==1)
-      { 
-         tag->SetValue(tag->GetValue()+"\0");
-         tag->SetLength(tag->GetReadLength()+1);
-      }
 
       gr    = tag->GetGroup();
       el    = tag->GetElement();
@@ -1071,6 +1063,14 @@ void gdcmParser::WriteEntry(gdcmHeaderEntry *tag, FILE *_fp,FileType type)
       val   = tag->GetValue().c_str();
       vr    = tag->GetVR();
       voidArea = tag->GetVoidArea();
+           
+      // === Deal with the length
+      //     --------------------
+      if((tag->GetLength())%2==1)
+      { 
+         tag->SetValue(tag->GetValue()+"\0");
+         tag->SetLength(tag->GetReadLength()+1);
+      }
       
       if ( type == ACR ) 
       { 
@@ -1090,7 +1090,14 @@ void gdcmParser::WriteEntry(gdcmHeaderEntry *tag, FILE *_fp,FileType type)
          guint16 z=0, shortLgr;
         
          if (gr == 0xfffe) { // NO Value Representation for 'delimiters'
-               // no length : write ffffffff           
+                             // no length : write ffffffff
+                                                    
+                                        // special patch to make some MR PHILIPS
+             if (el == 0x0000) return;  // images e-film readable                                      // see gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm
+                                       // from Hospital Guy de Chauliac,
+                                        // Montpellier
+                                       // we just ignore spurious fffe|0000 tag !
+                       
             fwrite (&ff,(size_t)4 ,(size_t)1 ,_fp);
             return;       // NO value for 'delimiters'                     
         }