Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkEquiDistantBlocksSorter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkEquiDistantBlocksSorter_h
14 #define mitkEquiDistantBlocksSorter_h
15 
16 #include "mitkDICOMDatasetSorter.h"
17 #include "mitkDICOMSortCriterion.h"
19 
20 #include "mitkVector.h"
21 
22 namespace mitk
23 {
24 
60 {
61  public:
62 
64 
65  itkNewMacro( EquiDistantBlocksSorter );
66 
68 
74  void Sort() override;
75 
79  void SetAcceptTilt(bool accept);
80  bool GetAcceptTilt() const;
81 
85  void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3);
92  void SetToleratedOriginOffset(double millimeters = 0.005);
93 
94  double GetToleratedOriginOffset() const;
96 
97  void SetAcceptTwoSlicesGroups(bool accept);
99 
100  void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
101 
102  bool operator==(const DICOMDatasetSorter& other) const override;
103 
104  protected:
105 
116  {
117  public:
118 
120 
125 
126  void SetFirstFilenameOfBlock(const std::string& filename);
127  std::string GetFirstFilenameOfBlock() const;
128  void SetLastFilenameOfBlock(const std::string& filename);
129  std::string GetLastFilenameOfBlock() const;
130 
135 
138 
143 
148 
153 
159 
164  void FlagGantryTilt(const GantryTiltInformation& tiltInfo);
165 
170 
171  protected:
172 
175 
177 
181  };
182 
194  std::shared_ptr<SliceGroupingAnalysisResult>
196 
200  std::string
201  ConstCharStarToString(const char* s);
202 
205 
208 
210 
211  typedef std::vector<std::shared_ptr<SliceGroupingAnalysisResult> > ResultsList;
213 
216 
218 };
219 
220 }
221 
222 #endif
#define MITKDICOM_EXPORT
Interface to datasets that is presented to sorting classes such as DICOMDatasetSorter.
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
Return type of AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
const DICOMDatasetList & GetUnsortedDatasets() const
Remaining files, which could not be grouped.
void UndoPrematureGrouping()
Only meaningful for use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption.
void AddFilesToUnsortedBlock(const DICOMDatasetList &datasets)
void AddFileToUnsortedBlock(DICOMDatasetAccess *dataset)
Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
IOVolumeSplitReason::ConstPointer GetSplitReason() const
void FlagGantryTilt(const GantryTiltInformation &tiltInfo)
Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
const GantryTiltInformation & GetTiltInfo() const
Detailed description of gantry tilt.
bool ContainsGantryTilt()
Whether or not the grouped result contain a gantry tilt.
const DICOMDatasetList & GetBlockDatasets() const
Grouping result, all same origin-to-origin distance w/o gaps.
void SetFirstFilenameOfBlock(const std::string &filename)
void SetLastFilenameOfBlock(const std::string &filename)
void AddFileToSortedBlock(DICOMDatasetAccess *dataset)
Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
Split inputs into blocks of equidistant slices (for use in DICOMITKSeriesGDCMReader).
EquiDistantBlocksSorter(const EquiDistantBlocksSorter &other)
void SetAcceptTwoSlicesGroups(bool accept)
bool IsToleratedOriginOffsetAbsolute() const
mitkClassMacro(EquiDistantBlocksSorter, DICOMDatasetSorter)
bool operator==(const DICOMDatasetSorter &other) const override
void Sort() override
Delegates work to AnalyzeFileForITKImageSeriesReaderSpacingAssumption(). AnalyzeFileForITKImageSeries...
void SetToleratedOriginOffset(double millimeters=0.005)
See class description and SetToleratedOriginOffsetToAdaptive().
EquiDistantBlocksSorter & operator=(const EquiDistantBlocksSorter &other)
void SetAcceptTilt(bool accept)
Whether or not to accept images from a tilted acquisition in a single output group.
double GetToleratedOriginOffset() const
std::vector< std::shared_ptr< SliceGroupingAnalysisResult > > ResultsList
bool GetAcceptTwoSlicesGroups() const
std::shared_ptr< SliceGroupingAnalysisResult > AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList &files, bool groupsOfSimilarImages)
Ensure an equal z-spacing for a group of files.
DICOMTagList GetTagsOfInterest() override
Return the tags of interest (to facilitate scanning)
std::string ConstCharStarToString(const char *s)
Safely convert const char* to std::string.
void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct=0.3)
See class description and SetToleratedOriginOffset().
void PrintConfiguration(std::ostream &os, const std::string &indent="") const override
Print configuration details into stream.
Gantry tilt analysis result.
std::shared_ptr< IOVolumeSplitReason > Pointer
std::shared_ptr< const IOVolumeSplitReason > ConstPointer
Find image slices visible on a given plane.
std::vector< DICOMDatasetAccess * > DICOMDatasetList
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:59