Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSegTool2D.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 mitkSegTool2D_h_Included
18 #define mitkSegTool2D_h_Included
19 
20 #include "mitkCommon.h"
21 #include "mitkImage.h"
22 #include "mitkTool.h"
24 
26 
27 #include "mitkInteractionConst.h"
30 
31 #include <mitkDiffSliceOperation.h>
32 
33 namespace mitk
34 {
35  class BaseRenderer;
36 
59  {
60  public:
62 
71  static bool DetermineAffectedImageSlice(const Image *image,
72  const PlaneGeometry *plane,
73  int &affectedDimension,
74  int &affectedSlice);
75 
85  static void UpdateSurfaceInterpolation(const Image *slice,
86  const Image *workingImage,
87  const PlaneGeometry *plane,
88  bool detectIntersection);
89 
90  void SetShowMarkerNodes(bool);
91 
96  void SetEnable3DInterpolation(bool);
97 
98  protected:
99  SegTool2D(); // purposely hidden
100  SegTool2D(const char *); // purposely hidden
101  virtual ~SegTool2D();
102 
104  {
107  unsigned int timestep;
108 
110  SliceInformation(mitk::Image *slice, mitk::PlaneGeometry *plane, unsigned int timestep)
111  {
112  this->slice = slice;
113  this->plane = plane;
114  this->timestep = timestep;
115  }
116  };
117 
124  virtual bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode) override;
125 
134  Image::Pointer GetAffectedImageSliceAs2DImage(const InteractionPositionEvent *positionEvent, const Image *image, unsigned int component = 0);
135 
144  Image::Pointer GetAffectedImageSliceAs2DImage(const PlaneGeometry *planeGeometry,
145  const Image *image,
146  unsigned int timeStep,
147  unsigned int component = 0);
148 
155  Image::Pointer GetAffectedWorkingSlice(const InteractionPositionEvent *);
156 
163  Image::Pointer GetAffectedReferenceSlice(const InteractionPositionEvent *);
164 
165  void WriteBackSegmentationResult(const InteractionPositionEvent *, Image *);
166 
167  void WriteBackSegmentationResult(const PlaneGeometry *planeGeometry, Image *, unsigned int timeStep);
168 
169  void WriteBackSegmentationResult(std::vector<SliceInformation> sliceList, bool writeSliceToVolume = true);
170 
171  void WritePreviewOnWorkingImage(
172  Image *targetSlice, Image *sourceSlice, Image *workingImage, int paintingPixelValue, int timestep);
173 
174  void WriteSliceToVolume(SliceInformation sliceInfo);
179  int AddContourmarker();
180 
181  void InteractiveSegmentationBugMessage(const std::string &message);
182 
184  unsigned int m_LastEventSlice;
185 
186  private:
187  // The prefix of the contourmarkername. Suffix is a consecutive number
188  const std::string m_Contourmarkername;
189 
190  bool m_ShowMarkerNodes;
191  static bool m_SurfaceInterpolationEnabled;
192  };
193 
194 } // namespace
195 
196 #endif
unsigned int m_LastEventSlice
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:92
Super class for all position events.
Organizes the rendering process.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
SliceInformation(mitk::Image *slice, mitk::PlaneGeometry *plane, unsigned int timestep)
Constants for most interaction classes, due to the generic StateMachines.
BaseRenderer * m_LastEventSender
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
Abstract base class for segmentation tools.
Definition: mitkSegTool2D.h:58
Describes a two-dimensional, rectangular plane.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66