NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkGeneralSegmentorCommands.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkGeneralSegmentorCommands_h
16 #define niftkGeneralSegmentorCommands_h
17 
18 #include "niftkMIDASExports.h"
19 
20 #include <mitkContourModelSet.h>
21 #include <mitkDataNode.h>
22 #include <mitkOperation.h>
23 #include <mitkPointSet.h>
24 #include <mitkTool.h>
25 
29 
30 namespace niftk
31 {
32 
33 // Operation constants, used in Undo/Redo framework
34 const mitk::OperationType OP_CHANGE_SLICE = 9320411;
35 const mitk::OperationType OP_PROPAGATE_SEEDS = 9320412;
36 const mitk::OperationType OP_RETAIN_MARKS = 9320413;
37 const mitk::OperationType OP_THRESHOLD_APPLY = 9320414;
38 const mitk::OperationType OP_CLEAN = 9320415;
39 const mitk::OperationType OP_WIPE = 9320416;
40 const mitk::OperationType OP_PROPAGATE = 9320417;
41 
42 //-----------------------------------------------------------------------------
43 
48 class NIFTKMIDAS_EXPORT OpGeneralSegmentorBaseCommand: public mitk::Operation
49 {
50 public:
51 
52  OpGeneralSegmentorBaseCommand(mitk::OperationType type, bool redo);
53 
55 
56  bool IsRedo() const;
57 
58 protected:
59  bool m_Redo;
60 };
61 
62 
63 //-----------------------------------------------------------------------------
68 class NIFTKMIDAS_EXPORT OpChangeSliceCommand : public OpGeneralSegmentorBaseCommand
69 {
70 public:
72  mitk::OperationType type,
73  bool redo,
74  mitk::Point3D beforePoint,
75  mitk::Point3D afterPoint
76  );
77 
78  mitk::Point3D GetBeforePoint() const;
79 
80  mitk::Point3D GetAfterPoint() const;
81 
82 protected:
83  mitk::Point3D m_BeforePoint;
84  mitk::Point3D m_AfterPoint;
85 };
86 
87 
88 //-----------------------------------------------------------------------------
93 class NIFTKMIDAS_EXPORT OpPropagateSeeds: public OpGeneralSegmentorBaseCommand
94 {
95 public:
96 
98  mitk::OperationType type,
99  bool redo,
100  int sliceAxis,
101  int sliceIndex,
102  mitk::PointSet::Pointer seeds
103  );
104 
105  ~OpPropagateSeeds();
106 
107  int GetSliceAxis() const;
108 
109  int GetSliceIndex() const;
110 
111  mitk::PointSet::Pointer GetSeeds() const;
112 
113 private:
114  int m_SliceAxis;
115  int m_SliceIndex;
116  mitk::PointSet::Pointer m_Seeds;
117 };
118 
119 
120 //-----------------------------------------------------------------------------
125 class NIFTKMIDAS_EXPORT OpRetainMarks: public OpGeneralSegmentorBaseCommand
126 {
127 public:
130 
132  mitk::OperationType type,
133  bool redo,
134  int sliceAxis,
135  int fromSliceIndex,
136  int toSliceIndex,
137  itk::Orientation orientation,
138  const std::vector<int>& region,
139  ProcessorPointer processor
140  );
141 
142  ~OpRetainMarks();
143 
144  int GetSliceAxis() const;
145 
146  int GetFromSliceIndex() const;
147 
148  int GetToSliceIndex() const;
149 
151 
152  std::vector<int> GetRegion() const;
153 
154  ProcessorPointer GetProcessor() const;
155 
156 private:
157  int m_SliceAxis;
158  int m_FromSliceIndex;
159  int m_ToSliceIndex;
160  itk::Orientation m_Orientation;
161  std::vector<int> m_Region;
162  ProcessorPointer m_Processor;
163 };
164 
165 
166 //-----------------------------------------------------------------------------
171 class NIFTKMIDAS_EXPORT OpPropagate: public OpGeneralSegmentorBaseCommand
172 {
173 public:
174 
177 
178  OpPropagate(
179  mitk::OperationType type,
180  bool redo,
181  const std::vector<int>& region,
182  ProcessorPointer processor
183  );
184 
185  ~OpPropagate();
186 
187  std::vector<int> GetRegion() const;
188 
189  ProcessorPointer GetProcessor() const;
190 
191 private:
192  std::vector<int> m_Region;
193  ProcessorPointer m_Processor;
194 };
195 
196 
197 //-----------------------------------------------------------------------------
202 class NIFTKMIDAS_EXPORT OpThresholdApply: public OpPropagate
203 {
204 public:
205 
208 
210  mitk::OperationType type,
211  bool redo,
212  const std::vector<int>& region,
213  ProcessorPointer processor,
214  bool thresholdFlag
215  );
216 
217  ~OpThresholdApply();
218 
219  bool GetThresholdFlag() const;
220 
221 private:
222  bool m_ThresholdFlag;
223 };
224 
225 
226 //-----------------------------------------------------------------------------
231 class NIFTKMIDAS_EXPORT OpClean : public OpGeneralSegmentorBaseCommand
232 {
233 public:
234  OpClean(
235  mitk::OperationType type,
236  bool redo,
237  mitk::ContourModelSet::Pointer contourSet
238  );
239 
240  ~OpClean();
241 
242  mitk::ContourModelSet::Pointer GetContourSet() const;
243 
244 private:
245  mitk::ContourModelSet::Pointer m_ContourSet;
246 };
247 
248 
249 //-----------------------------------------------------------------------------
255 class NIFTKMIDAS_EXPORT OpWipe: public OpGeneralSegmentorBaseCommand
256 {
257 public:
260 
261  OpWipe(
262  mitk::OperationType type,
263  bool redo,
264  int sliceAxis,
265  int sliceIndex,
266  const std::vector<int>& region,
267  mitk::PointSet::Pointer seeds,
268  ProcessorPointer processor
269  );
270 
271  ~OpWipe();
272 
273  int GetSliceAxis() const;
274 
275  int GetSliceIndex() const;
276 
277  std::vector<int> GetRegion() const;
278 
279  mitk::PointSet::Pointer GetSeeds() const;
280 
281  ProcessorPointer GetProcessor() const;
282 
283 private:
284  int m_SliceAxis;
285  int m_SliceIndex;
286  std::vector<int> m_Region;
287  mitk::PointSet::Pointer m_Seeds;
288  ProcessorPointer m_Processor;
289 };
290 
291 }
292 
293 #endif
const mitk::OperationType OP_RETAIN_MARKS
Definition: niftkGeneralSegmentorCommands.h:36
Command class to store data for propagating seeds from one slice to the next.
Definition: niftkGeneralSegmentorCommands.h:93
mitk::Point3D m_AfterPoint
Definition: niftkGeneralSegmentorCommands.h:84
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1237
itk::SpatialOrientation::ValidCoordinateOrientationFlags GetOrientation(ImageType::Pointer image)
Definition: niftkBreastDensityFromMRIsGivenMaskAndImage.cxx:146
Orientation
Definition: itkMIDASHelper.h:35
itk::MIDASImageUpdateClearRegionProcessor< mitk::Tool::DefaultSegmentationDataType, 3 > ProcessorType
Definition: niftkGeneralSegmentorCommands.h:258
bool m_Redo
Definition: niftkGeneralSegmentorCommands.h:59
Class to support undo/redo of a paste operation, within a given region, where we take non-zero pixels...
Definition: itkMIDASImageUpdatePasteRegionProcessor.h:29
Class to support the MIDAS Retain marks operation, specifically when thresholding is off...
Definition: itkMIDASRetainMarksNoThresholdingProcessor.h:32
Class to support undo/redo of a clear operation (set value to zero), within a given region...
Definition: itkMIDASImageUpdateClearRegionProcessor.h:28
SmartPointer< Self > Pointer
Definition: itkMIDASRetainMarksNoThresholdingProcessor.h:39
Command class to store data to copy one slice to the next.
Definition: niftkGeneralSegmentorCommands.h:125
SmartPointer< Self > Pointer
Definition: itkMIDASImageUpdatePasteRegionProcessor.h:36
const mitk::OperationType OP_CHANGE_SLICE
Definition: niftkGeneralSegmentorCommands.h:34
itk::MIDASImageUpdatePasteRegionProcessor< mitk::Tool::DefaultSegmentationDataType, 3 > ProcessorType
Definition: niftkGeneralSegmentorCommands.h:206
const mitk::OperationType OP_WIPE
Definition: niftkGeneralSegmentorCommands.h:39
Class to hold data to do propagate up/down/3D.
Definition: niftkGeneralSegmentorCommands.h:171
itk::MIDASRetainMarksNoThresholdingProcessor< mitk::Tool::DefaultSegmentationDataType, 3 > ProcessorType
Definition: niftkGeneralSegmentorCommands.h:128
ProcessorType::Pointer ProcessorPointer
Definition: niftkGeneralSegmentorCommands.h:259
itk::MIDASImageUpdatePasteRegionProcessor< mitk::Tool::DefaultSegmentationDataType, 3 > ProcessorType
Definition: niftkGeneralSegmentorCommands.h:175
Class to hold data to apply the threshold region into the segmented image.
Definition: niftkGeneralSegmentorCommands.h:202
ProcessorType::Pointer ProcessorPointer
Definition: niftkGeneralSegmentorCommands.h:129
SmartPointer< Self > Pointer
Definition: itkMIDASImageUpdateClearRegionProcessor.h:35
mitk::Point3D m_BeforePoint
Definition: niftkGeneralSegmentorCommands.h:83
ProcessorType::Pointer ProcessorPointer
Definition: niftkGeneralSegmentorCommands.h:176
ProcessorType::Pointer ProcessorPointer
Definition: niftkGeneralSegmentorCommands.h:207
const mitk::OperationType OP_PROPAGATE_SEEDS
Definition: niftkGeneralSegmentorCommands.h:35
Class to hold data for the MIDAS "clean" command, which filters the current contour set...
Definition: niftkGeneralSegmentorCommands.h:231
Class to hold data to pass back to niftkGeneralSegmentorController to Undo/Redo the Wipe commands...
Definition: niftkGeneralSegmentorCommands.h:255
const mitk::OperationType OP_CLEAN
Definition: niftkGeneralSegmentorCommands.h:38
Command class for changing slice.
Definition: niftkGeneralSegmentorCommands.h:68
Definition: niftkExceptionObject.h:21
Base class for General Segmentor commands.
Definition: niftkGeneralSegmentorCommands.h:48
const mitk::OperationType OP_PROPAGATE
Definition: niftkGeneralSegmentorCommands.h:40
const mitk::OperationType OP_THRESHOLD_APPLY
Definition: niftkGeneralSegmentorCommands.h:37