Slicer 5.9
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
140 // Grid Parameters
141 vtkSetMacro(GridScalePercent, double);
142 vtkGetMacro(GridScalePercent, double);
143 vtkSetMacro(GridSpacingMm, double);
144 vtkGetMacro(GridSpacingMm, double);
145 vtkSetMacro(GridLineDiameterMm, double);
146 vtkGetMacro(GridLineDiameterMm, double);
147 vtkSetMacro(GridResolutionMm, double);
148 vtkGetMacro(GridResolutionMm, double);
149 vtkSetMacro(GridShowNonWarped, bool);
150 vtkGetMacro(GridShowNonWarped, bool);
151
152 // Contour Parameters
154 void SetContourLevelsMm(double*, int size);
156 void GetContourLevelsMm(std::vector<double>& levels);
158 void SetContourLevelsMmFromString(const char* str);
159 static std::vector<double> ConvertContourLevelsFromString(const char* str);
160 static std::string ConvertContourLevelsToString(const std::vector<double>& levels);
161 static bool IsContourLevelEqual(const std::vector<double>& levels1, const std::vector<double>& levels2);
162
163 vtkSetMacro(ContourResolutionMm, double);
164 vtkGetMacro(ContourResolutionMm, double);
165 vtkSetMacro(ContourOpacity, double);
166 vtkGetMacro(ContourOpacity, double);
167
168 // Interaction Parameters
169 vtkGetMacro(EditorVisibility, bool);
170 vtkSetMacro(EditorVisibility, bool);
171 vtkBooleanMacro(EditorVisibility, bool);
172 vtkGetMacro(EditorVisibility3D, bool);
173 vtkSetMacro(EditorVisibility3D, bool);
174 vtkBooleanMacro(EditorVisibility3D, bool);
177 vtkBooleanMacro(EditorSliceIntersectionVisibility, bool);
178 vtkGetMacro(EditorTranslationEnabled, bool);
179 vtkSetMacro(EditorTranslationEnabled, bool);
180 vtkBooleanMacro(EditorTranslationEnabled, bool);
183 vtkBooleanMacro(EditorTranslationSliceEnabled, bool);
184 vtkGetMacro(EditorRotationEnabled, bool);
185 vtkSetMacro(EditorRotationEnabled, bool);
186 vtkBooleanMacro(EditorRotationEnabled, bool);
187 vtkGetMacro(EditorRotationSliceEnabled, bool);
188 vtkSetMacro(EditorRotationSliceEnabled, bool);
189 vtkBooleanMacro(EditorRotationSliceEnabled, bool);
190 vtkGetMacro(EditorScalingEnabled, bool);
191 vtkSetMacro(EditorScalingEnabled, bool);
192 vtkBooleanMacro(EditorScalingEnabled, bool);
193 vtkGetMacro(EditorScalingSliceEnabled, bool);
194 vtkSetMacro(EditorScalingSliceEnabled, bool);
195 vtkBooleanMacro(EditorScalingSliceEnabled, bool);
196
200 enum
201 {
203 };
204
208
209 vtkColorTransferFunction* GetColorMap();
210 void SetColorMap(vtkColorTransferFunction* newColorMap);
211
213 vtkSetMacro(InteractionSizeMm, double);
214 vtkGetMacro(InteractionSizeMm, double);
215
217 vtkSetMacro(InteractionScalePercent, double);
218 vtkGetMacro(InteractionScalePercent, double);
219
221 vtkSetMacro(InteractionSizeAbsolute, bool);
222 vtkGetMacro(InteractionSizeAbsolute, bool);
223 vtkBooleanMacro(InteractionSizeAbsolute, bool);
224
226 vtkSetMacro(ActiveInteractionType, int);
227 vtkGetMacro(ActiveInteractionType, int);
228
230 vtkSetMacro(ActiveInteractionIndex, int);
231 vtkGetMacro(ActiveInteractionIndex, int);
232
234
238 vtkSetVector4Macro(RotationHandleComponentVisibility3D, bool);
239 vtkGetVector4Macro(RotationHandleComponentVisibility3D, bool);
240 vtkSetVector4Macro(ScaleHandleComponentVisibility3D, bool);
241 vtkGetVector4Macro(ScaleHandleComponentVisibility3D, bool);
242 vtkSetVector4Macro(TranslationHandleComponentVisibility3D, bool);
243 vtkGetVector4Macro(TranslationHandleComponentVisibility3D, bool);
244 vtkSetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
245 vtkGetVector4Macro(RotationHandleComponentVisibilitySlice, bool);
246 vtkSetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
247 vtkGetVector4Macro(ScaleHandleComponentVisibilitySlice, bool);
251
252protected:
253 static std::vector<double> StringToDoubleVector(const char* sourceStr);
254 static std::string DoubleVectorToString(const double* values, int numberOfValues);
255
257
258 // Glyph Parameters
264 // 3d parameters
269
270 // Grid Parameters
280
281 // Contour Parameters
285 std::vector<double> ContourLevelsMm;
286
287 // Interaction Parameters
297
301 double InteractionSizeMm{ 5.0 };
303
307
311
312protected:
317};
318
319#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).