Medical Imaging Interaction Toolkit  2024.06.00
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 
54 {
55  public:
56 
58 
59  itkNewMacro( EquiDistantBlocksSorter );
60 
61  DICOMTagList GetTagsOfInterest() override;
62 
68  void Sort() override;
69 
73  void SetAcceptTilt(bool accept);
74  bool GetAcceptTilt() const;
75 
79  void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3);
86  void SetToleratedOriginOffset(double millimeters = 0.005);
87 
88  double GetToleratedOriginOffset() const;
89  bool IsToleratedOriginOffsetAbsolute() const;
90 
91  void SetAcceptTwoSlicesGroups(bool accept);
92  bool GetAcceptTwoSlicesGroups() const;
93 
94  void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
95 
96  bool operator==(const DICOMDatasetSorter& other) const override;
97 
98  protected:
99 
110  {
111  public:
112 
114 
118  DICOMDatasetList GetBlockDatasets();
119 
120  void SetFirstFilenameOfBlock(const std::string& filename);
121  std::string GetFirstFilenameOfBlock() const;
122  void SetLastFilenameOfBlock(const std::string& filename);
123  std::string GetLastFilenameOfBlock() const;
124 
128  DICOMDatasetList GetUnsortedDatasets();
129 
133  bool ContainsGantryTilt();
134 
138  const GantryTiltInformation& GetTiltInfo() const;
139 
143  void AddFileToSortedBlock(DICOMDatasetAccess* dataset);
144 
148  void AddFileToUnsortedBlock(DICOMDatasetAccess* dataset);
149  void AddFilesToUnsortedBlock(const DICOMDatasetList& datasets);
150 
155  void FlagGantryTilt(const GantryTiltInformation& tiltInfo);
156 
160  void UndoPrematureGrouping();
161 
162  protected:
163 
166 
170  };
171 
184  AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList& files, bool groupsOfSimilarImages);
185 
189  std::string
190  ConstCharStarToString(const char* s);
191 
193  ~EquiDistantBlocksSorter() override;
194 
196  EquiDistantBlocksSorter& operator=(const EquiDistantBlocksSorter& other);
197 
199 
200  typedef std::vector<SliceGroupingAnalysisResult> ResultsList;
202 
205 
207 };
208 
209 }
210 
211 #endif
mitk::EquiDistantBlocksSorter::ResultsList
std::vector< SliceGroupingAnalysisResult > ResultsList
Definition: mitkEquiDistantBlocksSorter.h:200
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:109
mitk::EquiDistantBlocksSorter::m_SliceGroupingResults
ResultsList m_SliceGroupingResults
Definition: mitkEquiDistantBlocksSorter.h:201
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_UnsortedFiles
DICOMDatasetList m_UnsortedFiles
Definition: mitkEquiDistantBlocksSorter.h:165
mitk::GantryTiltInformation
Gantry tilt analysis result.
Definition: mitkGantryTiltInformation.h:38
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_LastFilenameOfBlock
std::string m_LastFilenameOfBlock
Definition: mitkEquiDistantBlocksSorter.h:169
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:53
mitk::DICOMTagList
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:59
mitk::EquiDistantBlocksSorter::m_ToleratedOriginOffset
double m_ToleratedOriginOffset
Definition: mitkEquiDistantBlocksSorter.h:203
mitkGantryTiltInformation.h
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
mitk::EquiDistantBlocksSorter::m_AcceptTilt
bool m_AcceptTilt
Definition: mitkEquiDistantBlocksSorter.h:198
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_FirstFilenameOfBlock
std::string m_FirstFilenameOfBlock
Definition: mitkEquiDistantBlocksSorter.h:168
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_GroupedFiles
DICOMDatasetList m_GroupedFiles
Definition: mitkEquiDistantBlocksSorter.h:164
mitkDICOMDatasetSorter.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MITKDICOM_EXPORT
#define MITKDICOM_EXPORT
Definition: MitkDICOMExports.h:15
mitkVector.h
mitk::EquiDistantBlocksSorter::SliceGroupingAnalysisResult::m_TiltInfo
GantryTiltInformation m_TiltInfo
Definition: mitkEquiDistantBlocksSorter.h:167
mitkDICOMSortCriterion.h
mitk::EquiDistantBlocksSorter::m_ToleratedOriginOffsetIsAbsolute
bool m_ToleratedOriginOffsetIsAbsolute
Definition: mitkEquiDistantBlocksSorter.h:204
mitk::DICOMDatasetSorter
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
Definition: mitkDICOMDatasetSorter.h:40
mitk::DICOMDatasetList
std::vector< DICOMDatasetAccess * > DICOMDatasetList
Definition: mitkDICOMDatasetAccess.h:70
mitk::EquiDistantBlocksSorter::m_AcceptTwoSlicesGroups
bool m_AcceptTwoSlicesGroups
Definition: mitkEquiDistantBlocksSorter.h:206