13 #ifndef mitkDICOMTagBasedSorter_h
14 #define mitkDICOMTagBasedSorter_h
52 virtual std::string
operator()(
const std::string&)
const = 0;
67 std::string
operator()(
const std::string&)
const override;
70 unsigned int m_Precision;
140 return m_DefaultStrictSorting;
145 return m_DefaultExpectDistanceOne;
201 const static bool m_DefaultStrictSorting =
false;
202 const static bool m_DefaultExpectDistanceOne =
false;
Interface to datasets that is presented to sorting classes such as DICOMDatasetSorter.
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
Cuts a number after configured number of decimal places. An instance of this class can be used to avo...
CutDecimalPlaces(unsigned int precision)
std::string operator()(const std::string &) const override
Implements the "processing".
unsigned int GetPrecision() const
TagValueProcessor * Clone() const override
CutDecimalPlaces(const CutDecimalPlaces &other)
Processes tag values before they are compared. These classes could do some kind of normalization such...
virtual TagValueProcessor * Clone() const =0
virtual std::string operator()(const std::string &) const =0
Implements the "processing".
virtual ~TagValueProcessor()
Sort DICOM datasets based on configurable tags.
static bool GetDefaultExpectDistanceOne()
void PrintConfiguration(std::ostream &os, const std::string &indent="") const override
Print configuration details into given stream.
bool GetExpectDistanceOne() const
DICOMTagList m_DistinguishingTags
void SetStrictSorting(bool strict)
Whether or not groups should be checked for consecutive tag values.
DICOMTagList GetTagsOfInterest() override
A list of all the tags needed for processing (facilitates scanning).
void SetExpectDistanceOne(bool strict)
Flag for a special case in "strict sorting". Please see documentation of SetStrictSorting().
std::string BuildGroupID(DICOMDatasetAccess *dataset)
Helper for SplitInputGroups().
GroupIDToListType & SortGroups(GroupIDToListType &groups, SplitReasonListType &splitReasons)
Implements the sorting step. Relatively simple implementation thanks to std::sort and a parameterizat...
void SetSortCriterion(DICOMSortCriterion::ConstPointer criterion)
Define the sorting criterion (which holds seconardy criteria)
std::map< std::string, IOVolumeSplitReason::Pointer > SplitReasonListType
DICOMTagBasedSorter & operator=(const DICOMTagBasedSorter &other)
mitkClassMacro(DICOMTagBasedSorter, DICOMDatasetSorter)
std::map< const DICOMTag, TagValueProcessor * > TagValueProcessorMap
~DICOMTagBasedSorter() override
bool operator==(const DICOMDatasetSorter &other) const override
TagValueProcessorMap m_TagValueProcessor
DICOMSortCriterion::ConstPointer GetSortCriterion() const
GroupIDToListType SplitInputGroups(SplitReasonListType &splitReasons)
Implements the "distiguishing tags". To sort datasets into different groups, a long string will be bu...
static bool GetDefaultStrictSorting()
void Sort() override
Actually sort as described in the Detailed Description.
void AddDistinguishingTag(const DICOMTag &, TagValueProcessor *tagValueProcessor=nullptr)
Datasets that differ in given tag's value will be sorted into separate outputs.
const TagValueProcessor * GetTagValueProcessorForDistinguishingTag(const DICOMTag &) const
DICOMSortCriterion::ConstPointer m_SortCriterion
std::map< std::string, DICOMDatasetList > GroupIDToListType
DICOMTagList GetDistinguishingTags() const
bool GetStrictSorting() const
DICOMTagBasedSorter(const DICOMTagBasedSorter &other)
Representation of a DICOM tag.
Find image slices visible on a given plane.
std::vector< DICOMTag > DICOMTagList
Helper struct to feed into std::sort, configured via DICOMSortCriterion.
ParameterizedDatasetSort(DICOMSortCriterion::ConstPointer)
DICOMSortCriterion::ConstPointer m_SortCriterion