Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLTransformDisplayNode.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  This file was originally developed by Andras Lasso and Franklin King at
17  PerkLab, Queen's University and was supported through the Applied Cancer
18  Research Unit program of Cancer Care Ontario with funds provided by the
19  Ontario Ministry of Health and Long-Term Care.
20 
21 ==============================================================================*/
22 
23 
24 #ifndef __vtkMRMLTransformDisplayNode_h
25 #define __vtkMRMLTransformDisplayNode_h
26 
27 #include "vtkMRMLDisplayNode.h"
28 
29 class vtkColorTransferFunction;
30 class vtkPointSet;
31 class vtkMatrix4x4;
34 class vtkMRMLVolumeNode;
35 
36 
40 class VTK_MRML_EXPORT vtkMRMLTransformDisplayNode : public vtkMRMLDisplayNode
41 {
42  public:
43  static vtkMRMLTransformDisplayNode *New ( );
45  void PrintSelf ( ostream& os, vtkIndent indent ) VTK_OVERRIDE;
46 
48  {
52  VIS_MODE_LAST // this should be the last mode
53  };
54 
56  {
60  GLYPH_TYPE_LAST // this should be the last glyph type
61  };
62 
63  //--------------------------------------------------------------------------
65  //--------------------------------------------------------------------------
66 
67  virtual vtkMRMLNode* CreateNodeInstance () VTK_OVERRIDE;
68 
71  virtual void ReadXMLAttributes ( const char** atts ) VTK_OVERRIDE;
72 
75  virtual void WriteXML ( ostream& of, int indent ) VTK_OVERRIDE;
76 
77 
80  virtual void Copy ( vtkMRMLNode *node ) VTK_OVERRIDE;
81 
84  virtual const char* GetNodeTagName ( ) VTK_OVERRIDE {return "TransformDisplayNode";}
85 
88  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
89  unsigned long /*event*/,
90  void * /*callData*/ ) VTK_OVERRIDE;
91 
92  //--------------------------------------------------------------------------
94  //--------------------------------------------------------------------------
95 
98  vtkMRMLNode* GetRegionNode();
99  void SetAndObserveRegionNode(vtkMRMLNode* node);
100 
103  vtkMRMLNode* GetGlyphPointsNode();
104  void SetAndObserveGlyphPointsNode(vtkMRMLNode* node);
105 
106  vtkSetMacro(VisualizationMode, int);
107  vtkGetMacro(VisualizationMode, int);
110  static const char* ConvertVisualizationModeToString(int modeIndex);
113  static int ConvertVisualizationModeFromString(const char* modeString);
114 
115  // Glyph Parameters
116  vtkSetMacro(GlyphSpacingMm, double);
117  vtkGetMacro(GlyphSpacingMm, double);
118  vtkSetMacro(GlyphScalePercent, double);
119  vtkGetMacro(GlyphScalePercent, double);
120  vtkSetMacro(GlyphDisplayRangeMaxMm, double);
121  vtkGetMacro(GlyphDisplayRangeMaxMm, double);
122  vtkSetMacro(GlyphDisplayRangeMinMm, double);
123  vtkGetMacro(GlyphDisplayRangeMinMm, double);
124  vtkSetMacro(GlyphType, int);
125  vtkGetMacro(GlyphType, int);
128  static const char* ConvertGlyphTypeToString(int typeIndex);
131  static int ConvertGlyphTypeFromString(const char* typeString);
132  // 3d parameters
133  vtkSetMacro(GlyphTipLengthPercent, double);
134  vtkGetMacro(GlyphTipLengthPercent, double);
135  vtkSetMacro(GlyphDiameterMm, double);
136  vtkGetMacro(GlyphDiameterMm, double);
137  vtkSetMacro(GlyphShaftDiameterPercent, double);
138  vtkGetMacro(GlyphShaftDiameterPercent, double);
139  vtkSetMacro(GlyphResolution, int);
140  vtkGetMacro(GlyphResolution, int);
141 
142  // Grid Parameters
143  vtkSetMacro(GridScalePercent, double);
144  vtkGetMacro(GridScalePercent, double);
145  vtkSetMacro(GridSpacingMm, double);
146  vtkGetMacro(GridSpacingMm, double);
147  vtkSetMacro(GridLineDiameterMm, double);
148  vtkGetMacro(GridLineDiameterMm, double);
149  vtkSetMacro(GridResolutionMm, double);
150  vtkGetMacro(GridResolutionMm, double);
151  vtkSetMacro(GridShowNonWarped, bool);
152  vtkGetMacro(GridShowNonWarped, bool);
153 
154  // Contour Parameters
155  unsigned int GetNumberOfContourLevels();
156  void SetContourLevelsMm(double*, int size);
157  double* GetContourLevelsMm();
158  void GetContourLevelsMm(std::vector<double> &levels);
159  std::string GetContourLevelsMmAsString();
160  void SetContourLevelsMmFromString(const char* str);
161  static std::vector<double> ConvertContourLevelsFromString(const char* str);
162  static std::string ConvertContourLevelsToString(const std::vector<double>& levels);
163  static bool IsContourLevelEqual(const std::vector<double>& levels1, const std::vector<double>& levels2);
164 
165  vtkSetMacro(ContourResolutionMm, double);
166  vtkGetMacro(ContourResolutionMm, double);
167  vtkSetMacro(ContourOpacity, double);
168  vtkGetMacro(ContourOpacity, double);
169 
170  // Interaction Parameters
171  vtkGetMacro(EditorVisibility, bool);
172  vtkSetMacro(EditorVisibility, bool);
173  vtkBooleanMacro(EditorVisibility, bool);
174  vtkGetMacro(EditorSliceIntersectionVisibility, bool);
175  vtkSetMacro(EditorSliceIntersectionVisibility, bool);
176  vtkBooleanMacro(EditorSliceIntersectionVisibility, bool);
177  vtkGetMacro(EditorTranslationEnabled, bool);
178  vtkSetMacro(EditorTranslationEnabled, bool);
179  vtkBooleanMacro(EditorTranslationEnabled, bool);
180  vtkGetMacro(EditorRotationEnabled, bool);
181  vtkSetMacro(EditorRotationEnabled, bool);
182  vtkBooleanMacro(EditorRotationEnabled, bool);
183  vtkGetMacro(EditorScalingEnabled, bool);
184  vtkSetMacro(EditorScalingEnabled, bool);
185  vtkBooleanMacro(EditorScalingEnabled, bool);
186 
189  void UpdateEditorBounds();
190  enum
191  {
192  TransformUpdateEditorBoundsEvent = 2750
193  };
194 
197  void SetDefaultColors();
198 
199  vtkColorTransferFunction* GetColorMap();
200  void SetColorMap(vtkColorTransferFunction* newColorMap);
201 
202 protected:
203 
204  static std::vector<double> StringToDoubleVector(const char* sourceStr);
205  static std::string DoubleVectorToString(const double* values, int numberOfValues);
206 
208 
209  // Glyph Parameters
215  // 3d parameters
220 
221  // Grid Parameters
231 
232  // Contour Parameters
236  std::vector<double> ContourLevelsMm;
237 
238  // Interaction Parameters
244 
245  protected:
250 
251 };
252 
253 #endif
MRML node for representing a transformation between this node space and a parent node space...
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
void operator=(const vtkMRMLDisplayNode &)
MRML node for representing a volume (image stack).
MRML node to represent procedurally defined color information.
double ContourOpacity
Opacity of the 3D contour. Between 0 and 1.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
MRML node to represent display properties for transforms visualization in the slice and 3D viewers...