]> Creatis software - gdcm.git/commitdiff
* Test/TestUtil.cxx : reformat the source code
authorregrain <regrain>
Tue, 7 Dec 2004 13:39:31 +0000 (13:39 +0000)
committerregrain <regrain>
Tue, 7 Dec 2004 13:39:31 +0000 (13:39 +0000)
   * vtk/vtkGdcmReader.cxx : remove and change prints
   * src/gdcmValEntry.[cxx|h] : now set the length of the value when calling
     SetValue
   * src/gdcmBinEntry.[cxx|h] : SetValue method don't set the length
   * src/*.cxx : remove all useless call to SetLength of a ValEntry object
   -- BeNours

13 files changed:
ChangeLog
Testing/TestUtil.cxx
src/gdcmBinEntry.h
src/gdcmDicomDir.cxx
src/gdcmDicomDirObject.cxx
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmFile.cxx
src/gdcmHeader.cxx
src/gdcmSQItem.cxx
src/gdcmValEntry.cxx
src/gdcmValEntry.h
vtk/vtkGdcmReader.cxx

index 75dfeb08b0561456eaa038306c1388d6f8ed1901..3557fc481ec5e76903ecbcac5b0de238c1544ef3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-12-07 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * Test/TestUtil.cxx : reformat the source code
+   * vtk/vtkGdcmReader.cxx : remove and change prints
+   * src/gdcmValEntry.[cxx|h] : now set the length of the value when calling
+     SetValue
+   * src/gdcmBinEntry.[cxx|h] : SetValue method don't set the length
+   * src/*.cxx : remove all useless call to SetLength of a ValEntry object
+
 2004-12-07 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
    * src/gdcmPixelWriteConvert.[h|cxx] : ficnished this class
    * src/gdcmFile.cxx : finished the correctly use of PixelWriteConvert
index 9e0261dc431ec87b42de717d1b074e8895de240d..b61aa4cd1ffe911d894455de16c7c66f341e8c27 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestUtil.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:56 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2004/12/07 13:39:32 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 int TestUtil(int , char * [])
 {
+   // Unique UID test
    std::cout << gdcm::Util::CreateUniqueUID("") << std::endl;
    
+   // DicomString test
    const char ref[] = "MONOCHROME1";
    std::string a = "MONOCHROME1";
    a += '\0';
@@ -32,10 +34,14 @@ int TestUtil(int , char * [])
    std::string c = gdcm::Util::DicomString("MONOCHROME1");
    std::string d = "MONOCHROME1";
 
-   if( !gdcm::Util::DicomStringEqual(a,ref) ) return 1;
-   if( !gdcm::Util::DicomStringEqual(b,ref) ) return 1;
-   if( !gdcm::Util::DicomStringEqual(c,ref) ) return 1;
-   if(  gdcm::Util::DicomStringEqual(d,ref) ) return 1;
+   if( !gdcm::Util::DicomStringEqual(a,ref) ) 
+      return 1;
+   if( !gdcm::Util::DicomStringEqual(b,ref) ) 
+      return 1;
+   if( !gdcm::Util::DicomStringEqual(c,ref) ) 
+      return 1;
+   if(  gdcm::Util::DicomStringEqual(d,ref) ) 
+      return 1;
 
    return 0;
 }
index c659b11d2fe6f2d42c4a4331afe43767e798a8ad..1142ed57439d8bc6bc239b03de0743327be8002b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:57 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2004/12/07 13:39:32 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,6 +48,8 @@ public:
    uint8_t* GetBinArea()  { return BinArea; }
    void  SetBinArea( uint8_t* area, bool self = true );
 
+   /// Sets the value (string) of the current Dicom Document Entry
+   virtual void SetValue(std::string const & val) {SetValueOnly(val);};
 private:
    /// \brief unsecure memory area to hold 'non string' values 
    ///       (ie : Lookup Tables, overlays, icons)   
index 1f668e974b5c7da53165b71702cc2b01eac343dc..7ab7f7d6d3c3b7c0f6add43c6d8de4c5044b6f46 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/06 11:37:38 $
-  Version:   $Revision: 1.87 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.88 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -519,28 +519,6 @@ DicomDirPatient * DicomDir::NewPatient()
       entry->SetOffset(0); // just to avoid further missprinting
       entry->SetValue( it->Value );
 
-      // dealing with value length ...
-      
-      if( dictEntry->GetGroup() == 0xfffe)
-      {
-         entry->SetLength(entry->GetValue().length());
-      }
-      else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
-      {
-         entry->SetLength( 4 );
-      } 
-      else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
-      {
-         entry->SetLength(2); 
-      } 
-      else if( dictEntry->GetVR() == "SQ" )
-      {
-         entry->SetLength( 0xffffffff );
-      }
-      else
-      {
-         entry->SetLength( entry->GetValue().length() );
-      }
       p->AddEntry( entry );
    }
 
@@ -639,7 +617,6 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type,
       entry     = new ValEntry( dictEntry ); // Be sure it's never a BinEntry !
 
       entry->SetOffset(0); // just to avoid further missprinting
-      entry->SetLength(0); // just to avoid further missprinting
 
       if( header )
       {
@@ -683,34 +660,8 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type,
             val = it->Value;
       }
 
-     // GDCM_UNFOUND or not !
-
       entry->SetValue( val ); // troubles expected when vr=SQ ...
 
-      if( dictEntry )
-      {
-         if( dictEntry->GetGroup() == 0xfffe )
-         {
-            entry->SetLength( entry->GetValue().length() ); // FIXME 
-         }
-         else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
-         {
-            entry->SetLength(4);
-         }
-         else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
-         {
-            entry->SetLength(2); 
-         }
-         else if( dictEntry->GetVR() == "SQ" )
-         {
-            entry->SetLength( 0xffffffff );
-         }
-         else
-         {
-            entry->SetLength( entry->GetValue().length() );
-         }
-      }
-
       if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
       {
          std::cout << "GDCM_DICOMDIR_META ?!? should never print that" 
index db99f950748ebbd65bd6ef302104b0ece52ea7de..1d3d8ce28a85857c1cd81a72b6592ad23ad62b90 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/07 09:32:24 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -99,28 +99,6 @@ void DicomDirObject::FillObject(ListDicomDirMetaElem const & elemList)
       entry->SetOffset(0); // just to avoid further missprinting
       entry->SetValue(it->Value);
 
-      // dealing with value length ...
-  
-      if(dictEntry->GetGroup()==0xfffe) 
-      {
-         entry->SetLength(entry->GetValue().length());
-      }
-      else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" ) 
-      {
-         entry->SetLength(4);
-      } 
-      else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" ) 
-      {
-         entry->SetLength(2); 
-      } 
-      else if( dictEntry->GetVR() == "SQ" )
-      {
-         entry->SetLength(0xffffffff);
-      }
-      else
-      {
-         entry->SetLength(entry->GetValue().length()); 
-      }
       AddEntry(entry);
    }   
 }   
index 60c002f2e7ac9b132a52394da37328779bbd517f..62d542d2ecb414ab3b015dd0d410e91fe465d18a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/06 12:54:40 $
-  Version:   $Revision: 1.148 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.149 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -839,7 +839,6 @@ std::string Document::GetEntryVRByName(TagName const& tagName)
 std::string Document::GetEntryByNumber(uint16_t group, uint16_t element)
 {
    TagKey key = DictEntry::TranslateToKey(group, element);
-   /// \todo use map methods, instead of multimap JPR
    if ( !TagHT.count(key))
    {
       return GDCM_UNFOUND;
@@ -919,9 +918,6 @@ bool Document::SetEntryByName( std::string const & content,
 bool Document::SetEntryByNumber(std::string const& content, 
                                 uint16_t group, uint16_t element) 
 {
-   int c;
-   int l;
-
    ValEntry* valEntry = GetValEntryByNumber(group, element);
    if (!valEntry )
    {
@@ -930,29 +926,7 @@ bool Document::SetEntryByNumber(std::string const& content,
       return false;
    }
    // Non even content must be padded with a space (020H)...
-   std::string finalContent = Util::DicomString( content.c_str() );
-   assert( !(finalContent.size() % 2) );
-   valEntry->SetValue(finalContent);
-
-   // Integers have a special treatement for their length:
-   l = finalContent.length();
-   if ( l != 0) // To avoid to be cheated by 'zero length' integers
-   {   
-      VRKey vr = valEntry->GetVR();
-      if( vr == "US" || vr == "SS" )
-      {
-         // for multivaluated items
-         c = Util::CountSubstring(content, "\\") + 1;
-         l = c*2;
-      }
-      else if( vr == "UL" || vr == "SL" )
-      {
-         // for multivaluated items
-         c = Util::CountSubstring(content, "\\") + 1;
-         l = c*4;;
-      }
-   }
-   valEntry->SetLength(l);
+   valEntry->SetValue(content);
    return true;
 } 
 
@@ -990,53 +964,6 @@ bool Document::SetEntryByNumber(uint8_t*content, int lgth,
    return true;
 } 
 
-/**
- * \brief   Accesses an existing DocEntry (i.e. a Dicom Element)
- *          in the PubDocEntrySet of this instance
- *          through it's (group, element) and modifies it's length with
- *          the given value.
- * \warning Use with extreme caution.
- * @param l new length to substitute with
- * @param group     group number of the Entry to modify
- * @param element element number of the Entry to modify
- * @return  true on success, false otherwise.
- */
-/*bool Document::SetEntryLengthByNumber(uint32_t l, 
-                                      uint16_t group, uint16_t element) 
-{
-   /// \todo use map methods, instead of multimap JPR
-   TagKey key = DictEntry::TranslateToKey(group, element);
-   if ( !TagHT.count(key) )
-   {
-      return false;
-   }
-   if ( l % 2 )
-   {
-      l++; // length must be even
-   }
-   ( ((TagHT.equal_range(key)).first)->second )->SetLength(l); 
-
-   return true ;
-}*/
-
-/**
- * \brief   Gets (from Header) the offset  of a 'non string' element value 
- *          (LoadElementValues has already be executed)
- * @param group   group number of the Entry 
- * @param elem  element number of the Entry
- * @return File Offset of the Element Value 
- */
-/*size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem) 
-{
-   DocEntry* entry = GetDocEntryByNumber(group, elem);
-   if (!entry) 
-   {
-      dbg.Verbose(1, "Document::GetDocEntryByNumber: no entry present.");
-      return 0;
-   }
-   return entry->GetOffset();
-}*/
-
 /**
  * \brief   Gets (from Header) a 'non string' element value 
  *          (LoadElementValues has already be executed)  
index 2df5f0bedcb205dcfdee6acdc49820168b3e529e..ed1d87d406b5a853c2ff4ee51768a0934a7be23b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:58 $
-  Version:   $Revision: 1.67 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.68 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -197,16 +197,6 @@ public:
                                  uint16_t group, uint16_t element);
    virtual bool SetEntryByNumber(uint8_t* content, int lgth,
                                  uint16_t group, uint16_t element);
-   // FIXME
-   // Verify the usefull of this method... otherwise remove it
-   // It's body is commented in the .xx
-   //virtual bool SetEntryLengthByNumber(uint32_t length,
-   //                                    uint16_t group, uint16_t element);
-
-   // FIXME
-   // Verify the usefull of this method... otherwise remove it
-   // It's body is commented in the .xx
-   // virtual size_t GetEntryOffsetByNumber(uint16_t group, uint16_t elem);
    virtual void* GetEntryBinAreaByNumber(uint16_t group, uint16_t elem);   
    // FIXME
    // Verify the usefull of this method... otherwise remove it
index 3de485f7c2057e172f551cbfa691f022e85f109f..43804b36618688ba894e783abefa4f94850b8ea6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/07 09:32:24 $
-  Version:   $Revision: 1.172 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.173 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -532,12 +532,10 @@ void File::SetWriteToDecompressed()
       if(HeaderInternal->HasLUT())
       {
          photInt->SetValue("PALETTE COLOR ");
-         photInt->SetLength(14);
       }
       else
       {
          photInt->SetValue("MONOCHROME1 ");
-         photInt->SetLength(12);
       }
 
       PixelWriteConverter->SetReadData(PixelReadConverter->GetDecompressed(),
@@ -561,15 +559,12 @@ void File::SetWriteToRGB()
       
       ValEntry* spp = CopyValEntry(0x0028,0x0002);
       spp->SetValue("3 ");
-      spp->SetLength(2);
 
       ValEntry* planConfig = CopyValEntry(0x0028,0x0006);
       planConfig->SetValue("0 ");
-      planConfig->SetLength(2);
 
       ValEntry* photInt = CopyValEntry(0x0028,0x0004);
       photInt->SetValue("RGB ");
-      photInt->SetLength(4);
 
       if(PixelReadConverter->GetRGB())
       {
@@ -607,15 +602,12 @@ void File::SetWriteToRGB()
       {
          ValEntry* bitsAlloc = CopyValEntry(0x0028,0x0100);
          bitsAlloc->SetValue("8 ");
-         bitsAlloc->SetLength(2);
 
          ValEntry* bitsStored = CopyValEntry(0x0028,0x0101);
          bitsStored->SetValue("8 ");
-         bitsStored->SetLength(2);
 
          ValEntry* highBit = CopyValEntry(0x0028,0x0102);
          highBit->SetValue("7 ");
-         highBit->SetLength(2);
 
          Archive->Push(bitsAlloc);
          Archive->Push(bitsStored);
@@ -661,7 +653,6 @@ void File::SetWriteFileTypeToExplicitVR()
 
    ValEntry* tss = CopyValEntry(0x0002,0x0010);
    tss->SetValue(ts);
-   tss->SetLength(ts.length());
 
    Archive->Push(tss);
 }
@@ -673,7 +664,6 @@ void File::SetWriteFileTypeToImplicitVR()
 
    ValEntry* tss = CopyValEntry(0x0002,0x0010);
    tss->SetValue(ts);
-   tss->SetLength(ts.length());
 }
 
 void File::RestoreWriteFileType()
@@ -705,7 +695,6 @@ void File::SetWriteToLibido()
 
    ValEntry *libidoCode = CopyValEntry(0x0008,0x0010);
    libidoCode->SetValue("ACRNEMA_LIBIDO_1.1");
-   libidoCode->SetLength(10);
    Archive->Push(libidoCode);
 }
 
@@ -718,7 +707,6 @@ void File::SetWriteToNoLibido()
       {
          ValEntry *libidoCode = CopyValEntry(0x0008,0x0010);
          libidoCode->SetValue("");
-         libidoCode->SetLength(0);
          Archive->Push(libidoCode);
       }
    }
index 1857184cd296669a1224afcd58f6985254bcbca0..9bef4bd08c26b596dbb4d9815f9041485ad35070 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/07 02:36:21 $
-  Version:   $Revision: 1.212 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.213 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -979,7 +979,7 @@ std::string Header::GetPixelType()
    {
       return "FD";
    }
-   if ( bitsAlloc == "12" )
+   else if ( bitsAlloc == "12" )
    {
       // It will be unpacked
       bitsAlloc = "16";
@@ -997,7 +997,7 @@ std::string Header::GetPixelType()
       dbg.Verbose(0, "Header::GetPixelType: unfound Pixel Representation");
       bitsAlloc = "0";
    }
-   if ( sign == "0" )
+   else if ( sign == "0" )
    {
       sign = "U";
    }
index 13af23674f3f1abb09a18b1c306a65f51cf81d86..a95d8d16201296d1b01dba8971be46552d92fc8e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/06 11:37:38 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.42 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -200,12 +200,10 @@ bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group,
          } 
          // we assume the constructor didn't fail
          entry = new ValEntry(dictEntry);
-
          if (entry)
          {
             entry->SetValue(val); 
          }
-         entry->SetLength(val.length());
          DocEntries.insert(i,entry);
 
          return true;
@@ -216,7 +214,6 @@ bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group,
          {
             entry->SetValue(val);
          }
-         (*i)->SetLength(val.length()); 
          return true;    
       }
    }
index d6d7b89dfa23f7a20debac870ddd46f93eecc639..270fdd3a047f92553a2f3d5681ed19b14691c87d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 15:46:12 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -17,6 +17,7 @@
 =========================================================================*/
 
 #include "gdcmValEntry.h"
+#include "gdcmVR.h"
 #include "gdcmTS.h"
 #include "gdcmGlobal.h"
 #include "gdcmUtil.h"
@@ -174,6 +175,39 @@ void ValEntry::Print(std::ostream & os)
    os << s.str();
 }
 
+//-----------------------------------------------------------------------------
+// Public
+void ValEntry::SetValue(std::string const & val)
+{
+   // Integers have a special treatement for their length:
+   int l = val.length();
+   if ( l != 0) // To avoid to be cheated by 'zero length' integers
+   {   
+      VRKey vr = GetVR();
+      if( vr == "US" || vr == "SS" )
+      {
+         // for multivaluated items
+         l = (Util::CountSubstring(val, "\\") + 1) * 2;
+      }
+      else if( vr == "UL" || vr == "SL" )
+      {
+         // for multivaluated items
+         l = (Util::CountSubstring(val, "\\") + 1) * 4;;
+      }
+      SetValueOnly(val);
+   }
+   else
+   {
+      std::string finalVal = Util::DicomString( val.c_str() );
+      assert( !(finalVal.size() % 2) );
+
+      l = finalVal.length();
+      SetValueOnly(finalVal);
+   }
+
+   SetLength(l);
+}
+
 /*
  * \brief   canonical Writer
  */
@@ -181,8 +215,6 @@ void ValEntry::WriteContent(std::ofstream* fp, FileType filetype)
 {
    DocEntry::WriteContent(fp, filetype);
 
-   //std::cout << "=====================================" << GetVR() << std::endl;
-      
    if ( GetGroup() == 0xfffe ) 
    {
       return; //delimitors have NO value
@@ -224,13 +256,10 @@ void ValEntry::WriteContent(std::ofstream* fp, FileType filetype)
       return;
    } 
 
-   assert( lgr == GetValue().size() ); 
+   assert( lgr == GetValue().length() );
    binary_write(*fp, GetValue());
 } 
 
-//-----------------------------------------------------------------------------
-// Public
-
 //-----------------------------------------------------------------------------
 // Protected
 
index b014e74b69df32189a14b7ef091541934b6d7c50..d83a18c18b38575d4557df73dc213117bfc3fa68 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:58 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.33 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,13 +43,17 @@ public:
    /// current Dicom Document Entry
    std::string const & GetValue() const { return Value; };
     
-   /// Sets the value (string) of the current Dicom Document Entry
-   void SetValue(std::string const & val) { Value = val; }; 
+   /// Sets the value (string) of the current Dicom Document Entry.
+   /// The size is updated
+   virtual void SetValue(std::string const & val);
 
    virtual void Print(std::ostream &os = std::cout); 
+
    virtual void WriteContent(std::ofstream *fp, FileType filetype);
 
 protected:
+   /// Sets the value (string) of the current Dicom Document Entry
+   void SetValueOnly(std::string const & val) { Value = val; }; 
    
 private:
 // Members :
index 580379cb96e92140cb0a862e1603948a3d90e0d7..584305bcebb3b4a66b685c567227178a90232bba 100644 (file)
@@ -58,7 +58,7 @@
 #include <vtkPointData.h>
 #include <vtkLookupTable.h>
 
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.60 $");
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.61 $");
 vtkStandardNewMacro(vtkGdcmReader);
 
 //-----------------------------------------------------------------------------
@@ -460,10 +460,10 @@ int vtkGdcmReader::CheckFileCoherence()
           && (type != "16U") && (type != "16S")
           && (type != "32U") && (type != "32S") )
       {
-         vtkErrorMacro(<< "Bad File Type for file" << filename->c_str());
-         vtkErrorMacro(<< "                      " << type.c_str());
-         vtkErrorMacro(<< "Removing this file from readed files "
-                        << filename->c_str());
+         vtkErrorMacro(<< "Bad File Type for file " << filename->c_str() << "\n"
+                       << "   File type found : " << type.c_str() 
+                       << " (might be 8U, 8S, 16U, 16S, 32U, 32S) \n"
+                       << "   Removing this file from readed files");
          *filename = "GDCM_UNREADABLE";
          continue;
       }
@@ -666,7 +666,6 @@ size_t vtkGdcmReader::LoadImageInMemory(
    {
       for (int line = 0; line < numLines; line++)
       {
-         cerr << line << endl;
          // Copy one line at proper destination:
          memcpy((void*)destination, (void*)source, lineSize);
          source      += lineSize;