Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerMarkupsLogic.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 // .NAME vtkSlicerMarkupsLogic - slicer logic class for volumes manipulation
19 // .SECTION Description
20 // This class manages the logic associated with reading, saving,
21 // and changing propertied of the volumes
22 
23 
24 #ifndef __vtkSlicerMarkupsLogic_h
25 #define __vtkSlicerMarkupsLogic_h
26 
27 // Slicer includes
28 #include "vtkSlicerModuleLogic.h"
29 
30 // MRML includes
31 
32 // STD includes
33 #include <cstdlib>
34 
35 #include "vtkSlicerMarkupsModuleLogicExport.h"
36 
37 class vtkMRMLMarkupsNode;
39 
41 class VTK_SLICER_MARKUPS_MODULE_LOGIC_EXPORT vtkSlicerMarkupsLogic :
43 {
44 public:
45 
46  static vtkSlicerMarkupsLogic *New();
48  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49 
50  virtual void ProcessMRMLNodesEvents(vtkObject *caller,
51  unsigned long event,
52  void *callData ) VTK_OVERRIDE;
53 
58  std::string GetSelectionNodeID();
59 
63  std::string GetActiveListID();
64 
70  void SetActiveListID(vtkMRMLMarkupsNode *markupsNode);
71 
76  std::string AddNewDisplayNodeForMarkupsNode(vtkMRMLNode *mrmlNode);
77 
83  std::string AddNewFiducialNode(const char *name = "F", vtkMRMLScene *scene = NULL);
84 
89  int AddFiducial(double r=0.0, double a=0.0, double s=0.0);
90 
94  void JumpSlicesToLocation(double x, double y, double z, bool centered, int viewGroup = -1);
97  void JumpSlicesToNthPointInMarkup(const char *id, int n, bool centered = false, int viewGroup = -1);
100  void FocusCamerasOnNthPointInMarkup(const char *id, int n);
104  void FocusCameraOnNthPointInMarkup(const char *cameraNodeID, const char *markupNodeID, int n);
105 
109  char *LoadMarkupsFiducials(const char *fileName, const char *fidsName);
110 
112  void SetAllMarkupsVisibility(vtkMRMLMarkupsNode *node, bool flag);
113  void ToggleAllMarkupsVisibility(vtkMRMLMarkupsNode *node);
114  void SetAllMarkupsLocked(vtkMRMLMarkupsNode *node, bool flag);
115  void ToggleAllMarkupsLocked(vtkMRMLMarkupsNode *node);
116  void SetAllMarkupsSelected(vtkMRMLMarkupsNode *node, bool flag);
117  void ToggleAllMarkupsSelected(vtkMRMLMarkupsNode *node);
118 
120  int GetDefaultMarkupsDisplayNodeGlyphType();
121  void SetDefaultMarkupsDisplayNodeGlyphType(int glyphType);
122  void SetDefaultMarkupsDisplayNodeGlyphTypeFromString(const char *glyphType);
123  std::string GetDefaultMarkupsDisplayNodeGlyphTypeAsString();
124 
125  double GetDefaultMarkupsDisplayNodeGlyphScale();
126  void SetDefaultMarkupsDisplayNodeGlyphScale(double scale);
127 
128  double GetDefaultMarkupsDisplayNodeTextScale();
129  void SetDefaultMarkupsDisplayNodeTextScale(double scale);
130 
131  double GetDefaultMarkupsDisplayNodeOpacity();
132  void SetDefaultMarkupsDisplayNodeOpacity(double opacity);
133 
134  double *GetDefaultMarkupsDisplayNodeColor();
135  void SetDefaultMarkupsDisplayNodeColor(double *color);
136  void SetDefaultMarkupsDisplayNodeColor(double r, double g, double b);
137 
138  double *GetDefaultMarkupsDisplayNodeSelectedColor();
139  void SetDefaultMarkupsDisplayNodeSelectedColor(double *color);
140  void SetDefaultMarkupsDisplayNodeSelectedColor(double r, double g, double b);
141 
142  int GetDefaultMarkupsDisplayNodeSliceProjection();
143  void SetDefaultMarkupsDisplayNodeSliceProjection(int projection);
144 
145  double *GetDefaultMarkupsDisplayNodeSliceProjectionColor();
146  void SetDefaultMarkupsDisplayNodeSliceProjectionColor(double *color);
147  void SetDefaultMarkupsDisplayNodeSliceProjectionColor(double r, double g, double b);
148 
149  double GetDefaultMarkupsDisplayNodeSliceProjectionOpacity();
150  void SetDefaultMarkupsDisplayNodeSliceProjectionOpacity(double opacity);
151 
153  void SetDisplayNodeToDefaults(vtkMRMLMarkupsDisplayNode *displayNode);
154 
159  bool CopyNthMarkupToNewList(int n, vtkMRMLMarkupsNode *markupsNode,
160  vtkMRMLMarkupsNode *newMarkupsNode);
161 
169  bool MoveNthMarkupToNewListAtIndex(int n, vtkMRMLMarkupsNode *markupsNode,
170  vtkMRMLMarkupsNode *newMarkupsNode, int newIndex);
171 
177  void ConvertAnnotationFiducialsToMarkups();
178 
183  void RenameAllMarkupsFromCurrentFormat(vtkMRMLMarkupsNode *markupsNode);
184 
189  bool StartPlaceMode(bool persistent);
190 
194  int GetSliceIntersectionsVisibility();
197  void SetSliceIntersectionsVisibility(bool flag);
198 
199 protected:
201  virtual ~vtkSlicerMarkupsLogic();
202 
204  virtual void SetMRMLSceneInternal(vtkMRMLScene * newScene) VTK_OVERRIDE;
205  virtual void ObserveMRMLScene() VTK_OVERRIDE;
206 
208  virtual void RegisterNodes() VTK_OVERRIDE;
209  virtual void UpdateFromMRMLScene() VTK_OVERRIDE;
210  virtual void OnMRMLSceneNodeAdded(vtkMRMLNode* node) VTK_OVERRIDE;
211  virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) VTK_OVERRIDE;
212 
213 private:
214 
215  vtkSlicerMarkupsLogic(const vtkSlicerMarkupsLogic&); // Not implemented
216  void operator=(const vtkSlicerMarkupsLogic&); // Not implemented
217 
220  vtkMRMLMarkupsDisplayNode *DefaultMarkupsDisplayNode;
221 };
222 
223 #endif
static vtkSlicerModuleLogic * New()
The Usual vtk class functions.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData)
MRML node to represent a list of markups Markups nodes contains a list of markups that each contain a...
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
virtual void ObserveMRMLScene()
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135