fw4spl
fwGdcmIO::helper::DicomAnonymizer Class Reference

This class contains helpers to anonymize dicom files on filesystem. Anonymization is performed according to the DICOM standard - Part 15 - Annex E - Basic Profile. More...

#include <DicomAnonymizer.hpp>

Public Types

typedef std::map< std::string, std::string > UIDMap
 Map used to maintain UID consistency.
 
typedef std::map< ::gdcm::Tag, std::string > ExceptionTagMapType
 Map used to store exception value.
 

Public Member Functions

FWGDCMIO_API DicomAnonymizer ()
 Constructor.
 
virtual FWGDCMIO_API ~DicomAnonymizer ()
 Destructor.
 
FWGDCMIO_API void anonymize (const ::boost::filesystem::path &dirPath)
 Anonymize a folder containing Dicom files.
 
FWGDCMIO_API void anonymize (std::istream &inputStream, std::ostream &outputStream)
 
FWGDCMIO_API void addExceptionTag (uint16_t group, uint16_t element, const std::string &value="")
 Add an exceptional value for a tag.
 
FWGDCMIO_API std::shared_ptr< ::fwJobs::IJobgetJob () const
 Get job observer.
 
FWGDCMIO_API unsigned int getNextIndex ()
 Return next file index.
 
FWGDCMIO_API void resetIndex ()
 Reset file index to 0.
 
FWGDCMIO_API void removeAnonymizeTag (const ::gdcm::Tag &tag)
 The removed tag will not be process by anonymization tag.
 
FWGDCMIO_API void setReferenceDate (const ::boost::gregorian::date &referenceDate)
 Set Reference date for shifting.
 
FWGDCMIO_API void addShiftDateTag (const ::gdcm::Tag &tag)
 Add a date tag that must be shifted. The shift is made according to the interval between the date and the reference date. More...
 
FWGDCMIO_API void preservePrivateTag (const ::gdcm::Tag &tag)
 Tells the anonymizer to do not anonymize the given private tag. More...
 

Static Public Member Functions

static FWGDCMIO_API void copyDirectory (const ::boost::filesystem::path &input, const ::boost::filesystem::path &output)
 Copy a directory recursively. More...
 

Friends

class ::boost::serialization::access
 
template<class , class >
struct ::boost::python::objects::pointer_holder
 
template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Access tags according to their associated action code

typedef std::set< ::gdcm::Tag > TagContainerType
 
FWGDCMIO_API const TagContainerType & getActionCodeDTags ()
 
FWGDCMIO_API const TagContainerType & getActionCodeZTags ()
 
FWGDCMIO_API const TagContainerType & getActionCodeXTags ()
 
FWGDCMIO_API const TagContainerType & getActionCodeKTags ()
 
FWGDCMIO_API const TagContainerType & getActionCodeCTags ()
 
FWGDCMIO_API const TagContainerType & getActionCodeUTags ()
 

Detailed Description

This class contains helpers to anonymize dicom files on filesystem. Anonymization is performed according to the DICOM standard - Part 15 - Annex E - Basic Profile.

Definition at line 42 of file DicomAnonymizer.hpp.

Member Function Documentation

void fwGdcmIO::helper::DicomAnonymizer::addShiftDateTag ( const ::gdcm::Tag &  tag)

Add a date tag that must be shifted. The shift is made according to the interval between the date and the reference date.

Parameters
dateTagDate tag that must be shifted. (This tag shall be a date: VR shall be DA)
Note
The shift is done from Jan 1, 1900.

Definition at line 509 of file DicomAnonymizer.cpp.

References OSLM_ERROR.

void fwGdcmIO::helper::DicomAnonymizer::copyDirectory ( const ::boost::filesystem::path &  input,
const ::boost::filesystem::path &  output 
)
static

Copy a directory recursively.

Parameters
inputInput file
outputOutput file

Definition at line 699 of file DicomAnonymizer.cpp.

References SLM_ERROR_IF.

void fwGdcmIO::helper::DicomAnonymizer::preservePrivateTag ( const ::gdcm::Tag &  tag)

Tells the anonymizer to do not anonymize the given private tag.

Parameters
tagprivate tag to be preserved from anonymisation

Definition at line 424 of file DicomAnonymizer.cpp.

References OSLM_WARN_IF, and SLM_FATAL.


The documentation for this class was generated from the following files: