Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitk::DICOMSortByTag Class Reference

Compare two datasets by the value of a single tag (for use in DICOMTagBasedSorter). More...

#include <mitkDICOMSortByTag.h>

Inheritance diagram for mitk::DICOMSortByTag:
Collaboration diagram for mitk::DICOMSortByTag:

Public Member Functions

 mitkClassMacro (DICOMSortByTag, DICOMSortCriterion)
 
 mitkNewMacro1Param (DICOMSortByTag, const DICOMTag &)
 
 mitkNewMacro2Param (DICOMSortByTag, const DICOMTag &, DICOMSortCriterion::Pointer)
 
DICOMTagList GetTagsOfInterest () const override
 Tags used for comparison. More...
 
bool IsLeftBeforeRight (const mitk::DICOMDatasetAccess *left, const mitk::DICOMDatasetAccess *right) const override
 Answer the sorting question. More...
 
double NumericDistance (const mitk::DICOMDatasetAccess *from, const mitk::DICOMDatasetAccess *to) const override
 Calculate a distance between two datasets. This ansers the question of consecutive datasets. More...
 
void Print (std::ostream &os) const override
 brief describe this class in given stream. More...
 
bool operator== (const DICOMSortCriterion &other) const override
 
- Public Member Functions inherited from mitk::DICOMSortCriterion
 mitkClassMacroItkParent (DICOMSortCriterion, itk::LightObject)
 
DICOMTagList GetAllTagsOfInterest () const
 Tags used for comparison (includes seconary criteria). More...
 
DICOMSortCriterion::ConstPointer GetSecondaryCriterion () const
 The fallback criterion. More...
 

Protected Member Functions

 DICOMSortByTag (const DICOMTag &tag, DICOMSortCriterion::Pointer secondaryCriterion=nullptr)
 
 ~DICOMSortByTag () override
 
 DICOMSortByTag (const DICOMSortByTag &other)
 
DICOMSortByTagoperator= (const DICOMSortByTag &other)
 
bool StringCompare (const mitk::DICOMDatasetAccess *left, const mitk::DICOMDatasetAccess *right, const DICOMTag &tag) const
 
bool NumericCompare (const mitk::DICOMDatasetAccess *left, const mitk::DICOMDatasetAccess *right, const DICOMTag &tag) const
 
- Protected Member Functions inherited from mitk::DICOMSortCriterion
 DICOMSortCriterion (DICOMSortCriterion::Pointer secondaryCriterion)
 
 ~DICOMSortCriterion () override
 
bool NextLevelIsLeftBeforeRight (const mitk::DICOMDatasetAccess *left, const mitk::DICOMDatasetAccess *right) const
 
 DICOMSortCriterion (const DICOMSortCriterion &other)
 
DICOMSortCriterionoperator= (const DICOMSortCriterion &other)
 

Additional Inherited Members

- Protected Attributes inherited from mitk::DICOMSortCriterion
DICOMSortCriterion::Pointer m_SecondaryCriterion
 

Detailed Description

Compare two datasets by the value of a single tag (for use in DICOMTagBasedSorter).

The class will compare the tag values by

  1. numerical value if possible (i.e. both datasets have a value that is numerical)
  2. alphabetical order otherwise

If the comparison results in equalness, it is refered to the secondary criterion, see DICOMSortByTag::NextLevelIsLeftBeforeRight().

Definition at line 33 of file mitkDICOMSortByTag.h.

Constructor & Destructor Documentation

◆ DICOMSortByTag() [1/2]

mitk::DICOMSortByTag::DICOMSortByTag ( const DICOMTag tag,
DICOMSortCriterion::Pointer  secondaryCriterion = nullptr 
)
protected

Definition at line 18 of file mitkDICOMSortByTag.cpp.

References ~DICOMSortByTag().

Referenced by ~DICOMSortByTag().

◆ ~DICOMSortByTag()

mitk::DICOMSortByTag::~DICOMSortByTag ( )
overrideprotected

Definition at line 25 of file mitkDICOMSortByTag.cpp.

References DICOMSortByTag().

Referenced by DICOMSortByTag().

◆ DICOMSortByTag() [2/2]

mitk::DICOMSortByTag::DICOMSortByTag ( const DICOMSortByTag other)
protected

Definition at line 30 of file mitkDICOMSortByTag.cpp.

References operator=().

Member Function Documentation

◆ GetTagsOfInterest()

mitk::DICOMTagList mitk::DICOMSortByTag::GetTagsOfInterest ( ) const
overridevirtual

Tags used for comparison.

Implements mitk::DICOMSortCriterion.

Definition at line 78 of file mitkDICOMSortByTag.cpp.

References IsLeftBeforeRight().

Referenced by Print().

◆ IsLeftBeforeRight()

bool mitk::DICOMSortByTag::IsLeftBeforeRight ( const mitk::DICOMDatasetAccess left,
const mitk::DICOMDatasetAccess right 
) const
overridevirtual

Answer the sorting question.

Implements mitk::DICOMSortCriterion.

Definition at line 87 of file mitkDICOMSortByTag.cpp.

References NumericCompare(), and StringCompare().

Referenced by GetTagsOfInterest().

◆ mitkClassMacro()

mitk::DICOMSortByTag::mitkClassMacro ( DICOMSortByTag  ,
DICOMSortCriterion   
)

◆ mitkNewMacro1Param()

mitk::DICOMSortByTag::mitkNewMacro1Param ( DICOMSortByTag  ,
const DICOMTag  
)

◆ mitkNewMacro2Param()

mitk::DICOMSortByTag::mitkNewMacro2Param ( DICOMSortByTag  ,
const DICOMTag ,
DICOMSortCriterion::Pointer   
)

◆ NumericCompare()

bool mitk::DICOMSortByTag::NumericCompare ( const mitk::DICOMDatasetAccess left,
const mitk::DICOMDatasetAccess right,
const DICOMTag tag 
) const
protected

◆ NumericDistance()

double mitk::DICOMSortByTag::NumericDistance ( const mitk::DICOMDatasetAccess from,
const mitk::DICOMDatasetAccess to 
) const
overridevirtual

Calculate a distance between two datasets. This ansers the question of consecutive datasets.

Implements mitk::DICOMSortCriterion.

Definition at line 151 of file mitkDICOMSortByTag.cpp.

References mitk::DICOMDatasetAccess::GetTagValueAsString(), MITK_WARN, and mitk::DICOMDatasetFinding::value.

Referenced by NumericCompare().

◆ operator=()

mitk::DICOMSortByTag & mitk::DICOMSortByTag::operator= ( const DICOMSortByTag other)
protected

Definition at line 38 of file mitkDICOMSortByTag.cpp.

References mitk::DICOMSortCriterion::operator=(), and operator==().

Referenced by DICOMSortByTag().

◆ operator==()

bool mitk::DICOMSortByTag::operator== ( const DICOMSortCriterion other) const
overridevirtual

Implements mitk::DICOMSortCriterion.

Definition at line 50 of file mitkDICOMSortByTag.cpp.

References mitk::DICOMSortCriterion::m_SecondaryCriterion, and Print().

Referenced by operator=().

◆ Print()

void mitk::DICOMSortByTag::Print ( std::ostream &  os) const
overridevirtual

brief describe this class in given stream.

Implements mitk::DICOMSortCriterion.

Definition at line 70 of file mitkDICOMSortByTag.cpp.

References GetTagsOfInterest(), and mitk::DICOMTag::Print().

Referenced by operator==().

◆ StringCompare()

bool mitk::DICOMSortByTag::StringCompare ( const mitk::DICOMDatasetAccess left,
const mitk::DICOMDatasetAccess right,
const DICOMTag tag 
) const
protected

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