X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FAnonymizeDicomDir.cxx;h=747714b538ff476dd775f5c4c4d9f03e06177204;hb=1b20e56c29494e7d1bef31d3ade5de833347c228;hp=388a92e04cd548e8c1f34fa47bbb92041f468f80;hpb=ac2e8ecc8319069451f1fe5a4413915d56f9cbdc;p=gdcm.git diff --git a/Example/AnonymizeDicomDir.cxx b/Example/AnonymizeDicomDir.cxx index 388a92e0..747714b5 100644 --- a/Example/AnonymizeDicomDir.cxx +++ b/Example/AnonymizeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: AnonymizeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/07/21 04:55:50 $ - Version: $Revision: 1.7 $ + Date: $Date: 2005/10/25 14:52:26 $ + 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 @@ -22,7 +22,7 @@ #include "gdcmSQItem.h" #include "gdcmSeqEntry.h" -#include "gdcmValEntry.h" +#include "gdcmDataEntry.h" #include "gdcmDocument.h" #include "gdcmFile.h" @@ -55,7 +55,7 @@ void AnoNoLoad(gdcm::SQItem *s, std::fstream *fp, if ( d == NULL) return; - if ( ! dynamic_cast(d) ) + if ( ! dynamic_cast(d) ) return; offset = d->GetOffset(); @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) // Read the input DICOMDIR gdcm::File *f; - f = new gdcm::File( ); + f = gdcm::File::New( ); f->SetLoadMode(0); f->SetFileName( fileName ); bool res = f->Load(); @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) if ( !e ) { std::cout << "No Directory Record Sequence (0004,1220) found" <Delete(); return 0; } @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) if ( !s ) { std::cout << "Element (0004,1220) is not a Sequence ?!?" <Delete(); return 0; } @@ -148,13 +148,13 @@ int main(int argc, char *argv[]) while(tmpSI) { d = tmpSI->GetDocEntry(0x0004, 0x1430); // Directory Record Type - if ( gdcm::ValEntry* valEntry = dynamic_cast(d) ) + if ( gdcm::DataEntry *dataEntry = dynamic_cast(d) ) { - v = valEntry->GetValue(); + v = dataEntry->GetString(); } else { - std::cout << "(0004,1430) not a ValEntry ?!?" << std::endl; + std::cout << "(0004,1430) not a DataEntry ?!?" << std::endl; continue; } @@ -188,7 +188,8 @@ int main(int argc, char *argv[]) fp->close(); - delete f; + delete fp; + f->Delete(); return 0; }