Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2004/12/02 15:14:16 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/01/19 08:58:33 $
+ 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
=========================================================================*/
#include "gdcmHeader.h"
#include "gdcmFile.h"
-#include "gdcmDocument.h"
#include "gdcmValEntry.h"
#include "gdcmBinEntry.h"
std::cout << " Testing: " << filename << std::endl;
if( FileExists( output.c_str() ) )
{
- // std::cerr << "Don't try to cheat, I am removing the file anyway" << std::endl;
if( !RemoveFile( output.c_str() ) )
{
std::cout << "Ouch, the file exist, but I cannot remove it" << std::endl;
// Warning :Accessor gdcmElementSet::GetEntry() should not exist
// It was commented out by Mathieu, that was a *good* idea
- // (the user does NOT have to know the way we implemented the Header !)
- // Waiting for a 'clean' solution, I keep the method ...JPRx
-
//////////////// Step 2:
std::cout << "2...";
- originalH->Initialize();
- gdcm::DocEntry* d=originalH->GetNextEntry();
-
+ gdcm::DocEntry* d=originalH->GetFirstEntry();
while(d)
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copyH->ReplaceOrCreateByNumber(
+ copyH->ReplaceOrCreate(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
else
{
// We skip pb of SQ recursive exploration
- //std::cout << "Skipped Sequence "
- // << "------------- " << d->GetVR() << " "<< std::hex
- // << d->GetGroup() << " " << d->GetElement()
- // << std::endl;
}
d=originalH->GetNextEntry();
if( !copy->WriteDcmExplVR(output) )
{
std::cout << " Failed" << std::endl
- << " " << output << " not written" << std::endl;
+ << " " << output << " not written" << std::endl;
delete original;
delete copy;