7 #ifndef __FWGDCMIO_HELPER_DICOMANONYMIZER_HPP__ 8 #define __FWGDCMIO_HELPER_DICOMANONYMIZER_HPP__ 10 #include "fwGdcmIO/config.hpp" 11 #include "fwGdcmIO/helper/tags.hpp" 13 #include <fwZip/WriteZipArchive.hpp> 15 #include <boost/date_time/gregorian/gregorian_types.hpp> 16 #include <boost/filesystem/path.hpp> 18 #include <gdcmAnonymizer.h> 19 #include <gdcmDicts.h> 20 #include <gdcmStringFilter.h> 52 FWGDCMIO_API
virtual ~DicomAnonymizer();
55 typedef std::map< std::string, std::string >
UIDMap;
61 FWGDCMIO_API
void anonymize(const ::boost::filesystem::path& dirPath);
63 FWGDCMIO_API
void anonymize(std::istream& inputStream, std::ostream& outputStream);
66 FWGDCMIO_API
void addExceptionTag(uint16_t group, uint16_t element,
const std::string& value =
"");
73 FWGDCMIO_API
static void copyDirectory(const ::boost::filesystem::path& input,
74 const ::boost::filesystem::path& output);
80 FWGDCMIO_API
unsigned int getNextIndex();
83 FWGDCMIO_API
void resetIndex();
86 FWGDCMIO_API
void removeAnonymizeTag(const ::gdcm::Tag& tag);
89 FWGDCMIO_API
void setReferenceDate(const ::
boost::gregorian::date& referenceDate);
98 FWGDCMIO_API
void addShiftDateTag(const ::gdcm::Tag& tag);
105 FWGDCMIO_API
void preservePrivateTag(const ::gdcm::Tag& tag);
110 typedef
std::set< ::gdcm::Tag > TagContainerType;
111 FWGDCMIO_API const TagContainerType& getActionCodeDTags();
112 FWGDCMIO_API const TagContainerType& getActionCodeZTags();
113 FWGDCMIO_API const TagContainerType& getActionCodeXTags();
114 FWGDCMIO_API const TagContainerType& getActionCodeKTags();
115 FWGDCMIO_API const TagContainerType& getActionCodeCTags();
116 FWGDCMIO_API const TagContainerType& getActionCodeUTags();
121 void anonymizationProcess(const ::
boost::filesystem::path& dirPath);
124 void applyActionCodeD(const ::gdcm::Tag& tag);
134 void applyActionCodeZ(const ::gdcm::Tag& tag);
147 void applyActionCodeX(const ::gdcm::Tag& tag);
150 void applyActionCodeK(const ::gdcm::Tag& tag);
156 void applyActionCodeC(const ::gdcm::Tag& tag);
160 void applyActionCodeU(const ::gdcm::Tag& tag);
167 void applyActionShiftDate(const ::gdcm::Tag& tag);
170 void generateDummyValue(const ::gdcm::Tag& tag);
173 ::gdcm::Anonymizer m_anonymizer;
176 ::gdcm::StringFilter m_stringFilter;
179 const ::gdcm::Dict& m_publicDictionary;
185 ExceptionTagMapType m_exceptionTagMap;
188 static const
unsigned int s_NUMBER_OF_TAGS;
197 unsigned int m_fileIndex;
200 ::
boost::gregorian::date m_referenceDate;
207 TagContainerType m_actionCodeDTags;
208 TagContainerType m_actionCodeZTags;
209 TagContainerType m_actionCodeXTags;
210 TagContainerType m_actionCodeKTags;
211 TagContainerType m_actionCodeCTags;
212 TagContainerType m_actionCodeUTags;
215 TagContainerType m_actionShiftDateTags;
219 ::
fwGdcmIO::helper::PrivateTagVecType m_privateTags;
This class is an interface for class managing job.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
std::map< ::gdcm::Tag, std::string > ExceptionTagMapType
Map used to store exception value.
This class contains helpers to anonymize dicom files on filesystem. Anonymization is performed accord...
std::map< std::string, std::string > UIDMap
Map used to maintain UID consistency.
This namespace fwJobs provides jobs management.
#define fwCoreClassFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate methods for classes with one factory.