Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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#ifndef __vtkMRMLTransformDisplayNode_h
24#define __vtkMRMLTransformDisplayNode_h
25
26#include "vtkMRMLDisplayNode.h"
27
28// vtkAddon includes
29#include <vtkAddonSetGet.h>
30
31class vtkColorTransferFunction;
32class vtkPointSet;
33class vtkMatrix4x4;
37
41class VTK_MRML_EXPORT vtkMRMLTransformDisplayNode : public vtkMRMLDisplayNode
42{
43public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
55
57 {
61 GLYPH_TYPE_LAST // this should be the last glyph type
62 };
63
64 //--------------------------------------------------------------------------
66 //--------------------------------------------------------------------------
67
69
72 void ReadXMLAttributes(const char** atts) override;
73
76 void WriteXML(ostream& of, int indent) override;
77
81
84 const char* GetNodeTagName() override { return "TransformDisplayNode"; }
85
88 void ProcessMRMLEvents(vtkObject* /*caller*/, unsigned long /*event*/, void* /*callData*/) override;
89
90 //--------------------------------------------------------------------------
92 //--------------------------------------------------------------------------
93
98
103
104 vtkSetMacro(VisualizationMode, int);
105 vtkGetMacro(VisualizationMode, int);
108 static const char* ConvertVisualizationModeToString(int modeIndex);
111 static int ConvertVisualizationModeFromString(const char* modeString);
112
113 // Glyph Parameters
114 vtkSetMacro(GlyphSpacingMm, double);
115 vtkGetMacro(GlyphSpacingMm, double);
116 vtkSetMacro(GlyphScalePercent, double);
117 vtkGetMacro(GlyphScalePercent, double);
118 vtkSetMacro(GlyphDisplayRangeMaxMm, double);
119 vtkGetMacro(GlyphDisplayRangeMaxMm, double);
120 vtkSetMacro(GlyphDisplayRangeMinMm, double);
121 vtkGetMacro(GlyphDisplayRangeMinMm, double);
122 vtkSetMacro(GlyphType, int);
123 vtkGetMacro(GlyphType, int);
126 static const char* ConvertGlyphTypeToString(int typeIndex);
129 static int ConvertGlyphTypeFromString(const char* typeString);
130 // 3d parameters
131 vtkSetMacro(GlyphTipLengthPercent, double);
132 vtkGetMacro(GlyphTipLengthPercent, double);
133 vtkSetMacro(GlyphDiameterMm, double);
134 vtkGetMacro(GlyphDiameterMm, double);
135 vtkSetMacro(GlyphShaftDiameterPercent, double);
136 vtkGetMacro(GlyphShaftDiameterPercent, double);
137 vtkSetMacro(GlyphResolution, int);
138 vtkGetMacro(GlyphResolution, int);
139 // 2d parameters
140 vtkSetMacro(GlyphResolution2D, int);
141 vtkGetMacro(GlyphResolution2D, int);
142 vtkSetMacro(GlyphTipLengthPercent2D, double);
143 vtkGetMacro(GlyphTipLengthPercent2D, double);
144
145 // Grid Parameters
146 vtkSetMacro(GridScalePercent, double);
147 vtkGetMacro(GridScalePercent, double);
148 vtkSetMacro(GridSpacingMm, double);
149 vtkGetMacro(GridSpacingMm, double);
150 vtkSetMacro(GridLineDiameterMm, double);
151 vtkGetMacro(GridLineDiameterMm, double);
152 vtkSetMacro(GridResolutionMm, double);
153 vtkGetMacro(GridResolutionMm, double);
154 vtkSetMacro(GridShowNonWarped, bool);
155 vtkGetMacro(GridShowNonWarped, bool);
156
157 // Contour Parameters
159 void SetContourLevelsMm(double*, int size);
161 void GetContourLevelsMm(std::vector<double>& levels);
163 void SetContourLevelsMmFromString(const char* str);
164 static std::vector<double> ConvertContourLevelsFromString(const char* str);
165 static std::string ConvertContourLevelsToString(const std::vector<double>& levels);
166 static bool IsContourLevelEqual(const std::vector<double>& levels1, const std::vector<double>& levels2);
167
168 vtkSetMacro(ContourResolutionMm, double);
169 vtkGetMacro(ContourResolutionMm, double);
170 vtkSetMacro(ContourOpacity, double);
171 vtkGetMacro(ContourOpacity, double);
172
173 // Interaction Parameters
174 vtkGetMacro(EditorVisibility, bool);
175 vtkSetMacro(EditorVisibility, bool);
176 vtkBooleanMacro(EditorVisibility, bool);
177 vtkGetMacro(EditorVisibility3D, bool);
178 vtkSetMacro(EditorVisibility3D, bool);
179 vtkBooleanMacro(EditorVisibility3D, bool);
182 vtkBooleanMacro(EditorSliceIntersectionVisibility, bool);
183 vtkGetMacro(EditorTranslationEnabled, bool);
184 vtkSetMacro(EditorTranslationEnabled, bool);
185 vtkBooleanMacro(EditorTranslationEnabled, bool);
188 vtkBooleanMacro(EditorTranslationSliceEnabled, bool);
201 vtkSetClampMacro(EditorTranslationSliceAnywhereSensitivity, double, 0.0, 1.0);
203 vtkGetMacro(EditorRotationEnabled, bool);
204 vtkSetMacro(EditorRotationEnabled, bool);
205 vtkBooleanMacro(EditorRotationEnabled, bool);
206 vtkGetMacro(EditorRotationSliceEnabled, bool);
207 vtkSetMacro(EditorRotationSliceEnabled, bool);
208 vtkBooleanMacro(EditorRotationSliceEnabled, bool);
209 vtkGetMacro(EditorScalingEnabled, bool);
210 vtkSetMacro(EditorScalingEnabled, bool);
211 vtkBooleanMacro(EditorScalingEnabled, bool);
212 vtkGetMacro(EditorScalingSliceEnabled, bool);
213 vtkSetMacro(EditorScalingSliceEnabled, bool);
214 vtkBooleanMacro(EditorScalingSliceEnabled, bool);
215
219 enum
220 {
222 };
223
227
228 vtkColorTransferFunction* GetColorMap();
229 void SetColorMap(vtkColorTransferFunction* newColorMap);
230
232 vtkSetMacro(InteractionSizeMm, double);
233 vtkGetMacro(InteractionSizeMm, double);
234
236 vtkSetMacro(InteractionScalePercent, double);
237 vtkGetMacro(InteractionScalePercent, double);
238
240 vtkSetMacro(InteractionSizeAbsolute, bool);
241 vtkGetMacro(InteractionSizeAbsolute, bool);
242 vtkBooleanMacro(InteractionSizeAbsolute, bool);
243
246 vtkSetClampMacro(InteractionHandleOpacity, double, 0.0, 1.0);
247 vtkGetMacro(InteractionHandleOpacity, double);
248
250 vtkSetMacro(ActiveInteractionType, int);
251 vtkGetMacro(ActiveInteractionType, int);
252
254 vtkSetMacro(ActiveInteractionIndex, int);
255 vtkGetMacro(ActiveInteractionIndex, int);
256
258
262 vtkSetVector4Macro(RotationHandleComponentVisibility3D, bool);
263 vtkGetVector4Macro(RotationHandleComponentVisibility3D, bool);
264 vtkSetVector4Macro(ScaleHandleComponentVisibility3D, bool);
265 vtkGetVector4Macro(ScaleHandleComponentVisibility3D, bool);
266 vtkSetVector4Macro(TranslationHandleComponentVisibility3D, bool);
267 vtkGetVector4Macro(TranslationHandleComponentVisibility3D, bool);
268 vtkSetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
269 vtkGetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
270 vtkSetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
271 vtkGetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
275
276protected:
277 static std::vector<double> StringToDoubleVector(const char* sourceStr);
278 static std::string DoubleVectorToString(const double* values, int numberOfValues);
279
281
282 // Glyph Parameters
288 // 3d parameters
293 // 2d parameters
296
297 // Grid Parameters
307
308 // Contour Parameters
312 std::vector<double> ContourLevelsMm;
313
314 // Interaction Parameters
326
330 double InteractionSizeMm{ 5.0 };
333
337
341
342protected:
347};
348
349#endif
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)
void operator=(const vtkMRMLTransformDisplayNode &)
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).