Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
67  DICOMTagList GetTagsOfInterest() override;
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;
95  bool IsToleratedOriginOffsetAbsolute() const;
96 
97  void SetAcceptTwoSlicesGroups(bool accept);
98  bool GetAcceptTwoSlicesGroups() const;
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 
124  const DICOMDatasetList& GetBlockDatasets() const;
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 
134  const DICOMDatasetList& GetUnsortedDatasets() const;
135 
136  IOVolumeSplitReason::ConstPointer GetSplitReason() const;
137  IOVolumeSplitReason::Pointer GetSplitReason();
138 
142  bool ContainsGantryTilt();
143 
147  const GantryTiltInformation& GetTiltInfo() const;
148 
152  void AddFileToSortedBlock(DICOMDatasetAccess* dataset);
153 
157  void AddFileToUnsortedBlock(DICOMDatasetAccess* dataset);
158  void AddFilesToUnsortedBlock(const DICOMDatasetList& datasets);
159 
164  void FlagGantryTilt(const GantryTiltInformation& tiltInfo);
165 
169  void UndoPrematureGrouping();
170 
171  protected:
172 
175 
177 
181  };
182 
194  std::shared_ptr<SliceGroupingAnalysisResult>
195  AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList& files, bool groupsOfSimilarImages);
196 
200  std::string
201  ConstCharStarToString(const char* s);
202 
204  ~EquiDistantBlocksSorter() override;
205 
207  EquiDistantBlocksSorter& operator=(const EquiDistantBlocksSorter& other);
208 
210 
211  typedef std::vector<std::shared_ptr<SliceGroupingAnalysisResult> > ResultsList;
213 
216 
218 };
219 
220 }
221 
222 #endif
mitk::IOVolumeSplitReason::ConstPointer
std::shared_ptr< const IOVolumeSplitReason > ConstPointer
Definition: mitkIOVolumeSplitReason.h:30
mitk::DICOMDatasetAccess
Interface to datasets that is presented to sorting classes such as DICOMDatasetSorter.
Definition: mitkDICOMDatasetAccess.h:45
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult
Return type of AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
Definition: mitkEquiDistantBlocksSorter.h:115
mitk::EquiDistantBlocksSorter::m_SliceGroupingResults
ResultsList m_SliceGroupingResults
Definition: mitkEquiDistantBlocksSorter.h:212
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_UnsortedFiles
DICOMDatasetList m_UnsortedFiles
Definition: mitkEquiDistantBlocksSorter.h:174
mitk::GantryTiltInformation
Gantry tilt analysis result.
Definition: mitkGantryTiltInformation.h:38
mitk::IOVolumeSplitReason::Pointer
std::shared_ptr< IOVolumeSplitReason > Pointer
Definition: mitkIOVolumeSplitReason.h:29
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_LastFilenameOfBlock
std::string m_LastFilenameOfBlock
Definition: mitkEquiDistantBlocksSorter.h:180
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::EquiDistantBlocksSorter
Split inputs into blocks of equidistant slices (for use in DICOMITKSeriesGDCMReader).
Definition: mitkEquiDistantBlocksSorter.h:59
mitk::DICOMTagList
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:59
mitk::EquiDistantBlocksSorter::m_ToleratedOriginOffset
double m_ToleratedOriginOffset
Definition: mitkEquiDistantBlocksSorter.h:214
mitkGantryTiltInformation.h
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
mitk::EquiDistantBlocksSorter::m_AcceptTilt
bool m_AcceptTilt
Definition: mitkEquiDistantBlocksSorter.h:209
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_FirstFilenameOfBlock
std::string m_FirstFilenameOfBlock
Definition: mitkEquiDistantBlocksSorter.h:179
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_GroupedFiles
DICOMDatasetList m_GroupedFiles
Definition: mitkEquiDistantBlocksSorter.h:173
mitkDICOMDatasetSorter.h
mitk::EquiDistantBlocksSorter::ResultsList
std::vector< std::shared_ptr< SliceGroupingAnalysisResult > > ResultsList
Definition: mitkEquiDistantBlocksSorter.h:211
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_SplitReason
IOVolumeSplitReason::Pointer m_SplitReason
Definition: mitkEquiDistantBlocksSorter.h:176
MITKDICOM_EXPORT
#define MITKDICOM_EXPORT
Definition: MitkDICOMExports.h:15
mitkVector.h
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_TiltInfo
GantryTiltInformation m_TiltInfo
Definition: mitkEquiDistantBlocksSorter.h:178
mitkDICOMSortCriterion.h
mitk::EquiDistantBlocksSorter::m_ToleratedOriginOffsetIsAbsolute
bool m_ToleratedOriginOffsetIsAbsolute
Definition: mitkEquiDistantBlocksSorter.h:215
mitk::DICOMDatasetSorter
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
Definition: mitkDICOMDatasetSorter.h:41
mitk::DICOMDatasetList
std::vector< DICOMDatasetAccess * > DICOMDatasetList
Definition: mitkDICOMDatasetAccess.h:70
mitk::EquiDistantBlocksSorter::m_AcceptTwoSlicesGroups
bool m_AcceptTwoSlicesGroups
Definition: mitkEquiDistantBlocksSorter.h:217