Slicer  5.3
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 ) 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  vtkMRMLNode* CreateNodeInstance () override;
68 
71  void ReadXMLAttributes ( const char** atts ) override;
72 
75  void WriteXML ( ostream& of, int indent ) override;
76 
80 
83  const char* GetNodeTagName ( ) override {return "TransformDisplayNode";}
84 
87  void ProcessMRMLEvents ( vtkObject * /*caller*/,
88  unsigned long /*event*/,
89  void * /*callData*/ ) override;
90 
91  //--------------------------------------------------------------------------
93  //--------------------------------------------------------------------------
94 
97  vtkMRMLNode* GetRegionNode();
98  void SetAndObserveRegionNode(vtkMRMLNode* node);
99 
102  vtkMRMLNode* GetGlyphPointsNode();
103  void SetAndObserveGlyphPointsNode(vtkMRMLNode* node);
104 
105  vtkSetMacro(VisualizationMode, int);
106  vtkGetMacro(VisualizationMode, int);
109  static const char* ConvertVisualizationModeToString(int modeIndex);
112  static int ConvertVisualizationModeFromString(const char* modeString);
113 
114  // Glyph Parameters
115  vtkSetMacro(GlyphSpacingMm, double);
116  vtkGetMacro(GlyphSpacingMm, double);
117  vtkSetMacro(GlyphScalePercent, double);
118  vtkGetMacro(GlyphScalePercent, double);
119  vtkSetMacro(GlyphDisplayRangeMaxMm, double);
120  vtkGetMacro(GlyphDisplayRangeMaxMm, double);
121  vtkSetMacro(GlyphDisplayRangeMinMm, double);
122  vtkGetMacro(GlyphDisplayRangeMinMm, double);
123  vtkSetMacro(GlyphType, int);
124  vtkGetMacro(GlyphType, int);
127  static const char* ConvertGlyphTypeToString(int typeIndex);
130  static int ConvertGlyphTypeFromString(const char* typeString);
131  // 3d parameters
132  vtkSetMacro(GlyphTipLengthPercent, double);
133  vtkGetMacro(GlyphTipLengthPercent, double);
134  vtkSetMacro(GlyphDiameterMm, double);
135  vtkGetMacro(GlyphDiameterMm, double);
136  vtkSetMacro(GlyphShaftDiameterPercent, double);
137  vtkGetMacro(GlyphShaftDiameterPercent, double);
138  vtkSetMacro(GlyphResolution, int);
139  vtkGetMacro(GlyphResolution, int);
140 
141  // Grid Parameters
142  vtkSetMacro(GridScalePercent, double);
143  vtkGetMacro(GridScalePercent, double);
144  vtkSetMacro(GridSpacingMm, double);
145  vtkGetMacro(GridSpacingMm, double);
146  vtkSetMacro(GridLineDiameterMm, double);
147  vtkGetMacro(GridLineDiameterMm, double);
148  vtkSetMacro(GridResolutionMm, double);
149  vtkGetMacro(GridResolutionMm, double);
150  vtkSetMacro(GridShowNonWarped, bool);
151  vtkGetMacro(GridShowNonWarped, bool);
152 
153  // Contour Parameters
154  unsigned int GetNumberOfContourLevels();
155  void SetContourLevelsMm(double*, int size);
156  double* GetContourLevelsMm();
157  void GetContourLevelsMm(std::vector<double> &levels);
158  std::string GetContourLevelsMmAsString();
159  void SetContourLevelsMmFromString(const char* str);
160  static std::vector<double> ConvertContourLevelsFromString(const char* str);
161  static std::string ConvertContourLevelsToString(const std::vector<double>& levels);
162  static bool IsContourLevelEqual(const std::vector<double>& levels1, const std::vector<double>& levels2);
163 
164  vtkSetMacro(ContourResolutionMm, double);
165  vtkGetMacro(ContourResolutionMm, double);
166  vtkSetMacro(ContourOpacity, double);
167  vtkGetMacro(ContourOpacity, double);
168 
169  // Interaction Parameters
170  vtkGetMacro(EditorVisibility, bool);
171  vtkSetMacro(EditorVisibility, bool);
172  vtkBooleanMacro(EditorVisibility, bool);
173  vtkGetMacro(EditorSliceIntersectionVisibility, bool);
174  vtkSetMacro(EditorSliceIntersectionVisibility, bool);
175  vtkBooleanMacro(EditorSliceIntersectionVisibility, bool);
176  vtkGetMacro(EditorTranslationEnabled, bool);
177  vtkSetMacro(EditorTranslationEnabled, bool);
178  vtkBooleanMacro(EditorTranslationEnabled, bool);
179  vtkGetMacro(EditorRotationEnabled, bool);
180  vtkSetMacro(EditorRotationEnabled, bool);
181  vtkBooleanMacro(EditorRotationEnabled, bool);
182  vtkGetMacro(EditorScalingEnabled, bool);
183  vtkSetMacro(EditorScalingEnabled, bool);
184  vtkBooleanMacro(EditorScalingEnabled, bool);
185 
188  void UpdateEditorBounds();
189  enum
190  {
191  TransformUpdateEditorBoundsEvent = 2750
192  };
193 
196  void SetDefaultColors();
197 
198  vtkColorTransferFunction* GetColorMap();
199  void SetColorMap(vtkColorTransferFunction* newColorMap);
200 
201 protected:
202 
203  static std::vector<double> StringToDoubleVector(const char* sourceStr);
204  static std::string DoubleVectorToString(const double* values, int numberOfValues);
205 
207 
208  // Glyph Parameters
214  // 3d parameters
219 
220  // Grid Parameters
230 
231  // Contour Parameters
235  std::vector<double> ContourLevelsMm;
236 
237  // Interaction Parameters
243 
244  protected:
246  ~vtkMRMLTransformDisplayNode ( ) override;
249 
250 };
251 
252 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, UnstructuredGrid)
MRML node for representing a transformation between this node space and a parent node space...
void ReadXMLAttributes(const char **atts) override
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
vtkMRMLCopyContentMacro(vtkMRMLDisplayNode)
void WriteXML(ostream &of, int indent) override
void operator=(const vtkMRMLDisplayNode &)
MRML node for representing a volume (image stack).
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
MRML node to represent procedurally defined color information.
double ContourOpacity
Opacity of the 3D contour. Between 0 and 1.
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
MRML node to represent display properties for transforms visualization in the slice and 3D viewers...