]> Creatis software - gdcm.git/commitdiff
Correction calcul 'gdcmZSize' dans AddAndDefaultElements.
authorjpr <jpr>
Wed, 2 Apr 2003 09:48:03 +0000 (09:48 +0000)
committerjpr <jpr>
Wed, 2 Apr 2003 09:48:03 +0000 (09:48 +0000)
Question : Utilité d'une telle fonction, qui ajoute des Elements non ACR/DICOM dans le PubElValSet
(problèmes lors du DCM Write à prévoir)
--> A remplacer par des accesseurs propres ?

src/gdcmHeader.cxx

index 8ea7eca7dbc5972e63c3ab6b6c81097587c1ecaf..5e6c2c876cd2c1c4b6146b12c9b6b5215243ff57 100644 (file)
@@ -1423,12 +1423,19 @@ void gdcmHeader::AddAndDefaultElements(void) {
 
    NewElVal = NewManualElValToPubDict("gdcmZSize", "US");
    if (!NewElVal) return;
-   NewVal = GetElValByName("Planes");
-   if (NewVal != "gdcm::Unfound")
+   NewVal = GetElValByNumber(0x0028,0x0008); // 0028 0008 IS IMG Number of Frames (DICOM)
+   if (NewVal == "gdcm::Unfound") {
+       NewVal = GetElValByNumber(0x0028,0x0012); // 028 0012 US IMG Planes (ACR-NEMA)
+       if (NewVal == "gdcm::Unfound") {          // Warning !!! : 6000 0012 US OLY Planes
+               NewElVal->SetValue("0");
+       } else {
+               NewElVal->SetValue(NewVal);
+       }               
+   } else {
       NewElVal->SetValue(NewVal);
-   else
-      NewElVal->SetValue("0");
-}
+   }                                           // length is still wrong 
+}                                              // do we care about it?
+
 
 /**
  * \ingroup gdcmHeader