Slicer 5.4
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
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
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
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(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
189 enum
190 {
191 TransformUpdateEditorBoundsEvent = 2750
192 };
193
197
198 vtkColorTransferFunction* GetColorMap();
199 void SetColorMap(vtkColorTransferFunction* newColorMap);
200
201protected:
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:
248 void operator= ( const vtkMRMLTransformDisplayNode& );
249
250};
251
252#endif
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent procedurally defined color information.
MRML node to represent display properties for transforms visualization in the slice and 3D viewers.
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).