X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestChangeHeader.cxx;h=b8de5e276a62fe60d1ec0f780ac0ab049e0c5bf4;hb=bd2c6b9f9fa4b815153b200081de0450429a882e;hp=aa4ae3bc09772f5f0c8b29e5b5f9a634c8ecf5f3;hpb=a462ce9f1af0894cd930ab04f2e65cd80dfa7084;p=gdcm.git diff --git a/Example/TestChangeHeader.cxx b/Example/TestChangeHeader.cxx index aa4ae3bc..b8de5e27 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/08 15:03:57 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/25 15:44:22 $ + 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 @@ -15,8 +15,8 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" #include "gdcmFile.h" +#include "gdcmFileHelper.h" // This examples read two images (could be the same). Try to modify // Acquisition Matrix and then write the image again @@ -31,20 +31,20 @@ int main(int argc, char* argv[]) return 1; } - gdcm::Header *h1 = new gdcm::Header( argv[1] ); - gdcm::File *f1 = new gdcm::File( h1 ); - gdcm::File *f2 = new gdcm::File( argv[2] ); + gdcm::File *h1 = new gdcm::File( argv[1] ); + gdcm::FileHelper *f1 = new gdcm::FileHelper( h1 ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( argv[2] ); // 0018 1310 US ACQ Acquisition Matrix gdcm::DictEntry *dictEntry = - f2->GetHeader()->GetPubDict()->GetDictEntry( 0x0018, 1310 ); + f2->GetFile()->GetPubDict()->GetEntry( 0x0018, 1310 ); std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl; - std::string matrix = f2->GetHeader()->GetEntry(0x0018, 0x1310); + std::string matrix = f2->GetFile()->GetEntryValue(0x0018, 0x1310); if(matrix != "gdcm::Unfound") { std::cerr << "Aquisition Matrix:" << matrix << std::endl; - f1->GetHeader()->ReplaceOrCreate( matrix, 0x0018, 0x1310); + f1->GetFile()->InsertValEntry( matrix, 0x0018, 0x1310); } f1->GetImageData();