From d1a38a4f0d357d1d8079eacf4de5e0aeb3eff973 Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 20 Jul 2005 13:31:01 +0000 Subject: [PATCH] We can now anonymize 'BinEntries' as well --- src/gdcmFile.cxx | 27 +++++++++++++++++++-------- src/gdcmFile.h | 6 +++--- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index e9e789ed..b85f3b6c 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/07/19 15:25:53 $ - Version: $Revision: 1.252 $ + Date: $Date: 2005/07/20 13:31:01 $ + Version: $Revision: 1.253 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1295,9 +1295,11 @@ void File::AnonymizeNoLoad() if ( d == NULL) continue; - if ( dynamic_cast(d) - || dynamic_cast(d) ) - continue; + if ( dynamic_cast(d) ) + { + gdcmWarningMacro( "You cannot 'Anonymize a SeqEntry "); + continue; + } offset = d->GetOffset(); lgth = d->GetLength(); @@ -1318,6 +1320,7 @@ void File::AnonymizeNoLoad() /** * \brief anonymize a File (remove Patient's personal info passed with * AddAnonymizeElement() + * \note You cannot Anonymize a BinEntry (to be fixed) */ bool File::AnonymizeFile() { @@ -1356,11 +1359,19 @@ bool File::AnonymizeFile() if ( d == NULL) continue; - if ( dynamic_cast(d) - || dynamic_cast(d) ) + if ( dynamic_cast(d) ) + { + gdcmWarningMacro( "You cannot 'Anonymize' a SeqEntry "); continue; + } - SetValEntry ((*it).Value, (*it).Group, (*it).Elem); + if ( dynamic_cast(d) ) + { + gdcmWarningMacro( "To 'Anonymize' a BinEntry, better use AnonymizeNoLoad (FIXME) "); + continue; + } + else + SetValEntry ((*it).Value, (*it).Group, (*it).Elem); } } diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 2109cb50..0e937c77 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2005/07/19 15:19:26 $ - Version: $Revision: 1.110 $ + Date: $Date: 2005/07/20 13:31:01 $ + Version: $Revision: 1.111 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -85,7 +85,7 @@ enum ModalityType { * dicom files according to header information e.g. to create a file hierarchy * reflecting the Patient/Study/Serie informations, or extracting a given * SerieId. Accessing the content (image[s] or volume[s]) is beyond the - * functionality of this class and belongs to gdmcFile. + * functionality of this class and belongs to gdcm::FileHelper. * \note The various entries of the explicit value representation (VR) shall * be managed within a dictionary which is shared by all File * instances. -- 2.48.1