Medical Imaging Interaction Toolkit  2018.4.99-b585543d
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
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
Split inputs into blocks of equidistant slices (for use in DICOMITKSeriesGDCMReader).
std::vector< DICOMTag > DICOMTagList
Definition: mitkDICOMTag.h:59
std::vector< SliceGroupingAnalysisResult > ResultsList
#define MITKDICOMREADER_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
Interface to datasets that is presented to sorting classes such as DICOMDatasetSorter.
Return type of AnalyzeFileForITKImageSeriesReaderSpacingAssumption().
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Gantry tilt analysis result.
std::vector< DICOMDatasetAccess * > DICOMDatasetList