]> Creatis software - gdcm.git/commitdiff
methods ReplaceOrCreate renamed as Insert
authorjpr <jpr>
Mon, 24 Jan 2005 16:44:53 +0000 (16:44 +0000)
committerjpr <jpr>
Mon, 24 Jan 2005 16:44:53 +0000 (16:44 +0000)
(nobody will be any longer confused by 'CreateOeReplace')

15 files changed:
Example/TestChangeHeader.cxx
Example/TestCopyDicom.cxx
Example/TestFromScratch.cxx
Example/TestPapyrus.cxx
Example/WriteDicom.cxx
Example/WriteDicomSimple.cxx
Testing/TestChangeHeader.cxx
Testing/TestCopyDicom.cxx
Testing/TestCopyRescaleDicom.cxx
Testing/TestWriteSimple.cxx
src/gdcmDocument.h
src/gdcmFile.cxx
src/gdcmFileHelper.cxx
src/gdcmFileHelper.h
src/gdcmSQItem.cxx

index 50c73775f2f57b77ead3c8dc2f6e3de8d0959b12..89073f51e87fcf8228feb3bb07bdfde2bc29b6f2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestChangeHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:49 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,7 +44,7 @@ int main(int argc, char* argv[])
     if(matrix != "gdcm::Unfound")
     {
        std::cerr << "Aquisition Matrix:" << matrix << std::endl;
-       f1->GetFile()->ReplaceOrCreate( matrix, 0x0018, 0x1310);
+       f1->GetFile()->Insert( matrix, 0x0018, 0x1310);
     }
 
     f1->GetImageData();
index c69b525588d816f65e12406c8861e8a88769534c..37005844279a0d24147f1e743704dfce9b822667 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:52 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.21 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
       {
          if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
          {              
-            copy->GetFile()->ReplaceOrCreate
+            copy->GetFile()->Insert
                                  b->GetBinArea(),
                                  b->GetLength(),
                                  b->GetGroup(), 
@@ -113,7 +113,7 @@ int main(int argc, char* argv[])
          }
          else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
          {   
-            copy->GetFile()->ReplaceOrCreate
+            copy->GetFile()->Insert
                                  v->GetValue(),
                                  v->GetGroup(), 
                                  v->GetElement(),
index b11919ccbc587d8d62120d1110cf02ad7bf25dbb..29099d77772e0f072eaa176283fad74cf8dc314f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestFromScratch.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:52 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -62,11 +62,10 @@ int main(int argc, char *argv[])
          // Do not bother with field from private dict
          if( v->GetName() != "gdcm::Unknown" )
          {  
-            h2->ReplaceOrCreate( 
-                              v->GetValue(),
-                              v->GetGroup(), 
-                              v->GetElement(),
-                              v->GetVR() ); 
+            h2->Insert( v->GetValue(),
+                        v->GetGroup(), 
+                        v->GetElement(),
+                        v->GetVR() ); 
          }
       }
       //else
index 31d0e274c8bac98e252c810b15e21c93aa62ed51..e0b5dd1330f005cb1db271b15558b6c07ff2406f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestPapyrus.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:49 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  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
@@ -231,23 +231,23 @@ int main(int argc, char* argv[])
    gdcm::File *n = new gdcm::File();
    n->InitializeDefaultFile();
 
-   n->ReplaceOrCreate(MediaStSOPinstUID,  0x0002,0x0002);
+   n->Insert(MediaStSOPinstUID,  0x0002,0x0002);
   // Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian)
   // since using Papyrus one (Implicit VR Little Endian) is a mess
-   //n->ReplaceOrCreate(TransferSyntax,     0x0002,0x0010);
-   n->ReplaceOrCreate(StudyDate,          0x0008,0x0020);
-   n->ReplaceOrCreate(StudyTime,          0x0008,0x0030);
-   n->ReplaceOrCreate(Modality,           0x0008,0x0060);
-   n->ReplaceOrCreate(PatientName,        0x0010,0x0010);
-
-   n->ReplaceOrCreate(SamplesPerPixel,    0x0028,0x0002);
-   n->ReplaceOrCreate(NumberOfFrames,     0x0028,0x0008);
-   n->ReplaceOrCreate(Rows,               0x0028,0x0010);
-   n->ReplaceOrCreate(Columns,            0x0028,0x0011);
-   n->ReplaceOrCreate(BitsAllocated,      0x0028,0x0100);
-   n->ReplaceOrCreate(BitsStored,         0x0028,0x0101);
-   n->ReplaceOrCreate(HighBit,            0x0028,0x0102);
-   n->ReplaceOrCreate(PixelRepresentation,0x0028,0x0102);
+   //n->Insert(TransferSyntax,     0x0002,0x0010);
+   n->Insert(StudyDate,          0x0008,0x0020);
+   n->Insert(StudyTime,          0x0008,0x0030);
+   n->Insert(Modality,           0x0008,0x0060);
+   n->Insert(PatientName,        0x0010,0x0010);
+
+   n->Insert(SamplesPerPixel,    0x0028,0x0002);
+   n->Insert(NumberOfFrames,     0x0028,0x0008);
+   n->Insert(Rows,               0x0028,0x0010);
+   n->Insert(Columns,            0x0028,0x0011);
+   n->Insert(BitsAllocated,      0x0028,0x0100);
+   n->Insert(BitsStored,         0x0028,0x0101);
+   n->Insert(HighBit,            0x0028,0x0102);
+   n->Insert(PixelRepresentation,0x0028,0x0102);
 
    // create the file
    gdcm::FileHelper *file = new gdcm::FileHelper(n);
index f71e03d1c957e9d4a1829b49a559d85cf60f79dc..50ee73574ecbf2298e18e4a2d31166e73f75a3b9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:49 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -41,12 +41,12 @@ int main(int argc, char* argv[])
  
    std::string nbFrames = f2->GetFile()->GetEntryValue(0x0028, 0x0008);
    if(nbFrames != "gdcm::Unfound") {
-       f1->GetFile()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
+       f1->GetFile()->Insert( nbFrames, 0x0028, 0x0008);
    }
           
-   f1->GetFile()->ReplaceOrCreate(
+   f1->GetFile()->Insert(
      f2->GetFile()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
-   f1->GetFile()->ReplaceOrCreate
+   f1->GetFile()->Insert
      f2->GetFile()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
  
    // Some other tags should be updated:
index 97bfe6dc14c8a6ee3802ba56b8134ae28c190d41..78b94565943deae0d043f992f0f9d5b2da8c4c3c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicomSimple.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:53 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -63,39 +63,39 @@ int main(int argc, char* argv[])
    // Set the image size
    str.str("");
    str << SIZE_X;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns
+   header->Insert(str.str(),0x0028,0x0011); // Columns
 
    str.str("");
    str << SIZE_Y;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows
+   header->Insert(str.str(),0x0028,0x0010); // Rows
 
    // Set the pixel type
    str.str("");
    str << COMPONENT_SIZE * 8;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated
-   header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored
+   header->Insert(str.str(),0x0028,0x0100); // Bits Allocated
+   header->Insert(str.str(),0x0028,0x0101); // Bits Stored
 
    str.str("");
    str << COMPONENT_SIZE * 8 - 1;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit
+   header->Insert(str.str(),0x0028,0x0102); // High Bit
 
    // Set the pixel representation
    str.str("");
    str << "0"; // Unsigned
-   header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation
+   header->Insert(str.str(),0x0028,0x0103); // Pixel Representation
 
    // Set the samples per pixel
    str.str("");
    str << COMPONENT;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel
+   header->Insert(str.str(),0x0028,0x0002); // Samples per Pixel
 
    // Set the Window / Level
    str.str("");
    str << COLOR_WINDOW;
-   header->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width
+   header->Insert(str.str(),0x0028,0x1051); // Window Width
    str.str("");
    str << COLOR_LEVEL;
-   header->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center
+   header->Insert(str.str(),0x0028,0x1050); // Window Center
 
    if( !header->IsReadable() )
    {
index 3528375aaaef5a06ec7d7910790d527b820d3383..40893a3faaa8e5814a287a8c84440752974b166b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestChangeHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:50 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2005/01/24 16:44:53 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,7 +44,7 @@ int TestChangeHeader(int argc, char* argv[])
    std::string nbFrames = f2->GetHeader()->GetEntryValue(0x0028, 0x0008);
    if(nbFrames != "gdcm::Unfound")
    {
-      f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
+      f1->GetHeader()->Insert( nbFrames, 0x0028, 0x0008);
    }
 
 
@@ -57,17 +57,17 @@ int TestChangeHeader(int argc, char* argv[])
 // It was not designed as a 'Test' program, but as a utility
 // provided to 'transform' an image 'Siemens MRI New version' into an image 'Siemens MRI old version'
          
-   f1->GetHeader()->ReplaceOrCreate(
+   f1->GetHeader()->Insert(
       f2->GetHeader()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010);// nbLig
-   f1->GetHeader()->ReplaceOrCreate
+   f1->GetHeader()->Insert
       f2->GetHeader()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011);// nbCol
-   f1->GetHeader()->ReplaceOrCreate
+   f1->GetHeader()->Insert
       f2->GetHeader()->GetEntryValue(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated
-   f1->GetHeader()->ReplaceOrCreate
+   f1->GetHeader()->Insert
       f2->GetHeader()->GetEntryValue(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored
-   f1->GetHeader()->ReplaceOrCreate
+   f1->GetHeader()->Insert
       f2->GetHeader()->GetEntryValue(0x0028, 0x0102), 0x0028, 0x0102);// HighBit
-   f1->GetHeader()->ReplaceOrCreate
+   f1->GetHeader()->Insert
       f2->GetHeader()->GetEntryValue(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation
 // Probabely some more to update (?)
 
index 6d60f60994079acb17ef896b287c0e4fea81475b..7d0b74b969051afa34a873be5665ef237a3326e0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:50 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -83,20 +83,18 @@ int CopyDicom(std::string const & filename,
       {
          if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
          {
-            copyH->ReplaceOrCreate( 
-                                 b->GetBinArea(),
-                                 b->GetLength(),
-                                 b->GetGroup(), 
-                                 b->GetElement(),
-                                 b->GetVR() );
+            copyH->Insert( b->GetBinArea(),
+                           b->GetLength(),
+                           b->GetGroup(), 
+                           b->GetElement(),
+                           b->GetVR() );
          }
          else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
          {   
-             copyH->ReplaceOrCreate( 
-                                 v->GetValue(),
-                                 v->GetGroup(), 
-                                 v->GetElement(),
-                                 v->GetVR() ); 
+             copyH->Insert( v->GetValue(),
+                            v->GetGroup(), 
+                            v->GetElement(),
+                            v->GetVR() ); 
          }
          else
          {
index 961ea797c15cd22600efc007f3720f32755a38dd..eaff8b4c891e5678c8118a40243e90d0d98758df 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestCopyRescaleDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:50 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -56,7 +56,7 @@ int CopyRescaleDicom(std::string const & filename,
    {
       if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
       {
-         copyH->ReplaceOrCreate
+         copyH->Insert
                               b->GetBinArea(),
                               b->GetLength(),
                               b->GetGroup(), 
@@ -65,7 +65,7 @@ int CopyRescaleDicom(std::string const & filename,
       }
       else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
       {   
-          copyH->ReplaceOrCreate
+          copyH->Insert
                               v->GetValue(),
                               v->GetGroup(), 
                               v->GetElement(),
@@ -91,10 +91,10 @@ int CopyRescaleDicom(std::string const & filename,
    if( bitsStored == "16" )
    {
       std::cout << "Rescale...";
-      copyH->ReplaceOrCreate( "8", 0x0028, 0x0100); // BitsAllocated
-      copyH->ReplaceOrCreate( "8", 0x0028, 0x0101); // BitsStored
-      copyH->ReplaceOrCreate( "7", 0x0028, 0x0102); // HighBit
-      copyH->ReplaceOrCreate( "0", 0x0028, 0x0103); //Pixel Representation
+      copyH->Insert( "8", 0x0028, 0x0100); // BitsAllocated
+      copyH->Insert( "8", 0x0028, 0x0101); // BitsStored
+      copyH->Insert( "7", 0x0028, 0x0102); // HighBit
+      copyH->Insert( "0", 0x0028, 0x0103); //Pixel Representation
  
       // We assume the value were from 0 to uint16_t max
       rescaleSize = dataSize / 2;
index 1399e339c3c95d5d42cd075a144b7d385cc6be72..edd8ba0df2fd33590234cb414171f14a169be2fb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestWriteSimple.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/21 11:40:54 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -77,41 +77,41 @@ int WriteSimple(Image &img)
    // Set the image size
    str.str("");
    str << img.sizeX;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns
+   header->Insert(str.str(),0x0028,0x0011); // Columns
 
    str.str("");
    str << img.sizeY;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows
+   header->Insert(str.str(),0x0028,0x0010); // Rows
 
    if(img.sizeZ>1)
    {
       str.str("");
       str << img.sizeZ;
-      header->ReplaceOrCreate(str.str(),0x0028,0x0008); // Number of Frames
+      header->Insert(str.str(),0x0028,0x0008); // Number of Frames
    }
 
    // Set the pixel type
    str.str("");
    str << img.componentSize;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated
+   header->Insert(str.str(),0x0028,0x0100); // Bits Allocated
 
    str.str("");
    str << img.componentUse;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored
+   header->Insert(str.str(),0x0028,0x0101); // Bits Stored
 
    str.str("");
    str << img.componentSize - 1;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit
+   header->Insert(str.str(),0x0028,0x0102); // High Bit
 
    // Set the pixel representation
    str.str("");
    str << img.sign;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation
+   header->Insert(str.str(),0x0028,0x0103); // Pixel Representation
 
    // Set the samples per pixel
    str.str("");
    str << img.components;
-   header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel
+   header->Insert(str.str(),0x0028,0x0002); // Samples per Pixel
 
    if( !header->IsReadable() )
    {
index 11cd6f5c9e0e31b8b974cb85c27a7abb16a9e8c0..7082c7554a28f0c5a3b93f244c71831c0bea37bb 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:52 $
-  Version:   $Revision: 1.99 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.100 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -104,13 +104,13 @@ public:
    virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
    virtual int GetEntryLength(uint16_t group, uint16_t elem);
 
-   ValEntry *ReplaceOrCreate(std::string const &value,
-                             uint16_t group, uint16_t elem,
-                             TagName const &vr = GDCM_UNKNOWN);
-   BinEntry *ReplaceOrCreate(uint8_t *binArea, int lgth,
-                             uint16_t group, uint16_t elem,
-                             TagName const &vr = GDCM_UNKNOWN);
-   SeqEntry *ReplaceOrCreate(uint16_t group, uint16_t elem);
+   ValEntry *Insert(std::string const &value,
+                    uint16_t group, uint16_t elem,
+                    TagName const &vr = GDCM_UNKNOWN);
+   BinEntry *Insert(uint8_t *binArea, int lgth,
+                    uint16_t group, uint16_t elem,
+                    TagName const &vr = GDCM_UNKNOWN);
+   SeqEntry *Insert(uint16_t group, uint16_t elem);
 
    bool ReplaceIfExist(std::string const &value,
                        uint16_t group, uint16_t elem );
index 5e6941c16c0074e2c96b13307dc17f4c9ec33dc1..9e6788e6dc945d4df6e31f1448831cd955cd3e1d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:52 $
-  Version:   $Revision: 1.198 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.199 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -151,7 +151,7 @@ bool File::Write(std::string fileName, FileType filetype)
       // no (GrPixel, NumPixel) element
       std::string s_lgPix = Util::Format("%d", i_lgPix+12);
       s_lgPix = Util::DicomString( s_lgPix.c_str() );
-      ReplaceOrCreate(s_lgPix,GrPixel, 0x0000);
+      Insert(s_lgPix,GrPixel, 0x0000);
    }
 
    // FIXME : should be nice if we could move it to File
@@ -1220,11 +1220,11 @@ bool File::AnonymizeFile()
       std::string studyInstanceUID =  GetEntryValue (0x0020, 0x000d);
       if ( studyInstanceUID != GDCM_UNFOUND )
       {
-         ReplaceOrCreate(studyInstanceUID, 0x0010, 0x0010);
+         Insert(studyInstanceUID, 0x0010, 0x0010);
       }
       else
       {
-         ReplaceOrCreate("anonymised", 0x0010, 0x0010);
+         Insert("anonymised", 0x0010, 0x0010);
       }
    }
 
@@ -1380,14 +1380,14 @@ void File::InitializeDefaultFile()
    // Special case this is the image (not a string)
    GrPixel = 0x7fe0;
    NumPixel = 0x0010;
-   ReplaceOrCreate(0, 0, GrPixel, NumPixel);
+   Insert(0, 0, GrPixel, NumPixel);
 
    // All remaining strings:
    unsigned int i = 0;
    DICOM_DEFAULT_VALUE current = defaultvalue[i];
    while( current.value )
    {
-      ReplaceOrCreate(current.value, current.group, current.elem);
+      Insert(current.value, current.group, current.elem);
       current = defaultvalue[++i];
    }
 }
index 30a191f796c1fbb83c707c24f7ba374abc991173..03e85e1f9c9b52b21595b9ed680a48acbc32406f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:52 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  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
@@ -527,7 +527,7 @@ bool FileHelper::Write(std::string const &fileName)
  *          through it's (group, element) and modifies it's content with
  *          the given value.
  * @param   content new value (string) to substitute with
- * @param   group     group number of the Dicom Element to modify
+ * @param   group  group number of the Dicom Element to modify
  * @param   elem element number of the Dicom Element to modify
  */
 bool FileHelper::SetEntryValue(std::string const &content,
@@ -547,7 +547,7 @@ bool FileHelper::SetEntryValue(std::string const &content,
  * @param   elem element number of the Dicom Element to modify
  */
 bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth,
-                    uint16_t group, uint16_t elem)
+                                 uint16_t group, uint16_t elem)
 {
    return FileInternal->SetEntryBinArea(content,lgth,group,elem);
 }
@@ -561,10 +561,10 @@ bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth,
  * \return  pointer to the modified/created Dicom entry (NULL when creation
  *          failed).
  */ 
-bool FileHelper::ReplaceOrCreate(std::string const &content,
-                           uint16_t group, uint16_t elem)
+bool FileHelper::Insert(std::string const &content,
+                        uint16_t group, uint16_t elem)
 {
-   return FileInternal->ReplaceOrCreate(content,group,elem) != NULL;
+   return FileInternal->Insert(content,group,elem) != NULL;
 }
 
 /*
@@ -577,10 +577,10 @@ bool FileHelper::ReplaceOrCreate(std::string const &content,
  * \return  pointer to the modified/created Dicom entry (NULL when creation
  *          failed).
  */
-bool FileHelper::ReplaceOrCreate(uint8_t *binArea, int lgth,
-                           uint16_t group, uint16_t elem)
+bool FileHelper::Insert(uint8_t *binArea, int lgth,
+                        uint16_t group, uint16_t elem)
 {
-   return FileInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL;
+   return FileInternal->Insert(binArea,lgth,group,elem) != NULL;
 }
 
 /**
index 5eae1d58c972d6699dbe64d5c7c99f45fd0f347b..7752d395b137839dc256bf0a90976436415482d6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:52 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -87,13 +87,13 @@ public:
    bool Write         (std::string const &fileName);
 
    bool SetEntryValue(std::string const &content,
-                 uint16_t group, uint16_t elem);
+                      uint16_t group, uint16_t elem);
    bool SetEntryBinArea(uint8_t *content, int lgth,
-                 uint16_t group, uint16_t elem);
-   bool ReplaceOrCreate(std::string const &content,
-                        uint16_t group, uint16_t elem);
-   bool ReplaceOrCreate(uint8_t *binArea, int lgth,
                         uint16_t group, uint16_t elem);
+   bool Insert(std::string const &content,
+               uint16_t group, uint16_t elem);
+   bool Insert(uint8_t *binArea, int lgth,
+               uint16_t group, uint16_t elem);
 
    uint8_t* GetLutRGBA();
 
index 7ca6d20260f73dd09e72b3fce3ca809c2cc6585b..b63b376a44d153d512b895742fd5cb6f9be9c9b6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSQItem.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/24 16:10:53 $
-  Version:   $Revision: 1.57 $
+  Date:      $Date: 2005/01/24 16:44:54 $
+  Version:   $Revision: 1.58 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -184,8 +184,7 @@ bool SQItem::SetEntryValue(std::string const &val, uint16_t group,
       if (  ( group  < (*i)->GetGroup() )
           ||( group == (*i)->GetGroup() && elem < (*i)->GetElement()) )
       {
-         // instead of ReplaceOrCreate 
-         // that is a method of Document :-( 
+         // instead of Insert, that is a method of Document :-( 
          ValEntry* entry = 0;
          TagKey key = DictEntry::TranslateToKey(group, elem);