X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FAnonymizeNoLoad.cxx;h=3fa8500583f2e5cbf000660614440308e99440c9;hb=fa8fa610de8d935491343df2d8a543ff6fdb6e69;hp=84fe1119a8acb5900fd27e0b49509140949e51f5;hpb=ac2e8ecc8319069451f1fe5a4413915d56f9cbdc;p=gdcm.git diff --git a/Example/AnonymizeNoLoad.cxx b/Example/AnonymizeNoLoad.cxx index 84fe1119..3fa85005 100644 --- a/Example/AnonymizeNoLoad.cxx +++ b/Example/AnonymizeNoLoad.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: AnonymizeNoLoad.cxx,v $ Language: C++ - Date: $Date: 2005/07/21 04:55:50 $ - Version: $Revision: 1.8 $ + Date: $Date: 2005/08/30 15:13:05 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,18 +28,18 @@ int main(int argc, char *argv[]) { START_USAGE(usage) - "\n AnonymizeNoLoad :\n", + "\n AnonymizeNoLoad :\n ", "Anonymize a gdcm-readable Dicom image even if pixels aren't gdcm readable ", " Warning : Warning : the image is overwritten ", " to preserve image integrity, use a copy. ", "usage: AnonymizeNoLoad {filein=inputFileName|dirin=inputDirectoryName} ", - " [rubout=listOfPrivateElementsToRubOut] ", + " [rubout=listOfElementsToRubOut] ", " [ { [noshadowseq] | [noshadow][noseq] } ] [debug] ", " inputFileName : Name of the (single) file user wants to anonymize ", " inputDirectoryName : user wants to anonymize *all* the files ", " within the (single Patient!) directory ", - " listOfPrivateElementsToRubOut : group-elem,g2-e2,... (in hexa) ", - " of private Elements to rub out ", + " listOfElementsToRubOut : group-elem,g2-e2,... (in hexa, no space) ", + " of extra Elements to rub out ", " noshadowseq: user doesn't want to load Private Sequences ", " noshadow : user doesn't want to load Private groups (odd number) ", " noseq : user doesn't want to load Sequences ", @@ -75,15 +75,15 @@ int main(int argc, char *argv[]) return 0; } - int loadMode = 0x00000000; + int loadMode = gdcm::LD_ALL; if ( am->ArgMgrDefined("noshadowseq") ) - loadMode |= NO_SHADOWSEQ; + loadMode |= gdcm::LD_NOSHADOWSEQ; else { if ( am->ArgMgrDefined("noshadow") ) - loadMode |= NO_SHADOW; + loadMode |= gdcm::LD_NOSHADOW; if ( am->ArgMgrDefined("noseq") ) - loadMode |= NO_SEQ; + loadMode |= gdcm::LD_NOSEQ; } int rubOutNb; @@ -99,22 +99,21 @@ int main(int argc, char *argv[]) delete am; // ------ we don't need Arguments Manager any longer ------ + gdcm::File *f; if ( fileName != 0 ) // ====== Deal with a single file ====== { // // Parse the input file. // - gdcm::File *f; f = new gdcm::File( ); f->SetLoadMode(loadMode); f->SetFileName( fileName ); - bool res = f->Load(); // gdcm::File::IsReadable() is no usable here, because we deal with // any kind of gdcm::Readable *document* // not only gdcm::File (as opposed to gdcm::DicomDir) - if ( !res ) + if ( !f->Load() ) { std::cout <SetLoadMode(loadMode); f->SetFileName( it->c_str() ); - bool res = f->Load(); - if ( !res ) + if ( !f->Load() ) { delete f; continue;