Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkEquiDistantBlocksSorter_h
18 #define mitkEquiDistantBlocksSorter_h
19 
20 #include "mitkDICOMDatasetSorter.h"
21 #include "mitkDICOMSortCriterion.h"
23 
24 #include "mitkVector.h"
25 
26 namespace mitk
27 {
28 
58 {
59  public:
60 
62  itkNewMacro( EquiDistantBlocksSorter )
63 
64  virtual DICOMTagList GetTagsOfInterest() override;
65 
71  virtual void Sort() override;
72 
76  void SetAcceptTilt(bool accept);
77  bool GetAcceptTilt() const;
78 
82  void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3);
89  void SetToleratedOriginOffset(double millimeters = 0.005);
90 
91  double GetToleratedOriginOffset() const;
92  bool IsToleratedOriginOffsetAbsolute() const;
93 
94  void SetAcceptTwoSlicesGroups(bool accept);
95  bool GetAcceptTwoSlicesGroups() const;
96 
97  virtual void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override;
98 
99  virtual bool operator==(const DICOMDatasetSorter& other) const override;
100 
101  protected:
102 
113  {
114  public:
115 
117 
121  DICOMDatasetList GetBlockDatasets();
122 
123  void SetFirstFilenameOfBlock(const std::string& filename);
124  std::string GetFirstFilenameOfBlock() const;
125  void SetLastFilenameOfBlock(const std::string& filename);
126  std::string GetLastFilenameOfBlock() const;
127 
131  DICOMDatasetList GetUnsortedDatasets();
132 
136  bool ContainsGantryTilt();
137 
141  const GantryTiltInformation& GetTiltInfo() const;
142 
146  void AddFileToSortedBlock(DICOMDatasetAccess* dataset);
147 
151  void AddFileToUnsortedBlock(DICOMDatasetAccess* dataset);
152  void AddFilesToUnsortedBlock(const DICOMDatasetList& datasets);
153 
158  void FlagGantryTilt(const GantryTiltInformation& tiltInfo);
159 
163  void UndoPrematureGrouping();
164 
165  protected:
166 
169 
173  };
174 
187  AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList& files, bool groupsOfSimilarImages);
188 
192  std::string
193  ConstCharStarToString(const char* s);
194 
196  virtual ~EquiDistantBlocksSorter();
197 
199  EquiDistantBlocksSorter& operator=(const EquiDistantBlocksSorter& other);
200 
202 
203  typedef std::vector<SliceGroupingAnalysisResult> ResultsList;
205 
208 
210 };
211 
212 }
213 
214 #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:64
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().
static const std::string filename
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Gantry tilt analysis result.
std::vector< DICOMDatasetAccess * > DICOMDatasetList