+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: TestCopyDicom.cxx,v $
+ Language: C++
+ Date: $Date: 2005/01/18 07:55:16 $
+ 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
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
#include "gdcmHeader.h"
#include "gdcmFile.h"
#include "gdcmDocument.h"
gdcm::File *copy = new gdcm::File( output );
- gdcm::TagDocEntryHT & Ht = original->GetHeader()->GetEntry();
-
size_t dataSize = original->GetImageDataSize();
uint8_t* imageData = original->GetImageData();
+ (void)imageData;
+ (void)dataSize;
//First of all copy the header field by field
// (the user does NOT have to know the way we implemented the Header !)
// Waiting for a 'clean' solution, I keep the method ...JPRx
- gdcm::DocEntry* d;
-
- for (gdcm::TagDocEntryHT::iterator tag = Ht.begin(); tag != Ht.end(); ++tag)
+ gdcm::DocEntry* d=original->GetHeader()->GetFirstEntry();
+ while(d)
{
- d = tag->second;
- d->Print(); std::cout << std::endl;
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreateByNumber(
+ copy->GetHeader()->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copy->GetHeader()->ReplaceOrCreateByNumber(
+ copy->GetHeader()->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
// << d->GetGroup() << " " << d->GetElement()
// << std::endl;
}
- }
-
-
-
+ d=original->GetHeader()->GetNextEntry();
+ }
//copy->GetImageData();
- copy->SetImageData(imageData, dataSize);
+ //copy->SetImageData(imageData, dataSize);
std::cout << "--- Copy ----------------------" << std::endl;
std::cout <<std::endl << "DO NOT care about Offset" <<std::endl<<std::endl;;