GDCM: gdcm::StrictScanner2 Class Reference

GDCM 3.2.7

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
gdcm::StrictScanner2 Class Reference

StrictScanner2. More...

`#include <gdcmStrictScanner2.h>`

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

## Classes
struct | ltstr

## Public Types
typedef PrivateMappingType::const_iterator | PrivateConstIterator
typedef std::map< const char *, PrivateTagToValue, ltstr > | PrivateMappingType
typedef std::map< PrivateTag, const char * > | PrivateTagToValue
typedef PrivateTagToValue::value_type | PrivateTagToValueValueType
typedef PublicMappingType::const_iterator | PublicConstIterator
typedef std::map< const char *, PublicTagToValue, ltstr > | PublicMappingType
typedef std::map< Tag, const char * > | PublicTagToValue
typedef PublicTagToValue::value_type | PublicTagToValueValueType
typedef std::set< std::string > | ValuesType

## Public Member Functions
| StrictScanner2 ()
| ~StrictScanner2 () override
bool | AddPrivateTag (PrivateTag const &pt)
bool | AddPublicTag (Tag const &t)
| Add a tag that will need to be read. Those are root level tags.
bool | AddSkipTag (Tag const &t)
| Add a tag that will need to be skipped. Those are root level skip tags.
PublicConstIterator | Begin () const
void | ClearPrivateTags ()
void | ClearPublicTags ()
void | ClearSkipTags ()
PublicConstIterator | End () const
Directory::FilenamesType | GetAllFilenamesFromPrivateTagToValue (PrivateTag const &pt, const char *valueref) const
Directory::FilenamesType | GetAllFilenamesFromPublicTagToValue (Tag const &t, const char *valueref) const
const char * | GetFilenameFromPrivateTagToValue (PrivateTag const &pt, const char *valueref) const
const char * | GetFilenameFromPublicTagToValue (Tag const &t, const char *valueref) const
Directory::FilenamesType const & | GetFilenames () const
| Return the list of filenames.
Directory::FilenamesType | GetKeys () const
PrivateTagToValue const & | GetMappingFromPrivateTagToValue (PrivateTag const &pt, const char *value) const
PublicTagToValue const & | GetMappingFromPublicTagToValue (Tag const &t, const char *value) const
PrivateTagToValue const & | GetPrivateMapping (const char *filename) const
PrivateMappingType const & | GetPrivateMappings () const
Directory::FilenamesType | GetPrivateOrderedValues (PrivateTag const &pt) const
const char * | GetPrivateValue (const char *filename, PrivateTag const &t) const
ValuesType | GetPrivateValues (PrivateTag const &pt) const
PublicTagToValue const & | GetPublicMapping (const char *filename) const
| Get the std::map mapping filenames to value for file 'filename'.
PublicMappingType const & | GetPublicMappings () const
Directory::FilenamesType | GetPublicOrderedValues (Tag const &t) const
const char * | GetPublicValue (const char *filename, Tag const &t) const
ValuesType | GetPublicValues (Tag const &t) const
| Get all the values found (in lexicographic order) associated with Tag 't'.
ValuesType const & | GetValues () const
| Get all the values found (in lexicographic order).
bool | IsKey (const char *filename) const
void | Print (std::ostream &os) const override
| Print result.
void | PrintTable (std::ostream &os, bool header=false) const
| Print result as CSV table.
PrivateConstIterator | PrivateBegin () const
PrivateConstIterator | PrivateEnd () const
bool | Scan (Directory::FilenamesType const &filenames)
| Start the scan !
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 &)

## Static Public Member Functions
static SmartPointer< StrictScanner2 > | New ()
| for wrapped language: instantiate a reference counted object

## Protected Member Functions
void | ProcessPrivateTag (StringFilter &sf, const char *filename)
void | ProcessPublicTag (StringFilter &sf, const char *filename)
Protected Member Functions inherited from gdcm::Object
void | Register ()
void | UnRegister ()

## Friends
std::ostream & | operator<< (std::ostream &_os, const StrictScanner2 &s)

## Detailed Description

StrictScanner2.

This filter is meant for quickly browsing a FileSet (a set of files on disk). Special consideration are taken so as to read the minimum amount of information in each file in order to retrieve the user specified set of DICOM Attribute.

This filter is dealing with both VRASCII and VRBINARY element, thanks to the help of StringFilter

Warning
  IMPORTANT In case of file where tags are not ordered (illegal as per DICOM specification), the output will be missing information

Note
  implementation details. All values are stored in a std::set of std::string. Then the address of the cstring underlying the std::string is used in the std::map.

This class implement the Subject/Observer pattern trigger the following events:

- ProgressEvent
- StartEvent
- EndEvent

## Member Typedef Documentation

## ◆ PrivateConstIterator

typedef PrivateMappingType::const_iterator gdcm::StrictScanner2::PrivateConstIterator

## ◆ PrivateMappingType

typedef std::map<const char *, PrivateTagToValue, ltstr> gdcm::StrictScanner2::PrivateMappingType

## ◆ PrivateTagToValue

typedef std::map<PrivateTag, const char *> gdcm::StrictScanner2::PrivateTagToValue

## ◆ PrivateTagToValueValueType

typedef PrivateTagToValue::value_type gdcm::StrictScanner2::PrivateTagToValueValueType

## ◆ PublicConstIterator

typedef PublicMappingType::const_iterator gdcm::StrictScanner2::PublicConstIterator

## ◆ PublicMappingType

typedef std::map<const char *, PublicTagToValue, ltstr> gdcm::StrictScanner2::PublicMappingType

## ◆ PublicTagToValue

typedef std::map<Tag, const char *> gdcm::StrictScanner2::PublicTagToValue

struct to map a filename to a value Implementation note: all std::map in this class will be using const char * and not std::string since we are pointing to existing std::string (held in a std::vector) this avoid an extra copy of the byte array. Tag are used as Tag class since sizeof(tag) <= sizeof(pointer)

## ◆ PublicTagToValueValueType

typedef PublicTagToValue::value_type gdcm::StrictScanner2::PublicTagToValueValueType

## ◆ ValuesType

typedef std::set<std::string> gdcm::StrictScanner2::ValuesType

## Constructor & Destructor Documentation

## ◆ StrictScanner2()

gdcm::StrictScanner2::StrictScanner2 | ( |  | ) |
| inline

Referenced by New(), and operator<<.

## ◆ ~StrictScanner2()

gdcm::StrictScanner2::~StrictScanner2 | ( |  | ) |
| override

## Member Function Documentation

## ◆ AddPrivateTag()

bool gdcm::StrictScanner2::AddPrivateTag | ( | PrivateTag const & | pt | ) |

## ◆ AddPublicTag()

bool gdcm::StrictScanner2::AddPublicTag | ( | Tag const & | t | ) |

Add a tag that will need to be read. Those are root level tags.

## ◆ AddSkipTag()

bool gdcm::StrictScanner2::AddSkipTag | ( | Tag const & | t | ) |

Add a tag that will need to be skipped. Those are root level skip tags.

## ◆ Begin()

PublicConstIterator gdcm::StrictScanner2::Begin | ( |  | ) | const
| inline

## ◆ ClearPrivateTags()

void gdcm::StrictScanner2::ClearPrivateTags | ( |  | ) |

## ◆ ClearPublicTags()

void gdcm::StrictScanner2::ClearPublicTags | ( |  | ) |

## ◆ ClearSkipTags()

void gdcm::StrictScanner2::ClearSkipTags | ( |  | ) |

## ◆ End()

PublicConstIterator gdcm::StrictScanner2::End | ( |  | ) | const
| inline

## ◆ GetAllFilenamesFromPrivateTagToValue()

Directory::FilenamesType gdcm::StrictScanner2::GetAllFilenamesFromPrivateTagToValue | ( | PrivateTag const & | pt,
|  | const char * | valueref ) const

## ◆ GetAllFilenamesFromPublicTagToValue()

Directory::FilenamesType gdcm::StrictScanner2::GetAllFilenamesFromPublicTagToValue | ( | Tag const & | t,
|  | const char * | valueref ) const

Will loop over all files and return a vector of std::strings of filenames where value match the reference value 'valueref'

## ◆ GetFilenameFromPrivateTagToValue()

const char * gdcm::StrictScanner2::GetFilenameFromPrivateTagToValue | ( | PrivateTag const & | pt,
|  | const char * | valueref ) const

## ◆ GetFilenameFromPublicTagToValue()

const char * gdcm::StrictScanner2::GetFilenameFromPublicTagToValue | ( | Tag const & | t,
|  | const char * | valueref ) const

Will loop over all files and return the first file where value match the reference value 'valueref'

## ◆ GetFilenames()

Directory::FilenamesType const & gdcm::StrictScanner2::GetFilenames | ( |  | ) | const
| inline

Return the list of filenames.

## ◆ GetKeys()

Directory::FilenamesType gdcm::StrictScanner2::GetKeys | ( |  | ) | const

Return the list of filename that are key in the internal map, which means those filename were properly parsed

## ◆ GetMappingFromPrivateTagToValue()

PrivateTagToValue const & gdcm::StrictScanner2::GetMappingFromPrivateTagToValue | ( | PrivateTag const & | pt,
|  | const char * | value ) const

## ◆ GetMappingFromPublicTagToValue()

PublicTagToValue const & gdcm::StrictScanner2::GetMappingFromPublicTagToValue | ( | Tag const & | t,
|  | const char * | value ) const

See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed

## ◆ GetPrivateMapping()

PrivateTagToValue const & gdcm::StrictScanner2::GetPrivateMapping | ( | const char * | filename | ) | const

## ◆ GetPrivateMappings()

PrivateMappingType const & gdcm::StrictScanner2::GetPrivateMappings | ( |  | ) | const
| inline

## ◆ GetPrivateOrderedValues()

Directory::FilenamesType gdcm::StrictScanner2::GetPrivateOrderedValues | ( | PrivateTag const & | pt | ) | const

## ◆ GetPrivateValue()

const char * gdcm::StrictScanner2::GetPrivateValue | ( | const char * | filename,
|  | PrivateTag const & | t ) const

## ◆ GetPrivateValues()

ValuesType gdcm::StrictScanner2::GetPrivateValues | ( | PrivateTag const & | pt | ) | const

Get all the values found (in lexicographic order) associated with PrivateTag 'pt'

## ◆ GetPublicMapping()

PublicTagToValue const & gdcm::StrictScanner2::GetPublicMapping | ( | const char * | filename | ) | const

Get the std::map mapping filenames to value for file 'filename'.

## ◆ GetPublicMappings()

PublicMappingType const & gdcm::StrictScanner2::GetPublicMappings | ( |  | ) | const
| inline

Mappings are the mapping from a particular tag to the map, mapping filename to value:

## ◆ GetPublicOrderedValues()

Directory::FilenamesType gdcm::StrictScanner2::GetPublicOrderedValues | ( | Tag const & | t | ) | const

Get all the values found (in a vector) associated with Tag 't' This function is identical to GetValues, but is accessible from the wrapped layer (python, C#, java)

## ◆ GetPublicValue()

const char * gdcm::StrictScanner2::GetPublicValue | ( | const char * | filename,
|  | Tag const & | t ) const

Retrieve the value found for tag: t associated with file: filename This is meant for a single short call. If multiple calls (multiple tags) should be done, prefer the GetMapping function, and then reuse the TagToValue hash table.

Warning
  Tag 't' should have been added via AddTag() prior to the Scan() call !

## ◆ GetPublicValues()

ValuesType gdcm::StrictScanner2::GetPublicValues | ( | Tag const & | t | ) | const

Get all the values found (in lexicographic order) associated with Tag 't'.

## ◆ GetValues()

ValuesType const & gdcm::StrictScanner2::GetValues | ( |  | ) | const
| inline

Get all the values found (in lexicographic order).

## ◆ IsKey()

bool gdcm::StrictScanner2::IsKey | ( | const char * | filename | ) | const

Check if filename is a key in the Mapping table. returns true only of file can be found, which means the file was indeed a DICOM file that could be processed

## ◆ New()

SmartPointer< StrictScanner2 > gdcm::StrictScanner2::New | ( |  | ) |
| inlinestatic

for wrapped language: instantiate a reference counted object

References StrictScanner2().

## ◆ Print()

void gdcm::StrictScanner2::Print | ( | std::ostream & | os | ) | const
| overridevirtual

Print result.

Reimplemented from gdcm::Object.

Referenced by operator<<.

## ◆ PrintTable()

void gdcm::StrictScanner2::PrintTable | ( | std::ostream & | os,
|  | bool | header = false ) const

Print result as CSV table.

## ◆ PrivateBegin()

PrivateConstIterator gdcm::StrictScanner2::PrivateBegin | ( |  | ) | const
| inline

## ◆ PrivateEnd()

PrivateConstIterator gdcm::StrictScanner2::PrivateEnd | ( |  | ) | const
| inline

## ◆ ProcessPrivateTag()

void gdcm::StrictScanner2::ProcessPrivateTag | ( | StringFilter & | sf,
|  | const char * | filename )
| protected

## ◆ ProcessPublicTag()

void gdcm::StrictScanner2::ProcessPublicTag | ( | StringFilter & | sf,
|  | const char * | filename )
| protected

## ◆ Scan()

bool gdcm::StrictScanner2::Scan | ( | Directory::FilenamesType const & | filenames | ) |

Start the scan !

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | _os,
|  | const StrictScanner2 & | s )
| friend

References StrictScanner2(), and Print().

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

- gdcmStrictScanner2.h