Slicer 5.11
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);
189 vtkGetMacro(EditorRotationEnabled, bool);
190 vtkSetMacro(EditorRotationEnabled, bool);
191 vtkBooleanMacro(EditorRotationEnabled, bool);
192 vtkGetMacro(EditorRotationSliceEnabled, bool);
193 vtkSetMacro(EditorRotationSliceEnabled, bool);
194 vtkBooleanMacro(EditorRotationSliceEnabled, bool);
195 vtkGetMacro(EditorScalingEnabled, bool);
196 vtkSetMacro(EditorScalingEnabled, bool);
197 vtkBooleanMacro(EditorScalingEnabled, bool);
198 vtkGetMacro(EditorScalingSliceEnabled, bool);
199 vtkSetMacro(EditorScalingSliceEnabled, bool);
200 vtkBooleanMacro(EditorScalingSliceEnabled, bool);
201
205 enum
206 {
208 };
209
213
214 vtkColorTransferFunction* GetColorMap();
215 void SetColorMap(vtkColorTransferFunction* newColorMap);
216
218 vtkSetMacro(InteractionSizeMm, double);
219 vtkGetMacro(InteractionSizeMm, double);
220
222 vtkSetMacro(InteractionScalePercent, double);
223 vtkGetMacro(InteractionScalePercent, double);
224
226 vtkSetMacro(InteractionSizeAbsolute, bool);
227 vtkGetMacro(InteractionSizeAbsolute, bool);
228 vtkBooleanMacro(InteractionSizeAbsolute, bool);
229
231 vtkSetMacro(ActiveInteractionType, int);
232 vtkGetMacro(ActiveInteractionType, int);
233
235 vtkSetMacro(ActiveInteractionIndex, int);
236 vtkGetMacro(ActiveInteractionIndex, int);
237
239
243 vtkSetVector4Macro(RotationHandleComponentVisibility3D, bool);
244 vtkGetVector4Macro(RotationHandleComponentVisibility3D, bool);
245 vtkSetVector4Macro(ScaleHandleComponentVisibility3D, bool);
246 vtkGetVector4Macro(ScaleHandleComponentVisibility3D, bool);
247 vtkSetVector4Macro(TranslationHandleComponentVisibility3D, bool);
248 vtkGetVector4Macro(TranslationHandleComponentVisibility3D, bool);
249 vtkSetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
250 vtkGetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
251 vtkSetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
252 vtkGetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
256
257protected:
258 static std::vector<double> StringToDoubleVector(const char* sourceStr);
259 static std::string DoubleVectorToString(const double* values, int numberOfValues);
260
262
263 // Glyph Parameters
269 // 3d parameters
274 // 2d parameters
277
278 // Grid Parameters
288
289 // Contour Parameters
293 std::vector<double> ContourLevelsMm;
294
295 // Interaction Parameters
305
309 double InteractionSizeMm{ 5.0 };
311
315
319
320protected:
325};
326
327#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).