]> Creatis software - gdcm.git/commitdiff
* Remove some useless methods in gdcm::Document, gdcm::Header and gdcm::File
authorregrain <regrain>
Fri, 26 Nov 2004 10:55:02 +0000 (10:55 +0000)
committerregrain <regrain>
Fri, 26 Nov 2004 10:55:02 +0000 (10:55 +0000)
   * Rename gdcmHeaderHelper.[h|cxx] to gdcmSerieHeader.[h|cxx] to be coherent
     between the class name and the file name
   -- BeNours

14 files changed:
ChangeLog
Example/WriteDicom.cxx
Testing/TestChangeHeader.cxx
Testing/TestCopyDicom.cxx
src/CMakeLists.txt
src/gdcm.h
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmFile.cxx
src/gdcmFile.h
src/gdcmHeader.cxx
src/gdcmHeader.h
src/gdcmSerieHeader.cxx [moved from src/gdcmHeaderHelper.cxx with 98% similarity]
src/gdcmSerieHeader.h [moved from src/gdcmHeaderHelper.h with 89% similarity]

index 3c1e7dccbfc27b38be1813904dcb5e30c6645d8c..aff435cc9774fa48a412ae95a9871e9e868ffbd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
+2004-11-26 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * Remove some useless methods in gdcm::Document, gdcm::Header and gdcm::File
+   * Rename gdcmHeaderHelper.[h|cxx] to gdcmSerieHeader.[h|cxx] to be coherent
+     between the class name and the file name
+
 2004-11-25 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
-   * src/ : fix compilation warnings for the Write method (2 different 
+   * src/ : fix compilation warnings for the Write method (2 different
      proto). So Rename 'Write(ifstream* fp' into 'WriteContent(ifstream* fp'
      fix compilation warnings for the gdcm::Document::TransferSyntaxStrings
      variable... create a static method in gdcm::Document to access to
@@ -8,7 +13,7 @@
 2004-11-25 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
    * src/gdcmDocument.[h|cxx] : set the Transfert Syntax values to the header
      file, to be accessed by other files (like gdcmFile). Remove commented
-     code. Move the change of the header to the gdcmFile, using the 
+     code. Move the change of the header to the gdcmFile, using the
      DocEntryArchive
    * src/gdcmHeader.[h|cxx] : the write is completely made in the Header.
      To be sure of that (and simplify calls), the Write of the header now
index c8747dc3a3251abc7a6526d173aa4ba82427bae6..7116f734fceaefaaa7065440b17675711d50e015 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/16 04:26:18 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2004/11/26 10:55:03 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -61,7 +61,6 @@ int main(int argc, char* argv[])
 
   // TODO : Shouldn't we merge those two functions ?
   f1->SetImageData( imageData, dataSize);
-  f1->GetHeader()->SetImageDataSize( dataSize );
 
   f1->GetHeader()->Print();
 
index 3f87352475779be320751a78d4bf5383797666c4..3fb0ab9a448bfdfa3d141e71462b652acca9d73e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestChangeHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/16 04:28:20 $
-  Version:   $Revision: 1.26 $
+  Date:      $Date: 2004/11/26 10:55:03 $
+  Version:   $Revision: 1.27 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -83,7 +83,6 @@ int TestChangeHeader(int argc, char* argv[])
 // TODO : Why don't we merge theese 2 functions ?
 
    f1->SetImageData(imageData,dataSize);
-   f1->GetHeader()->SetImageDataSize(dataSize);
 
    f1->GetHeader()->Print();
 
index c7e74012b8445b8e7efa9ce1c22f625ed6b673c7..cfbbfcdff277dd1305290f5ccc702591b25a82cc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 10:24:33 $
-  Version:   $Revision: 1.22 $
+  Date:      $Date: 2004/11/26 10:55:03 $
+  Version:   $Revision: 1.23 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -129,8 +129,6 @@ int CopyDicom(std::string const & filename,
       // Useless to set the image datas, because it's already made when
       // copying the corresponding BinEntry that contains the pixel datas
       copy->SetImageData(imageData, dataSize);
-//      copy->GetImageData();
-//      original->GetHeader()->SetImageDataSize(dataSize);
 
       //////////////// Step 3:
       std::cout << "3...";
index b52f680acdfcea59fa8776e4240d9b69f8eddf2a..bbdd6693db7995aed7d1660f6c7cf3a75552484d 100644 (file)
@@ -33,7 +33,6 @@ SET(libgdcm_la_SOURCES
    gdcmFile.cxx
    gdcmGlobal.cxx
    gdcmHeader.cxx
-   gdcmHeaderHelper.cxx
    gdcmJPEGFragment.cxx
    gdcmJPEGFragmentsInfo.cxx
    gdcmJpeg8.cxx
@@ -44,6 +43,7 @@ SET(libgdcm_la_SOURCES
    gdcmRLEFrame.cxx
    gdcmRLEFramesInfo.cxx
    gdcmSeqEntry.cxx
+   gdcmSerieHeader.cxx
    gdcmSQItem.cxx
    gdcmTS.cxx
    gdcmUtil.cxx
index 05ecafd489a723c2090ef8b1cc1111222688b4e2..8408d4f8a275de16a1ffd10d6d316f4cd9b42f39 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcm.h,v $
   Language:  C++
-  Date:      $Date: 2004/09/27 08:39:05 $
-  Version:   $Revision: 1.49 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.50 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -31,7 +31,7 @@
 
 #include "gdcmDocument.h"
 #include "gdcmHeader.h"
-#include "gdcmHeaderHelper.h"
+#include "gdcmSerieHeader.h"
 #include "gdcmFile.h"
 
 #include "gdcmUtil.h"
index 0d32d8fc66d0c655e67a4dfbf2a5a0a4e3b87b4e..a26f291edc4ebf3b1392c682f2330db799bb2809 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 16:35:16 $
-  Version:   $Revision: 1.141 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.142 $
                                                                                 
   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 @@ bool Document::SetEntryByNumber(uint8_t*content, int lgth,
  * @param element element number of the Entry to modify
  * @return  true on success, false otherwise.
  */
-bool Document::SetEntryLengthByNumber(uint32_t l, 
+/*bool Document::SetEntryLengthByNumber(uint32_t l, 
                                       uint16_t group, uint16_t element) 
 {
    /// \todo use map methods, instead of multimap JPR
@@ -995,7 +995,7 @@ bool Document::SetEntryLengthByNumber(uint32_t l,
    ( ((TagHT.equal_range(key)).first)->second )->SetLength(l); 
 
    return true ;
-}
+}*/
 
 /**
  * \brief   Gets (from Header) the offset  of a 'non string' element value 
@@ -1004,7 +1004,7 @@ bool Document::SetEntryLengthByNumber(uint32_t l,
  * @param elem  element number of the Entry
  * @return File Offset of the Element Value 
  */
-size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem) 
+/*size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem) 
 {
    DocEntry* entry = GetDocEntryByNumber(group, elem);
    if (!entry) 
@@ -1013,7 +1013,7 @@ size_t Document::GetEntryOffsetByNumber(uint16_t group, uint16_t elem)
       return 0;
    }
    return entry->GetOffset();
-}
+}*/
 
 /**
  * \brief   Gets (from Header) a 'non string' element value 
@@ -1056,30 +1056,6 @@ void Document::LoadEntryBinArea(uint16_t group, uint16_t elem)
       return;
 
    LoadEntryBinArea(binElement);
-/*   size_t o =(size_t)docElement->GetOffset();
-   Fp->seekg( o, std::ios_base::beg);
-   size_t l = docElement->GetLength();
-   uint8_t* a = new uint8_t[l];
-   if(!a)
-   {
-      dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
-      return;
-   }
-
-   // Read the value
-   Fp->read((char*)a, l);
-   if( Fp->fail() || Fp->eof() )//Fp->gcount() == 1
-   {
-      delete[] a;
-      return;
-   }
-
-   // Set the value to the DocEntry
-   if( !SetEntryBinAreaByNumber( a, group, elem ) )
-   {
-      delete[] a;
-      dbg.Verbose(0, "Document::LoadEntryBinArea setting failed.");
-   }*/
 }
 
 /**
@@ -1128,7 +1104,7 @@ void Document::LoadEntryBinArea(BinEntry* element)
  * @param   element Element number of the searched Dicom Element 
  * @return  
  */
-bool Document::SetEntryBinAreaByNumber(uint8_t* area,
+/*bool Document::SetEntryBinAreaByNumber(uint8_t* area,
                                        uint16_t group, uint16_t element) 
 {
    DocEntry* currentEntry = GetDocEntryByNumber(group, element);
@@ -1144,7 +1120,7 @@ bool Document::SetEntryBinAreaByNumber(uint8_t* area,
    }
 
    return false;
-}
+}*/
 
 /**
  * \brief   Update the entries with the shadow dictionary. 
index 9682e57ba0f2bb6f68828e7b2af3be6dbffa1331..7e4e8d9901c6e5acb2151e3aa90c2737311df69c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 16:35:17 $
-  Version:   $Revision: 1.65 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.66 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -196,19 +196,28 @@ public:
    virtual std::string GetEntryVRByNumber(uint16_t group, uint16_t elem);
    virtual int     GetEntryLengthByNumber(uint16_t group, uint16_t elem);
 //protected:
-   virtual bool SetEntryByName  ( std::string const & content, 
-                                  TagName const & tagName );
+   virtual bool SetEntryByName  (std::string const & content, 
+                                 TagName const & tagName );
    virtual bool SetEntryByNumber(std::string const & content,
                                  uint16_t group, uint16_t element);
    virtual bool SetEntryByNumber(uint8_t* content, int lgth,
                                  uint16_t group, uint16_t element);
-   virtual bool SetEntryLengthByNumber(uint32_t length,
-                                       uint16_t group, uint16_t element);
-
-   virtual size_t GetEntryOffsetByNumber(uint16_t group, uint16_t elem);
+   // 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);   
-   virtual bool  SetEntryBinAreaByNumber(uint8_t* a, uint16_t group,
-                                                   uint16_t elem);
+   // FIXME
+   // Verify the usefull of this method... otherwise remove it
+   // It's body is commented in the .xx
+   //virtual bool  SetEntryBinAreaByNumber(uint8_t* a, uint16_t group,
+   //                                                uint16_t elem);
 
    virtual void UpdateShaEntries();
 
index f362a3d9bc17541bf61f1a0eb5557f85581e30fb..ca361e54cf377fe0fc2f589b3566581d6e9b2b90 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 16:35:17 $
-  Version:   $Revision: 1.165 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.166 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -772,23 +772,6 @@ BinEntry* File::CopyBinEntry(uint16_t group,uint16_t element)
 
 //-----------------------------------------------------------------------------
 // Private
-/**
- * \brief Set the pixel datas in the good entry of the Header
- */
-void File::SetPixelData(uint8_t* data)
-{
-   GetHeader()->SetEntryByNumber( GDCM_BINLOADED,
-      GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
-
-   // Will be 7fe0, 0010 in standard case
-   DocEntry* currentEntry = GetHeader()->GetDocEntryByNumber(GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
-   if ( currentEntry )
-   {
-      if ( BinEntry* binEntry = dynamic_cast<BinEntry *>(currentEntry) )
-         // Flag is to false because datas are kept in the gdcmPixelConvert
-         binEntry->SetBinArea( data, false );
-   }
-}
 
 //-----------------------------------------------------------------------------
 } // end namespace gdcm
index 02eaae758134333b59e2504e727b01e36c82647f..7637b7bd8d489cc2bf98f3765737c67c5bccc5a2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.h,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 13:12:02 $
-  Version:   $Revision: 1.77 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.78 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -68,7 +68,6 @@ public:
    uint8_t* GetImageDataRaw();
    size_t GetImageDataIntoVector(void* destination, size_t maxSize);
 
-   // see also Header::SetImageDataSize ?!?         
    bool SetImageData (uint8_t* data, size_t expectedSize);
 
    // Write pixels of ONE image on hard drive
@@ -129,8 +128,6 @@ private:
    uint8_t* GetDecompressed();
    int ComputeDecompressedPixelDataSizeFromHeader();
 
-   void SetPixelData(uint8_t* data);
-
 private:
 // members variables:
 
index 6e43c2bc97799b803ec597040f832ddd09f1052b..2ccd0ac183d4a798164a298af7bf0be47e76c2ed 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 15:46:11 $
-  Version:   $Revision: 1.207 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.208 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1176,28 +1176,6 @@ std::string Header::GetTransfertSyntaxName()
    return tsName;
 }
 
-/**
- * \brief Sets the Pixel Area size in the Header
- *        --> not-for-rats function
- * @param ImageDataSize new Pixel Area Size
- *        warning : nothing else is checked
- */
-void Header::SetImageDataSize(size_t ImageDataSize)
-{
-   ///FIXME I don't understand this code why do we set two times 'car' ?
-   std::string car = Util::Format("%d", ImageDataSize);
-   DocEntry *a = GetDocEntryByNumber(GrPixel, NumPixel);
-   a->SetLength(ImageDataSize);
-
-   // Change the value of the BinEntry, not the BinArea !!!
-   ImageDataSize += 8;
-   car = Util::Format("%d", ImageDataSize);
-   car = Util::DicomString( car.c_str() );
-
-   SetEntryByNumber(car, GrPixel, NumPixel);
-}
-
 //-----------------------------------------------------------------------------
 // Protected
 
index cbd36527205e66477f2cdeb1823967515084d3f8..de5acd13d83e36c508717e095eddd014daca2195 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.h,v $
   Language:  C++
-  Date:      $Date: 2004/11/25 13:12:02 $
-  Version:   $Revision: 1.94 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.95 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -169,9 +169,6 @@ public:
    /// Accessor to \ref Header::NumPixel
    uint16_t GetNumPixel() { return NumPixel; }
 
-   /// Read (used in File)
-   void SetImageDataSize(size_t expectedSize);
-
    bool Write(std::string fileName, FileType filetype);
 
    /// Initialize DICOM header when none
similarity index 98%
rename from src/gdcmHeaderHelper.cxx
rename to src/gdcmSerieHeader.cxx
index 77d4d1662682eef9a897e0664f4b6fefd17e2e25..37da36b1bf5663664395f7e3d093f17f887494a1 100644 (file)
@@ -1,10 +1,10 @@
 /*=========================================================================
                                                                                 
   Program:   gdcm
-  Module:    $RCSfile: gdcmHeaderHelper.cxx,v $
+  Module:    $RCSfile: gdcmSerieHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/16 18:33:33 $
-  Version:   $Revision: 1.45 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.1 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -16,7 +16,7 @@
                                                                                 
 =========================================================================*/
 
-#include "gdcmHeaderHelper.h"
+#include "gdcmSerieHeader.h"
 #include "gdcmDirList.h"
 #include "gdcmDebug.h"
 
similarity index 89%
rename from src/gdcmHeaderHelper.h
rename to src/gdcmSerieHeader.h
index 5dc42bfc916e123e479e13b4da4c32380f6fc559..6b062296e03a618eab948f545fac3593f652c75f 100644 (file)
@@ -1,10 +1,10 @@
 /*=========================================================================
                                                                                 
   Program:   gdcm
-  Module:    $RCSfile: gdcmHeaderHelper.h,v $
+  Module:    $RCSfile: gdcmSerieHeader.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:46 $
-  Version:   $Revision: 1.22 $
+  Date:      $Date: 2004/11/26 10:55:04 $
+  Version:   $Revision: 1.1 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -16,8 +16,8 @@
                                                                                 
 =========================================================================*/
 
-#ifndef GDCMHEADERHELPER_H
-#define GDCMHEADERHELPER_H
+#ifndef GDCMSERIEHEADER_H
+#define GDCMSERIEHEADER_H
 
 #include "gdcmHeader.h"
 
@@ -30,7 +30,7 @@ namespace gdcm
  * \brief  
  *
  * - This class should be used for a stack of 2D dicom images.
- * - For a multiframe dicom image better use directly HeaderHelper
+ * - For a multiframe dicom image better use directly SerieHeader
 */
 class GDCM_EXPORT SerieHeader 
 {