gdcm::FileAnonymizer Class Reference

FileAnonymizer. More...

`#include <gdcmFileAnonymizer.h>`

Inheritance diagram for gdcm::FileAnonymizer:
[legend]
Collaboration diagram for gdcm::FileAnonymizer:
[legend]

## Public Member Functions

| FileAnonymizer ()
| ~FileAnonymizer () override
void | Empty (Tag const &t)
void | Remove (Tag const &t)
| remove a tag (even a SQ can be removed)
void | Replace (Tag const &t, const char *value_data, VL const &vl)
void | Replace (Tag const &t, const char *value_str)
void | SetInputFileName (const char *filename_native)
| Set input filename.
void | SetOutputFileName (const char *filename_native)
| Set output filename.
bool | Write ()
| Write the output file.
Public Member Functions inherited from gdcm::Subject
| Subject ()
| ~Subject () override
unsigned long | AddObserver (const Event &event, Command *)
unsigned long | AddObserver (const Event &event, Command *) const
Command * | GetCommand (unsigned long tag)
bool | HasObserver (const Event &event) const
void | InvokeEvent (const Event &)
void | InvokeEvent (const Event &) const
void | RemoveAllObservers ()
void | RemoveObserver (unsigned long tag)
Public Member Functions inherited from gdcm::Object
| Object ()
| Object (const Object &)
| Special requirement for copy/cstor, assignment operator.
virtual | ~Object ()
void | operator= (const Object &)
virtual void | Print (std::ostream &) const

## Additional Inherited Members

Protected Member Functions inherited from gdcm::Object
void | Register ()
void | UnRegister ()

## Detailed Description

FileAnonymizer.

This Anonymizer is a file-based Anonymizer. It requires a valid DICOM file and will use the Value Length to skip over any information.

It will not load the DICOM dataset taken from SetInputFileName() into memory and should consume much less memory than Anonymizer.

Warning
  : Each time you call Replace() with a value. This value will copied, and stored in memory. The behavior is not ideal for extremely large data (larger than memory size). This class is really meant to take a large DICOM input file and then only changed some small attribute.

caveats:

- This class will NOT work with unordered attributes in a DICOM File,
- This class does neither recompute nor update the Group Length element,
- This class currently does not update the File Meta Information header.
- Only strict inplace Replace operation is supported when input and output file are the same.

Examples
  FileAnonymize.cs, and MakeTemplate.cxx.

## Constructor & Destructor Documentation

## FileAnonymizer()

gdcm::FileAnonymizer::FileAnonymizer | ( |  | ) |

## ~FileAnonymizer()

gdcm::FileAnonymizer::~FileAnonymizer | ( |  | ) |

override

## Member Function Documentation

## Empty()

void gdcm::FileAnonymizer::Empty | ( | Tag const & | t | ) |

Make Tag t empty Warning: does not handle SQ element

Examples
  FileAnonymize.cs, and MakeTemplate.cxx.

## Remove()

void gdcm::FileAnonymizer::Remove | ( | Tag const & | t | ) |

remove a tag (even a SQ can be removed)

Examples
  FileAnonymize.cs.

## Replace() [1/2]

void gdcm::FileAnonymizer::Replace | ( | Tag const & | t,
|  | const char * | value_data,
|  | VL const & | vl )

when the value contains \0, it is a good idea to specify the length. This function is required when dealing with VRBINARY tag

## Replace() [2/2]

void gdcm::FileAnonymizer::Replace | ( | Tag const & | t,
|  | const char * | value_str )

Replace tag with another value, if tag is not found it will be created: WARNING: this function can only execute if tag is a VRASCII WARNING: Do not ever try to write a value in a SQ Data Element !

Examples
  FileAnonymize.cs.

## SetInputFileName()

void gdcm::FileAnonymizer::SetInputFileName | ( | const char * | filename_native | ) |

Set input filename.

Examples
  FileAnonymize.cs, and MakeTemplate.cxx.

## SetOutputFileName()

void gdcm::FileAnonymizer::SetOutputFileName | ( | const char * | filename_native | ) |

Set output filename.

Examples
  FileAnonymize.cs, and MakeTemplate.cxx.

## Write()

bool gdcm::FileAnonymizer::Write | ( |  | ) |

Write the output file.

Examples
  FileAnonymize.cs, and MakeTemplate.cxx.

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

- gdcmFileAnonymizer.h