From be54aab0103af7dee1a3bb5b8b3ee93b59ca9073 Mon Sep 17 00:00:00 2001 From: jpr Date: Mon, 24 Jan 2005 16:44:53 +0000 Subject: [PATCH] methods ReplaceOrCreate renamed as Insert (nobody will be any longer confused by 'CreateOeReplace') --- Example/TestChangeHeader.cxx | 6 +++--- Example/TestCopyDicom.cxx | 8 ++++---- Example/TestFromScratch.cxx | 13 ++++++------ Example/TestPapyrus.cxx | 34 ++++++++++++++++---------------- Example/WriteDicom.cxx | 10 +++++----- Example/WriteDicomSimple.cxx | 22 ++++++++++----------- Testing/TestChangeHeader.cxx | 18 ++++++++--------- Testing/TestCopyDicom.cxx | 24 +++++++++++----------- Testing/TestCopyRescaleDicom.cxx | 16 +++++++-------- Testing/TestWriteSimple.cxx | 20 +++++++++---------- src/gdcmDocument.h | 18 ++++++++--------- src/gdcmFile.cxx | 14 ++++++------- src/gdcmFileHelper.cxx | 20 +++++++++---------- src/gdcmFileHelper.h | 14 ++++++------- src/gdcmSQItem.cxx | 7 +++---- 15 files changed, 120 insertions(+), 124 deletions(-) diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index 50c73775..89073f51 100644 --- a/Example/TestChangeHeader.cxx +++ b/Example/TestChangeHeader.cxx @@ -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(); diff --git a/Example/TestCopyDicom.cxx b/Example/TestCopyDicom.cxx index c69b5255..37005844 100644 --- a/Example/TestCopyDicom.cxx +++ b/Example/TestCopyDicom.cxx @@ -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(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(d) ) { - copy->GetFile()->ReplaceOrCreate( + copy->GetFile()->Insert( v->GetValue(), v->GetGroup(), v->GetElement(), diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index b11919cc..29099d77 100644 --- a/Example/TestFromScratch.cxx +++ b/Example/TestFromScratch.cxx @@ -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 diff --git a/Example/TestPapyrus.cxx b/Example/TestPapyrus.cxx index 31d0e274..e0b5dd13 100644 --- a/Example/TestPapyrus.cxx +++ b/Example/TestPapyrus.cxx @@ -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); diff --git a/Example/WriteDicom.cxx b/Example/WriteDicom.cxx index f71e03d1..50ee7357 100644 --- a/Example/WriteDicom.cxx +++ b/Example/WriteDicom.cxx @@ -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: diff --git a/Example/WriteDicomSimple.cxx b/Example/WriteDicomSimple.cxx index 97bfe6dc..78b94565 100644 --- a/Example/WriteDicomSimple.cxx +++ b/Example/WriteDicomSimple.cxx @@ -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() ) { diff --git a/Testing/TestChangeHeader.cxx b/Testing/TestChangeHeader.cxx index 3528375a..40893a3f 100644 --- a/Testing/TestChangeHeader.cxx +++ b/Testing/TestChangeHeader.cxx @@ -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 (?) diff --git a/Testing/TestCopyDicom.cxx b/Testing/TestCopyDicom.cxx index 6d60f609..7d0b74b9 100644 --- a/Testing/TestCopyDicom.cxx +++ b/Testing/TestCopyDicom.cxx @@ -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(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(d) ) { - copyH->ReplaceOrCreate( - v->GetValue(), - v->GetGroup(), - v->GetElement(), - v->GetVR() ); + copyH->Insert( v->GetValue(), + v->GetGroup(), + v->GetElement(), + v->GetVR() ); } else { diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 961ea797..eaff8b4c 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -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(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(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; diff --git a/Testing/TestWriteSimple.cxx b/Testing/TestWriteSimple.cxx index 1399e339..edd8ba0d 100644 --- a/Testing/TestWriteSimple.cxx +++ b/Testing/TestWriteSimple.cxx @@ -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() ) { diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index 11cd6f5c..7082c755 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -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 ); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 5e6941c1..9e6788e6 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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]; } } diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 30a191f7..03e85e1f 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -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; } /** diff --git a/src/gdcmFileHelper.h b/src/gdcmFileHelper.h index 5eae1d58..7752d395 100644 --- a/src/gdcmFileHelper.h +++ b/src/gdcmFileHelper.h @@ -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(); diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 7ca6d202..b63b376a 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -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); -- 2.45.1