NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkTool.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 niftkTool_h
16 #define niftkTool_h
17 
18 #include "niftkMIDASExports.h"
19 
20 #include <map>
21 
22 #include <mitkDataNode.h>
23 #include <mitkFeedbackContourTool.h>
24 #include <mitkMessage.h>
25 #include <mitkPositionEvent.h>
26 #include <mitkPointSet.h>
27 
28 #include <usServiceReference.h>
29 
30 //#include "niftkPointSetDataInteractor.h"
33 
34 namespace niftk
35 {
36 
61 class NIFTKMIDAS_EXPORT Tool : public mitk::FeedbackContourTool, public FilteringStateMachine
62 {
63 
64 public:
65 
66  mitkClassMacro(Tool, mitk::FeedbackContourTool)
67 
68 
69  static void LoadBehaviourStrings();
71 
72  static bool LoadBehaviour(const std::string& fileName, us::Module* module);
73 
74  const char* GetGroup() const override;
75 
78  enum
79  {
88  INITIAL_SEEDS
89  };
90 
92  static const std::string SEEDS_NAME;
93 
95  static const std::string CONTOURS_NAME;
96 
99 
102 
105 
108 
111 
114 
116  virtual void Activated();
117 
119  virtual void Deactivated();
120 
122  mitk::Message1<int> NumberOfSeedsHasChanged;
123 
125  bool GetBlockNumberOfSeedsSignal() const;
126 
128  void SetBlockNumberOfSeedsSignal(bool blockNumberOfSeedsSignal);
129 
133  virtual void InstallEventFilter(StateMachineEventFilter* eventFilter);
134 
138  virtual void RemoveEventFilter(StateMachineEventFilter* eventFilter);
139 
140 protected:
141 
142  Tool(); // purposefully hidden
143  virtual ~Tool(); // purposely hidden
144 
153  bool FilterEvents(mitk::InteractionEvent* event, mitk::DataNode* dataNode);
154 
156  virtual void RenderCurrentWindow(const mitk::PositionEvent& event);
157 
159  virtual void RenderAllWindows();
160 
162  virtual void UpdateWorkingDataNodeBoolProperty(int dataIndex, const std::string& name, bool value);
163 
165  mitk::DataNode::Pointer GetPointSetNode() const;
166 
168  mitk::PointSet::Pointer GetPointSet() const;
169 
170 private:
171 
173  void OnSeedsModified();
174 
176  PointSetInteractor::Pointer m_AddToPointSetInteractor;
177 // PointSetDataInteractor::Pointer m_AddToPointSetInteractor;
178 
180  mitk::DataNode::Pointer m_PointSetNode;
181 
183  mitk::PointSet::Pointer m_PointSet;
184 
186  int m_LastSeenNumberOfSeeds;
187 
189  unsigned long m_SeedsChangedTag;
190 
192  bool m_IsActivated;
193 
195  bool m_BlockNumberOfSeedsSignal;
196 
199  std::map<us::ServiceReferenceU, mitk::EventConfig> m_DisplayInteractorConfigs;
200 
201  static bool s_BehaviourStringsLoaded;
202 
203 };
204 
205 }
206 
207 #endif
Definition: niftkTool.h:85
static const std::string PRIOR_CONTOURS_NAME
Stores the name of the prior contours, so all classes have access to the name.
Definition: niftkTool.h:101
Definition: niftkTool.h:84
Definition: niftkTool.h:86
mitk::Message1< int > NumberOfSeedsHasChanged
Used to signal that the number of seeds has changed.
Definition: niftkTool.h:122
Definition: niftkTool.h:87
Definition: niftkTool.h:81
static const std::string NEXT_CONTOURS_NAME
Stores the name of the next contours, so all classes have access to the name.
Definition: niftkTool.h:104
Base class for segmentor tools that need access to the list of seeds for the current reference data v...
Definition: niftkTool.h:61
Definition: niftkTool.h:83
static const std::string DRAW_CONTOURS_NAME
Stores the name of the draw tool contours, so all classes have access to the name.
Definition: niftkTool.h:98
static const std::string REGION_GROWING_NAME
Stores the name of the region growing image, so all classes have access to the name.
Definition: niftkTool.h:107
GLsizei const GLfloat * value
Definition: glew.h:1833
Definition: niftkTool.h:82
Definition: niftkTool.h:80
StateMachineEventFilter represents a condition that has to be fulfilled so that an event is processed...
Definition: niftkStateMachineEventFilter.h:41
static const std::string CONTOURS_NAME
Stores the name of the current slice contours, so all classes have access to the name.
Definition: niftkTool.h:95
static const std::string INITIAL_SEGMENTATION_NAME
Stores the name of the initial segmentation image, so all classes have access to the name...
Definition: niftkTool.h:110
GLuint const GLchar * name
Definition: glew.h:1798
cl_event event
Definition: glew.h:3231
static const std::string SEEDS_NAME
Stores a seed point set name, so all classes have access to the name.
Definition: niftkTool.h:92
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194
Common base class for segmentor tools and interactors.
Definition: niftkFilteringStateMachine.h:49
static const std::string INITIAL_SEEDS_NAME
Stores the name of the initial set of seeds, so all classes have access to the name.
Definition: niftkTool.h:113