GDCM  2.2.4
gdcmAnonymizer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMANONYMIZER_H
15 #define GDCMANONYMIZER_H
16 
17 #include "gdcmFile.h"
18 #include "gdcmSubject.h"
19 #include "gdcmEvent.h"
20 #include "gdcmSmartPointer.h"
21 
22 namespace gdcm
23 {
24 class TagPath;
25 class IOD;
26 class CryptographicMessageSyntax;
27 
76 {
77 public:
78  Anonymizer():F(new File),CMS(NULL) {}
79  ~Anonymizer();
80 
83  bool Empty( Tag const &t );
84  //bool Empty( PrivateTag const &t );
85  //bool Empty( TagPath const &t );
86 
89  bool Remove( Tag const &t );
90  //bool Remove( PrivateTag const &t );
91  //bool Remove( TagPath const &t );
92 
95  bool Replace( Tag const &t, const char *value );
96 
99  bool Replace( Tag const &t, const char *value, VL const & vl );
100  //bool Replace( PrivateTag const &t, const char *value, VL const & vl );
101  //bool Replace( TagPath const &t, const char *value, VL const & vl );
102 
104  bool RemovePrivateTags();
105 
107  bool RemoveGroupLength();
108 
110  bool RemoveRetired();
111 
112  // TODO:
113  // bool Remove( PRIVATE_TAGS | GROUP_LENGTH | RETIRED );
114 
116  void SetFile(const File& f) { F = f; }
117  //const File &GetFile() const { return *F; }
118  File &GetFile() { return *F; }
119 
124  bool BasicApplicationLevelConfidentialityProfile(bool deidentify = true);
125 
127  void SetCryptographicMessageSyntax( CryptographicMessageSyntax *cms );
128  const CryptographicMessageSyntax *GetCryptographicMessageSyntax() const;
129 
131  static SmartPointer<Anonymizer> New() { return new Anonymizer; }
132 
134  static std::vector<Tag> GetBasicApplicationLevelConfidentialityProfileAttributes();
135 
136 protected:
137  // Internal function used to either empty a tag or set it's value to a dummy value (Type 1 vs Type 2)
138  bool BALCPProtect(DataSet &ds, Tag const & tag, const IOD &iod);
139  bool CanEmptyTag(Tag const &tag, const IOD &iod) const;
140  void RecurseDataSet( DataSet & ds );
141 
142 private:
143  bool BasicApplicationLevelConfidentialityProfile1();
144  bool BasicApplicationLevelConfidentialityProfile2();
145  bool CheckIfSequenceContainsAttributeToAnonymize(File const &file, SequenceOfItems* sqi) const;
146 
147 private:
148  // I would prefer to have a smart pointer to DataSet but DataSet does not derive from Object...
151 };
152 
159 } // end namespace gdcm
160 
161 #endif //GDCMANONYMIZER_H

Generated on Mon Sep 9 2013 14:21:55 for GDCM by doxygen 1.8.4
SourceForge.net Logo