GDCM  2.2.6
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
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
File & GetFile()
Definition: gdcmAnonymizer.h:118
Class to represent a Sequence Of Items (value representation : SQ)
Definition: gdcmSequenceOfItems.h:39
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
Anonymizer()
Definition: gdcmAnonymizer.h:78
Value Length.
Definition: gdcmVL.h:29
static SmartPointer< Anonymizer > New()
for wrapped language: instantiate a reference counted object
Definition: gdcmAnonymizer.h:131
Anonymizer This class is a multi purpose anonymizer. It can work in 2 mode:
Definition: gdcmAnonymizer.h:75
Subject.
Definition: gdcmSubject.h:28
Class for Smart Pointer.
Definition: gdcmObject.h:26
a DICOM File See PS 3.10 File: A File is an ordered string of zero or more bytes, where the first byt...
Definition: gdcmFile.h:33
void SetFile(const File &f)
Set/Get File.
Definition: gdcmAnonymizer.h:116
Class for representing a IOD.
Definition: gdcmIOD.h:34
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element). Basically an uint32_t which...
Definition: gdcmTag.h:38
Class for CryptographicMessageSyntax encryption. This is just a simple wrapper around openssl PKCS7_e...
Definition: gdcmCryptographicMessageSyntax.h:33

Generated on Sat Dec 21 2013 05:56:16 for GDCM by doxygen 1.8.5
SourceForge.net Logo