X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestFromScratch.cxx;h=f80dfc55cdd5d1935797f85ac2ed00ecf01d410d;hb=93748f382dadb5c9240c4156ce7bbe9dcc8da44f;hp=ca89f4fd06f896c3fad51b5f7cdd62579745b55a;hpb=abd6bfcc2b10b5f7447d1758938d7c15c31240af;p=gdcm.git diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index ca89f4fd..f80dfc55 100644 --- a/Example/TestFromScratch.cxx +++ b/Example/TestFromScratch.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestFromScratch.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:37 $ - Version: $Revision: 1.6 $ + Date: $Date: 2005/01/20 16:31:42 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,7 +16,7 @@ =========================================================================*/ #include "gdcmHeader.h" -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmDictEntry.h" #include "gdcmDocEntry.h" #include "gdcmBinEntry.h" @@ -37,12 +37,12 @@ int main(int argc, char *argv[]) // Doesn't seems to do anything: gdcm::Debug::SetDebugOn(); + // Doesn't link properly: //gdcm::Debug::GetReference().SetDebug(1); std::string filename = argv[1]; - //gdcm::File *f1 = new gdcm::File( "/home/malaterre/Creatis/gdcmData/012345.002.050.dcm" ); - gdcm::File *f1 = new gdcm::File( filename ); + gdcm::FileHelper *f1 = new gdcm::FileHelper( filename ); gdcm::Header *h1 = f1->GetHeader(); int dataSize = f1->GetImageDataSize(); @@ -53,10 +53,8 @@ int main(int argc, char *argv[]) // Hopefully default to something gdcm::Header *h2 = new gdcm::Header(); - h1->Initialize(); - gdcm::DocEntry* d = h1->GetNextEntry(); - // Copy of the header content + gdcm::DocEntry* d = h1->GetFirstEntry(); while(d) { if ( gdcm::ValEntry* v = dynamic_cast(d) ) @@ -64,7 +62,7 @@ int main(int argc, char *argv[]) // Do not bother with field from private dict if( v->GetName() != "gdcm::Unknown" ) { - h2->ReplaceOrCreateByNumber( + h2->ReplaceOrCreate( v->GetValue(), v->GetGroup(), v->GetElement(), @@ -79,7 +77,7 @@ int main(int argc, char *argv[]) } h2->Print( std::cout ); - gdcm::File *f2 = new gdcm::File( h2 ); + gdcm::FileHelper *f2 = new gdcm::FileHelper( h2 ); f2->SetImageData(imageData, dataSize); f2->SetWriteTypeToDcmExplVR();