X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FexGC.cxx;h=68f8adff80f712850b6aa75a0266e1167e35324b;hb=4117dec671b980b51a16117a5692d822b63bbe04;hp=8d28ecec55e90cfa069f3fb65fb8ecda30edaa93;hpb=4d992954520d43c6f2fb555b7cd721574978c23a;p=gdcm.git diff --git a/Example/exGC.cxx b/Example/exGC.cxx index 8d28ecec..68f8adff 100644 --- a/Example/exGC.cxx +++ b/Example/exGC.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exGC.cxx,v $ Language: C++ - Date: $Date: 2005/07/07 17:31:54 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/10/18 08:35:44 $ + 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 @@ -19,8 +19,7 @@ #include "gdcmFile.h" #include "gdcmFileHelper.h" #include "gdcmDocument.h" -#include "gdcmValEntry.h" -#include "gdcmBinEntry.h" +#include "gdcmDataEntry.h" #include "gdcmSeqEntry.h" #include // for exit @@ -76,7 +75,7 @@ int main(int argc, char *argv[]) std::cout << argv[1] << std::endl; gdcm::File *f = new gdcm::File(); - f->SetLoadMode( 0x00000000); + f->SetLoadMode( gdcm::LD_ALL); f->SetFileName( fileName ); bool res = f->Load(); @@ -119,7 +118,9 @@ int main(int argc, char *argv[]) // ------ without Sequences ------------- - gdcm::FileHelper *copy = new gdcm::FileHelper( output ); + gdcm::FileHelper *copy = new gdcm::FileHelper( ); + copy->SetFileName( output ); + copy->Load(); gdcm::DocEntry *d = f->GetFirstEntry(); while(d) @@ -130,17 +131,11 @@ int main(int argc, char *argv[]) && !( d->GetGroup()%2 ) ) { - if ( gdcm::BinEntry *b = dynamic_cast(d) ) + if ( gdcm::DataEntry *de = dynamic_cast(d) ) { - copy->GetFile()->InsertBinEntry( b->GetBinArea(),b->GetLength(), - b->GetGroup(),b->GetElement(), - b->GetVR() ); - } - else if ( gdcm::ValEntry *v = dynamic_cast(d) ) - { - copy->GetFile()->InsertValEntry( v->GetValue(), - v->GetGroup(),v->GetElement(), - v->GetVR() ); + copy->GetFile()->InsertEntryBinArea( de->GetBinArea(),de->GetLength(), + de->GetGroup(),de->GetElement(), + de->GetVR() ); } else {