X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FTestFromScratch.cxx;h=7bb6884737737cc38608783b20c1fca7734d31b3;hb=f711022dedd779e5e58e649af8c440a4a58bdba1;hp=e501807d9f68b7642fd5695c32c84a186e48851e;hpb=d00078b5e19310b379c8339fa8fe38362e8ca392;p=gdcm.git diff --git a/Example/TestFromScratch.cxx b/Example/TestFromScratch.cxx index e501807d..7bb68847 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/20 16:16:58 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/02/02 10:06:32 $ + 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 @@ -15,8 +15,8 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmHeader.h" #include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "gdcmDictEntry.h" #include "gdcmDocEntry.h" #include "gdcmBinEntry.h" @@ -35,38 +35,37 @@ int main(int argc, char *argv[]) return 1; } - // Doesn't seems to do anything: - gdcm::Debug::SetDebugOn(); + + // Doesn't seem to do anything: + gdcm::Debug::DebugOn(); // Doesn't link properly: //gdcm::Debug::GetReference().SetDebug(1); std::string filename = argv[1]; gdcm::FileHelper *f1 = new gdcm::FileHelper( filename ); - gdcm::Header *h1 = f1->GetHeader(); + gdcm::File *h1 = f1->GetFile(); int dataSize = f1->GetImageDataSize(); std::cout << "DataSize: " << dataSize << std::endl; // Since we know the image is 16bits: - uint8_t* imageData = f1->GetImageData(); + uint8_t *imageData = f1->GetImageData(); // Hopefully default to something - gdcm::Header *h2 = new gdcm::Header(); + gdcm::File *h2 = new gdcm::File(); // Copy of the header content - gdcm::DocEntry* d = h1->GetFirstEntry(); + gdcm::DocEntry *d = h1->GetFirstEntry(); while(d) { - if ( gdcm::ValEntry* v = dynamic_cast(d) ) + if ( gdcm::ValEntry *v = dynamic_cast(d) ) { // Do not bother with field from private dict if( v->GetName() != "gdcm::Unknown" ) { - h2->ReplaceOrCreate( - v->GetValue(), - v->GetGroup(), - v->GetElement(), - v->GetVR() ); + h2->InsertValEntry( v->GetValue(), + v->GetGroup(),v->GetElement(), + v->GetVR() ); } } //else