GDCM: gdcm::StrictScanner Class Reference

GDCM 3.2.10

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

StrictScanner. More...

`#include <gdcmStrictScanner.h>`

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

## Classes
struct | ltstr

## Public Types
typedef MappingType::const_iterator | ConstIterator
typedef std::map< const char *, TagToValue, ltstr > | MappingType
typedef std::map< Tag, const char * > | TagToValue
typedef TagToValue::value_type | TagToValueValueType
typedef std::set< std::string > | ValuesType

## Public Member Functions
| StrictScanner ()
| ~StrictScanner () override
void | AddPrivateTag (PrivateTag const &t)
void | AddSkipTag (Tag const &t)
| Add a tag that will need to be skipped. Those are root level skip tags.
void | AddTag (Tag const &t)
| Add a tag that will need to be read. Those are root level skip tags.
ConstIterator | Begin () const
void | ClearSkipTags ()
void | ClearTags ()
ConstIterator | End () const
Directory::FilenamesType | GetAllFilenamesFromTagToValue (Tag const &t, const char *valueref) const
const char * | GetFilenameFromTagToValue (Tag const &t, const char *valueref) const
Directory::FilenamesType const & | GetFilenames () const
Directory::FilenamesType | GetKeys () const
TagToValue const & | GetMapping (const char *filename) const
| Get the std::map mapping filenames to value for file 'filename'.
TagToValue const & | GetMappingFromTagToValue (Tag const &t, const char *value) const
| See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed.
MappingType const & | GetMappings () const
| Mappings are the mapping from a particular tag to the map, mapping filename to value:
Directory::FilenamesType | GetOrderedValues (Tag const &t) const
const char * | GetValue (const char *filename, Tag const &t) const
ValuesType const & | GetValues () const
| Get all the values found (in lexicographic order).
ValuesType | GetValues (Tag const &t) const
| Get all the values found (in lexicographic order) associated with Tag 't'.
bool | IsKey (const char *filename) const
void | Print (std::ostream &os) const override
| Print result.
void | PrintTable (std::ostream &os) 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< StrictScanner > | New ()
| for wrapped language: instantiate a reference counted object

## Protected Member Functions
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 StrictScanner &s)

## Detailed Description

StrictScanner.

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

Examples
  ScanDirectory.cs, and SimpleScanner.cxx.

## Member Typedef Documentation

## ◆ ConstIterator

typedef MappingType::const_iterator gdcm::StrictScanner::ConstIterator

## ◆ MappingType

typedef std::map<const char *,TagToValue, ltstr> gdcm::StrictScanner::MappingType

## ◆ TagToValue

typedef std::map<Tag, const char*> gdcm::StrictScanner::TagToValue

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 (hold in a std::vector) this avoid an extra copy of the byte array. Tag are used as Tag class since sizeof(tag) <= sizeof(pointer)

Examples
  SimpleScanner.cxx.

## ◆ TagToValueValueType

typedef TagToValue::value_type gdcm::StrictScanner::TagToValueValueType

## ◆ ValuesType

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

## Constructor & Destructor Documentation

## ◆ StrictScanner()

gdcm::StrictScanner::StrictScanner | ( |  | ) |
| inline

Referenced by New(), and operator<<.

## ◆ ~StrictScanner()

gdcm::StrictScanner::~StrictScanner | ( |  | ) |
| override

## Member Function Documentation

## ◆ AddPrivateTag()

void gdcm::StrictScanner::AddPrivateTag | ( | PrivateTag const & | t | ) |

## ◆ AddSkipTag()

void gdcm::StrictScanner::AddSkipTag | ( | Tag const & | t | ) |

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

## ◆ AddTag()

void gdcm::StrictScanner::AddTag | ( | Tag const & | t | ) |

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

Examples
  ScanDirectory.cs, and SimpleScanner.cxx.

## ◆ Begin()

ConstIterator gdcm::StrictScanner::Begin | ( |  | ) | const
| inline

## ◆ ClearSkipTags()

void gdcm::StrictScanner::ClearSkipTags | ( |  | ) |

## ◆ ClearTags()

void gdcm::StrictScanner::ClearTags | ( |  | ) |

## ◆ End()

ConstIterator gdcm::StrictScanner::End | ( |  | ) | const
| inline

## ◆ GetAllFilenamesFromTagToValue()

Directory::FilenamesType gdcm::StrictScanner::GetAllFilenamesFromTagToValue | ( | 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'

## ◆ GetFilenameFromTagToValue()

const char * gdcm::StrictScanner::GetFilenameFromTagToValue | ( | 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::StrictScanner::GetFilenames | ( |  | ) | const
| inline

## ◆ GetKeys()

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

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

## ◆ GetMapping()

TagToValue const & gdcm::StrictScanner::GetMapping | ( | const char * | filename | ) | const

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

Examples
  SimpleScanner.cxx.

## ◆ GetMappingFromTagToValue()

TagToValue const & gdcm::StrictScanner::GetMappingFromTagToValue | ( | Tag const & | t,
|  | const char * | value ) const

See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed.

## ◆ GetMappings()

MappingType const & gdcm::StrictScanner::GetMappings | ( |  | ) | const
| inline

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

## ◆ GetOrderedValues()

Directory::FilenamesType gdcm::StrictScanner::GetOrderedValues | ( | 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)

## ◆ GetValue()

const char * gdcm::StrictScanner::GetValue | ( | 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 !

## ◆ GetValues() [1/2]

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

Get all the values found (in lexicographic order).

## ◆ GetValues() [2/2]

ValuesType gdcm::StrictScanner::GetValues | ( | Tag const & | t | ) | const

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

## ◆ IsKey()

bool gdcm::StrictScanner::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

Examples
  ScanDirectory.cs, and SimpleScanner.cxx.

## ◆ New()

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

for wrapped language: instantiate a reference counted object

Examples
  ScanDirectory.cs.

References StrictScanner().

## ◆ Print()

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

Print result.

Reimplemented from gdcm::Object.

Referenced by operator<<.

## ◆ PrintTable()

void gdcm::StrictScanner::PrintTable | ( | std::ostream & | os | ) | const

## ◆ ProcessPublicTag()

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

## ◆ Scan()

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

Start the scan !

Examples
  ScanDirectory.cs, and SimpleScanner.cxx.

## Friends And Related Symbol Documentation

## ◆ operator<<

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

References StrictScanner(), and Print().

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

- gdcmStrictScanner.h