]> Creatis software - gdcm.git/commitdiff
We can now anonymize 'BinEntries' as well
authorjpr <jpr>
Wed, 20 Jul 2005 13:31:01 +0000 (13:31 +0000)
committerjpr <jpr>
Wed, 20 Jul 2005 13:31:01 +0000 (13:31 +0000)
src/gdcmFile.cxx
src/gdcmFile.h

index e9e789edd1e6f458073d0cbb48d24f22037a5955..b85f3b6c66e795cb4c56f23de7a44cde6204cb72 100644 (file)
@@ -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<BinEntry *>(d)
-        || dynamic_cast<SeqEntry *>(d) )
-         continue;
+         if ( dynamic_cast<SeqEntry *>(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<BinEntry *>(d)
-           || dynamic_cast<SeqEntry *>(d) )
+         if ( dynamic_cast<SeqEntry *>(d) )
+         {
+            gdcmWarningMacro( "You cannot 'Anonymize' a SeqEntry ");
             continue;
+         }
 
-         SetValEntry ((*it).Value, (*it).Group, (*it).Elem);
+         if ( dynamic_cast<BinEntry *>(d) )
+         {
+            gdcmWarningMacro( "To 'Anonymize' a BinEntry, better use AnonymizeNoLoad (FIXME) ");
+            continue;
+         }
+         else
+            SetValEntry ((*it).Value, (*it).Group, (*it).Elem);
       }
 }
 
index 2109cb508936d5a09cfecb178d038226e3dd37f4..0e937c772f6ffbba8c38240a6f281dba0f09196c 100644 (file)
@@ -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.