GDCM: gdcm::Sorter Class Reference

GDCM 3.2.11

Public Types | Public Member Functions | Protected Types | Protected Attributes | Friends | List of all members
gdcm::Sorter Class Reference

Sorter. More...

`#include <gdcmSorter.h>`

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

## Public Types
typedef bool(*) | SortFunction(DataSet const &, DataSet const &)
| Set the sort function which compares one dataset to the other.

## Public Member Functions
| Sorter ()
virtual | ~Sorter ()
bool | AddSelect (Tag const &tag, const char *value)
| UNSUPPORTED FOR NOW.
const std::vector< std::string > & | GetFilenames () const
void | Print (std::ostream &os) const
| Print.
void | SetSortFunction (SortFunction f)
void | SetTagsToRead (std::set< Tag > const &tags)
virtual bool | Sort (std::vector< std::string > const &filenames)
| Typically the output of Directory::GetFilenames().
virtual bool | StableSort (std::vector< std::string > const &filenames)

## Protected Types
typedef std::map< Tag, std::string > | SelectionMap

## Protected Attributes
std::vector< std::string > | Filenames
std::map< Tag, std::string > | Selection
SortFunction | SortFunc
std::set< Tag > | TagsToRead

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

## Detailed Description

Sorter.

General class to do sorting using a custom function You simply need to provide a function of type: Sorter::SortFunction

Warning
  implementation details. For now there is no cache mechanism. Which means that every time you call Sort, all files specified as input parameter are read

See also
  Scanner

Examples
  SortImage.cxx, SortImage2.cs, and VolumeSorter.cxx.

## Member Typedef Documentation

## ◆ SelectionMap

typedef std::map<Tag,std::string> gdcm::Sorter::SelectionMap
| protected

## ◆ SortFunction

typedef bool(*) gdcm::Sorter::SortFunction(DataSet const &, DataSet const &)

Set the sort function which compares one dataset to the other.

## Constructor & Destructor Documentation

## ◆ Sorter()

gdcm::Sorter::Sorter | ( |  | ) |

Referenced by operator<<.

## ◆ ~Sorter()

virtual gdcm::Sorter::~Sorter | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ AddSelect()

bool gdcm::Sorter::AddSelect | ( | Tag const & | tag,
|  | const char * | value )

UNSUPPORTED FOR NOW.

## ◆ GetFilenames()

const std::vector< std::string > & gdcm::Sorter::GetFilenames | ( |  | ) | const
| inline

Return the list of filenames as sorted by the specific algorithm used. Empty by default (before Sort() is called)

Examples
  Compute3DSpacing.cxx, SortImage.cxx, VolumeSorter.cxx, gdcmorthoplanes.cxx, and reslicesphere.cxx.

References Filenames.

## ◆ Print()

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

Print.

Examples
  SortImage.cxx, VolumeSorter.cxx, and gdcmorthoplanes.cxx.

Referenced by operator<<.

## ◆ SetSortFunction()

void gdcm::Sorter::SetSortFunction | ( | SortFunction | f | ) |

Examples
  SortImage.cxx, SortImage2.cs, and VolumeSorter.cxx.

## ◆ SetTagsToRead()

void gdcm::Sorter::SetTagsToRead | ( | std::set< Tag > const & | tags | ) |

Specify a set of tags to be read in during the sort procedure. By default this set is empty, in which case the entire image, including pixel data, is read in.

## ◆ Sort()

virtual bool gdcm::Sorter::Sort | ( | std::vector< std::string > const & | filenames | ) |
| virtual

Typically the output of Directory::GetFilenames().

Reimplemented in gdcm::IPPSorter.

Examples
  SortImage.cxx.

## ◆ StableSort()

virtual bool gdcm::Sorter::StableSort | ( | std::vector< std::string > const & | filenames | ) |
| virtual

Examples
  SortImage.cxx, and VolumeSorter.cxx.

## Friends And Related Symbol Documentation

## ◆ operator<<

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

References Sorter(), operator<<, and Print().

Referenced by operator<<.

## Member Data Documentation

## ◆ Filenames

std::vector<std::string> gdcm::Sorter::Filenames
| protected

Referenced by GetFilenames().

## ◆ Selection

std::map<Tag,std::string> gdcm::Sorter::Selection
| protected

## ◆ SortFunc

SortFunction gdcm::Sorter::SortFunc
| protected

## ◆ TagsToRead

std::set<Tag> gdcm::Sorter::TagsToRead
| protected

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

- gdcmSorter.h