Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
29class vtkColorTransferFunction;
30class vtkPointSet;
31class vtkMatrix4x4;
35
36
40class VTK_MRML_EXPORT vtkMRMLTransformDisplayNode : public vtkMRMLDisplayNode
41{
42 public:
45 void PrintSelf ( ostream& os, vtkIndent indent ) override;
46
54
56 {
60 GLYPH_TYPE_LAST // this should be the last glyph type
61 };
62
63 //--------------------------------------------------------------------------
65 //--------------------------------------------------------------------------
66
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
99
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
155 void SetContourLevelsMm(double*, int size);
157 void GetContourLevelsMm(std::vector<double> &levels);
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(EditorVisibility3D, bool);
174 vtkSetMacro(EditorVisibility3D, bool);
175 vtkBooleanMacro(EditorVisibility3D, bool);
178 vtkBooleanMacro(EditorSliceIntersectionVisibility, bool);
179 vtkGetMacro(EditorTranslationEnabled, bool);
180 vtkSetMacro(EditorTranslationEnabled, bool);
181 vtkBooleanMacro(EditorTranslationEnabled, bool);
184 vtkBooleanMacro(EditorTranslationSliceEnabled, bool);
185 vtkGetMacro(EditorRotationEnabled, bool);
186 vtkSetMacro(EditorRotationEnabled, bool);
187 vtkBooleanMacro(EditorRotationEnabled, bool);
188 vtkGetMacro(EditorRotationSliceEnabled, bool);
189 vtkSetMacro(EditorRotationSliceEnabled, bool);
190 vtkBooleanMacro(EditorRotationSliceEnabled, bool);
191 vtkGetMacro(EditorScalingEnabled, bool);
192 vtkSetMacro(EditorScalingEnabled, bool);
193 vtkBooleanMacro(EditorScalingEnabled, bool);
194 vtkGetMacro(EditorScalingSliceEnabled, bool);
195 vtkSetMacro(EditorScalingSliceEnabled, bool);
196 vtkBooleanMacro(EditorScalingSliceEnabled, bool);
197
201 enum
202 {
204 };
205
209
210 vtkColorTransferFunction* GetColorMap();
211 void SetColorMap(vtkColorTransferFunction* newColorMap);
212
214 vtkSetMacro(InteractionSizeMm, double);
215 vtkGetMacro(InteractionSizeMm, double);
216
218 vtkSetMacro(InteractionScalePercent, double);
219 vtkGetMacro(InteractionScalePercent, double);
220
222 vtkSetMacro(InteractionSizeAbsolute, bool);
223 vtkGetMacro(InteractionSizeAbsolute, bool);
224 vtkBooleanMacro(InteractionSizeAbsolute, bool);
225
227 vtkSetMacro(ActiveInteractionType, int);
228 vtkGetMacro(ActiveInteractionType, int);
229
231 vtkSetMacro(ActiveInteractionIndex, int);
232 vtkGetMacro(ActiveInteractionIndex, int);
233
235
239 vtkSetVector4Macro(RotationHandleComponentVisibility3D, bool);
240 vtkGetVector4Macro(RotationHandleComponentVisibility3D, bool);
241 vtkSetVector4Macro(ScaleHandleComponentVisibility3D, bool);
242 vtkGetVector4Macro(ScaleHandleComponentVisibility3D, bool);
243 vtkSetVector4Macro(TranslationHandleComponentVisibility3D, bool);
244 vtkGetVector4Macro(TranslationHandleComponentVisibility3D, bool);
245 vtkSetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
246 vtkGetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
247 vtkSetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
248 vtkGetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
252
253protected:
254
255 static std::vector<double> StringToDoubleVector(const char* sourceStr);
256 static std::string DoubleVectorToString(const double* values, int numberOfValues);
257
259
260 // Glyph Parameters
266 // 3d parameters
271
272 // Grid Parameters
282
283 // Contour Parameters
287 std::vector<double> ContourLevelsMm;
288
289 // Interaction Parameters
299
303 double InteractionSizeMm{5.0};
305
309
313
314 protected:
319
320};
321
322#endif
void operator=(const vtkMRMLDisplayNode &)
MRML node to represent procedurally defined color information.
void GetContourLevelsMm(std::vector< double > &levels)
void SetContourLevelsMm(double *, int size)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML (MRML) file.
static std::string DoubleVectorToString(const double *values, int numberOfValues)
void SetAndObserveGlyphPointsNode(vtkMRMLNode *node)
static bool IsContourLevelEqual(const std::vector< double > &levels1, const std::vector< double > &levels2)
double ContourOpacity
Opacity of the 3D contour. Between 0 and 1.
static const char * ConvertVisualizationModeToString(int modeIndex)
unsigned int GetNumberOfContourLevels()
vtkColorTransferFunction * GetColorMap()
void SetAndObserveRegionNode(vtkMRMLNode *node)
static int ConvertGlyphTypeFromString(const char *typeString)
static std::vector< double > ConvertContourLevelsFromString(const char *str)
vtkMRMLTransformDisplayNode(const vtkMRMLTransformDisplayNode &)
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
const char * GetNodeTagName() override
Get node XML tag name (like Volume, UnstructuredGrid)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
static int ConvertVisualizationModeFromString(const char *modeString)
static std::vector< double > StringToDoubleVector(const char *sourceStr)
static const char * ConvertGlyphTypeToString(int typeIndex)
std::string GetContourLevelsMmAsString()
void SetContourLevelsMmFromString(const char *str)
vtkMRMLCopyContentMacro(vtkMRMLTransformDisplayNode)
vtkMRMLNode * GetGlyphPointsNode()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
vtkMRMLNode * GetRegionNode()
Display options.
void SetColorMap(vtkColorTransferFunction *newColorMap)
static std::string ConvertContourLevelsToString(const std::vector< double > &levels)
~vtkMRMLTransformDisplayNode() override
static vtkMRMLTransformDisplayNode * New()
MRML node for representing a transformation between this node space and a parent node space.
MRML node for representing a volume (image stack).