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

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

#include <gdcmSorter.h>

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

Public Types

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

Public Member Functions

 Sorter ()
 
virtual ~Sorter ()
 
bool AddSelect (Tag const &tag, const char *value)
 UNSUPPORTED FOR NOW. More...
 
const std::vector< std::string > & GetFilenames () const
 
void Print (std::ostream &os) const
 Print. More...
 
void SetSortFunction (SortFunction f)
 
virtual bool Sort (std::vector< std::string > const &filenames)
 Typically the output of Directory::GetFilenames() More...
 
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
 

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 everytime you call Sort, all files specified as input paramater are read
See also
Scanner
Examples:
SortImage.cxx, and VolumeSorter.cxx.

Member Typedef Documentation

typedef std::map<Tag,std::string> gdcm::Sorter::SelectionMap
protected
typedef bool(* gdcm::Sorter::SortFunction) (DataSet const &, DataSet const &)

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

UNSUPPORTED FOR NOW.

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, gdcmorthoplanes.cxx, reslicesphere.cxx, SortImage.cxx, and VolumeSorter.cxx.
void gdcm::Sorter::Print ( std::ostream &  os) const

Print.

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

Referenced by gdcm::operator<<().

void gdcm::Sorter::SetSortFunction ( SortFunction  f)
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.
virtual bool gdcm::Sorter::StableSort ( std::vector< std::string > const &  filenames)
virtual

Friends And Related Function Documentation

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

Member Data Documentation

std::vector<std::string> gdcm::Sorter::Filenames
protected
std::map<Tag,std::string> gdcm::Sorter::Selection
protected
SortFunction gdcm::Sorter::SortFunc
protected

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

Generated on Fri Sep 25 2015 17:58:33 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo