]> Creatis software - gdcm.git/blobdiff - src/gdcmHeaderEntry.cxx
Add a few missing 'group length' Elements
[gdcm.git] / src / gdcmHeaderEntry.cxx
index 34424cc558af85db02f9a1b2353e856ef43c645f..0185b9157ce0844e180d81b6b669043a9b9d075b 100644 (file)
@@ -14,7 +14,7 @@
 #include <iomanip> // for std::ios::left, ...
 
 
-#define MAX_SIZE_PRINT_ELEMENT_VALUE 64
+#define MAX_SIZE_PRINT_ELEMENT_VALUE 10000
 
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
@@ -25,6 +25,7 @@
  */
 gdcmHeaderEntry::gdcmHeaderEntry(gdcmDictEntry* in) {
        ImplicitVR = false;
+       voidArea = NULL; // unsecure memory area to hold 'non string' values
        entry = in;
 }
 
@@ -51,7 +52,7 @@ void gdcmHeaderEntry::Print(std::ostream & os) {
    d2 = _CreateCleanString(v);  // replace non printable characters by '.'
    if (printLevel>=2) { 
       s << "lg : ";
-      lgth = GetReadLength();
+      lgth = GetReadLength(); // ReadLength, as opposed to UsableLength
       if (lgth == 0xffffffff) {
          sprintf(st,"x(ffff)");  // I said : "x(ffff)" !
          s.setf(std::ios::left);
@@ -83,15 +84,20 @@ void gdcmHeaderEntry::Print(std::ostream & os) {
     
    s << "[" << GetName()<< "]";
 
-     
-           
-   if( (GetLength()<MAX_SIZE_PRINT_ELEMENT_VALUE) || 
-       (printLevel>=3)  || 
-       (d2.find("gdcm::NotLoaded.") < d2.length()) )
-      s << " [" << d2 << "]";
-   else 
-      s << " [ gdcm::too long for print (" << GetLength() << ") ]";
-
+   if (voidArea != NULL) {
+       s << " [gdcm::Non String Data Loaded in Unsecure Area (" 
+         << GetLength() << ") ]";
+   } 
+   
+   else {             
+      if( (GetLength()<MAX_SIZE_PRINT_ELEMENT_VALUE) || 
+          (printLevel>=3)  || 
+          (d2.find("gdcm::NotLoaded.") < d2.length()) )
+         s << " [" << d2 << "]";
+      else 
+         s << " [gdcm::too long for print (" << GetLength() << ") ]";
+   }
+   
    // Display the UID value (instead of displaying the rough code)  
    if (g == 0x0002) {  // Any more to be displayed ?
       if ( (e == 0x0010) || (e == 0x0002) )