Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 14:26:30 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2005/10/21 08:37:44 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return 1;
}
- gdcm::File *h1 = new gdcm::File( argv[1] );
+ gdcm::File *h1 = new gdcm::File( );
+ h1->SetFileName ( argv[1] );
+ h1->Load( );
gdcm::FileHelper *f1 = new gdcm::FileHelper( h1 );
- gdcm::FileHelper *f2 = new gdcm::FileHelper( argv[2] );
+
+ gdcm::File *h2 = new gdcm::File( );
+ h2->SetFileName ( argv[2] );
+ h2->Load( );
+ gdcm::FileHelper *f2 = new gdcm::FileHelper( h2 );
+
// 0018 1310 US ACQ Acquisition Matrix
gdcm::DictEntry *dictEntry =
- f2->GetFile()->GetPubDict()->GetEntry( 0x0018, 1310 );
- std::cerr << std::hex << dictEntry->GetGroup() << "," << dictEntry->GetElement() << std::endl;
+ f2->GetFile()->GetPubDict()->GetEntry( 0x0018, 1310 );
+ std::cerr << std::hex << dictEntry->GetGroup() << ","
+ << dictEntry->GetElement() << std::endl;
- std::string matrix = f2->GetFile()->GetEntryValue(0x0018, 0x1310);
+ std::string matrix = f2->GetFile()->GetEntryString(0x0018, 0x1310);
if(matrix != "gdcm::Unfound")
{
std::cerr << "Aquisition Matrix:" << matrix << std::endl;
- f1->GetFile()->InsertValEntry( matrix, 0x0018, 0x1310);
+ f1->GetFile()->InsertEntryString( matrix, 0x0018, 0x1310);
}
f1->GetImageData();
h1->Print();
f1->WriteDcmExplVR("output-matrix.dcm");
+
+ delete f1;
+ delete f2;
+ delete h1;
+ delete h2;
return 0;
}