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

Scanner2. More...

#include <gdcmScanner2.h>

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

Classes

struct  ltstr
 

Public Types

typedef PrivateMappingType::const_iterator PrivateConstIterator
 
typedef std::map< const char *, PrivateTagToValue, ltstrPrivateMappingType
 
typedef std::map< PrivateTag, const char * > PrivateTagToValue
 
typedef PrivateTagToValue::value_type PrivateTagToValueValueType
 
typedef PublicMappingType::const_iterator PublicConstIterator
 
typedef std::map< const char *, PublicTagToValue, ltstrPublicMappingType
 
typedef std::map< Tag, const char * > PublicTagToValue
 
typedef PublicTagToValue::value_type PublicTagToValueValueType
 
typedef std::set< std::string > ValuesType
 

Public Member Functions

 Scanner2 ()
 
 ~Scanner2 () 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
 See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed.
 
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
 Get all the values found (in lexicographic order) associated with PrivateTag 'pt'.
 
PublicTagToValue const & GetPublicMapping (const char *filename) const
 Get the std::map mapping filenames to value for file 'filename'.
 
PublicMappingType const & GetPublicMappings () const
 Mappings are the mapping from a particular tag to the map, mapping filename to value:
 
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
 
CommandGetCommand (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< Scanner2New ()
 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 Scanner2 &s)
 

Detailed Description

Scanner2.

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:

Member Typedef Documentation

◆ PrivateConstIterator

typedef PrivateMappingType::const_iterator gdcm::Scanner2::PrivateConstIterator

◆ PrivateMappingType

◆ PrivateTagToValue

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

◆ PrivateTagToValueValueType

typedef PrivateTagToValue::value_type gdcm::Scanner2::PrivateTagToValueValueType

◆ PublicConstIterator

typedef PublicMappingType::const_iterator gdcm::Scanner2::PublicConstIterator

◆ PublicMappingType

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

◆ PublicTagToValue

typedef std::map<Tag, const char*> gdcm::Scanner2::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::Scanner2::PublicTagToValueValueType

◆ ValuesType

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

Constructor & Destructor Documentation

◆ Scanner2()

gdcm::Scanner2::Scanner2 ( )
inline

◆ ~Scanner2()

gdcm::Scanner2::~Scanner2 ( )
override

Member Function Documentation

◆ AddPrivateTag()

bool gdcm::Scanner2::AddPrivateTag ( PrivateTag const &  pt)

◆ AddPublicTag()

bool gdcm::Scanner2::AddPublicTag ( Tag const &  t)

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

◆ AddSkipTag()

bool gdcm::Scanner2::AddSkipTag ( Tag const &  t)

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

◆ Begin()

PublicConstIterator gdcm::Scanner2::Begin ( ) const
inline

◆ ClearPrivateTags()

void gdcm::Scanner2::ClearPrivateTags ( )

◆ ClearPublicTags()

void gdcm::Scanner2::ClearPublicTags ( )

◆ ClearSkipTags()

void gdcm::Scanner2::ClearSkipTags ( )

◆ End()

PublicConstIterator gdcm::Scanner2::End ( ) const
inline

◆ GetAllFilenamesFromPrivateTagToValue()

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

◆ GetAllFilenamesFromPublicTagToValue()

Directory::FilenamesType gdcm::Scanner2::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::Scanner2::GetFilenameFromPrivateTagToValue ( PrivateTag const &  pt,
const char *  valueref 
) const

◆ GetFilenameFromPublicTagToValue()

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

Return the list of filenames.

◆ GetKeys()

Directory::FilenamesType gdcm::Scanner2::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::Scanner2::GetMappingFromPrivateTagToValue ( PrivateTag const &  pt,
const char *  value 
) const

◆ GetMappingFromPublicTagToValue()

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

See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed.

◆ GetPrivateMapping()

PrivateTagToValue const & gdcm::Scanner2::GetPrivateMapping ( const char *  filename) const

◆ GetPrivateMappings()

PrivateMappingType const & gdcm::Scanner2::GetPrivateMappings ( ) const
inline

◆ GetPrivateOrderedValues()

Directory::FilenamesType gdcm::Scanner2::GetPrivateOrderedValues ( PrivateTag const &  pt) const

◆ GetPrivateValue()

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

◆ GetPrivateValues()

ValuesType gdcm::Scanner2::GetPrivateValues ( PrivateTag const &  pt) const

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

◆ GetPublicMapping()

PublicTagToValue const & gdcm::Scanner2::GetPublicMapping ( const char *  filename) const

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

◆ GetPublicMappings()

PublicMappingType const & gdcm::Scanner2::GetPublicMappings ( ) const
inline

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

◆ GetPublicOrderedValues()

Directory::FilenamesType gdcm::Scanner2::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::Scanner2::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::Scanner2::GetPublicValues ( Tag const &  t) const

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

◆ GetValues()

ValuesType const & gdcm::Scanner2::GetValues ( ) const
inline

Get all the values found (in lexicographic order)

◆ IsKey()

bool gdcm::Scanner2::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()

static SmartPointer< Scanner2 > gdcm::Scanner2::New ( )
inlinestatic

for wrapped language: instantiate a reference counted object

◆ Print()

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

Print result.

Reimplemented from gdcm::Object.

◆ PrintTable()

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

Print result as CSV table.

◆ PrivateBegin()

PrivateConstIterator gdcm::Scanner2::PrivateBegin ( ) const
inline

◆ PrivateEnd()

PrivateConstIterator gdcm::Scanner2::PrivateEnd ( ) const
inline

◆ ProcessPrivateTag()

void gdcm::Scanner2::ProcessPrivateTag ( StringFilter sf,
const char *  filename 
)
protected

◆ ProcessPublicTag()

void gdcm::Scanner2::ProcessPublicTag ( StringFilter sf,
const char *  filename 
)
protected

◆ Scan()

bool gdcm::Scanner2::Scan ( Directory::FilenamesType const &  filenames)

Start the scan !

Friends And Related Symbol Documentation

◆ operator<<

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

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