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
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 ",
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;
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 <<std::endl
<< "Sorry, " << fileName <<" not a gdcm-readable "
it != fileList.end();
++it )
{
-
- gdcm::File *f;
f = new gdcm::File( );
f->SetLoadMode(loadMode);
f->SetFileName( it->c_str() );
- bool res = f->Load();
- if ( !res )
+ if ( !f->Load() )
{
delete f;
continue;