Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMANONYMIZER_H
00016 #define GDCMANONYMIZER_H
00017
00018 #include "gdcmFile.h"
00019 #include "gdcmSubject.h"
00020 #include "gdcmEvent.h"
00021 #include "gdcmSmartPointer.h"
00022
00023 namespace gdcm
00024 {
00025 class TagPath;
00026 class IOD;
00027 class CryptographicMessageSyntax;
00028
00072 class GDCM_EXPORT Anonymizer : public Subject
00073 {
00074 public:
00075 Anonymizer():F(new File),CMS(NULL) {}
00076 ~Anonymizer();
00077
00080 bool Empty( Tag const &t );
00081
00082
00083
00085 bool Remove( Tag const &t );
00086
00087
00088
00091 bool Replace( Tag const &t, const char *value );
00092
00095 bool Replace( Tag const &t, const char *value, VL const & vl );
00096
00097
00098
00100 bool RemovePrivateTags();
00101
00103 bool RemoveGroupLength();
00104
00106 bool RemoveRetired();
00107
00108
00109
00110
00112 void SetFile(const File& f) { F = f; }
00113
00114 File &GetFile() { return *F; }
00115
00120 bool BasicApplicationLevelConfidentialityProfile(bool deidentify = true);
00121
00123 void SetCryptographicMessageSyntax( CryptographicMessageSyntax *cms );
00124 const CryptographicMessageSyntax *GetCryptographicMessageSyntax() const;
00125
00127 static SmartPointer<Anonymizer> New() { return new Anonymizer; }
00128
00130 static std::vector<Tag> GetBasicApplicationLevelConfidentialityProfileAttributes();
00131
00132 protected:
00133
00134 bool BALCPProtect(DataSet &ds, Tag const & tag, const IOD &iod);
00135 bool CanEmptyTag(Tag const &tag, const IOD &iod) const;
00136 void RecurseDataSet( DataSet & ds );
00137
00138 private:
00139 bool BasicApplicationLevelConfidentialityProfile1();
00140 bool BasicApplicationLevelConfidentialityProfile2();
00141 bool CheckIfSequenceContainsAttributeToAnonymize(File const &file, SequenceOfItems* sqi) const;
00142
00143 private:
00144
00145 SmartPointer<File> F;
00146 CryptographicMessageSyntax *CMS;
00147 };
00148
00155 }
00156
00157 #endif //GDCMANONYMIZER_H