Slicer  4.8
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
vtkMRMLMultiVolumeRenderingDisplayNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLMultiVolumeRenderingDisplayNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13 =========================================================================auto=*/
14 // .NAME vtkMRMLMultiVolumeRenderingDisplayNode - MRML node for storing volume rendering display parameters
15 // .SECTION Description
16 // This node stores the display information about the currently selected volume
17 //
18 //
19 
20 #ifndef __vtkMRMLMultiVolumeRenderingDisplayNode_h
21 #define __vtkMRMLMultiVolumeRenderingDisplayNode_h
22 
23 // Multi-Volume Rendering includes
24 #include "vtkSlicerMultiVolumeRenderingModuleMRMLExport.h"
25 
26 // MRML includes
27 #include "vtkMRMLDisplayNode.h"
29 class vtkMRMLVolumeNode;
31 
32 class vtkIntArray;
33 
35 class VTK_SLICER_MULTIVOLUMERENDERING_MODULE_MRML_EXPORT vtkMRMLMultiVolumeRenderingDisplayNode
36  : public vtkMRMLDisplayNode
37 {
38  public:
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
44 
45  // Description:
46  // Set node attributes
47  virtual void ReadXMLAttributes( const char** atts);
48 
49  // Description:
50  // Write this node's information to a MRML file in XML format.
51  virtual void WriteXML(ostream& of, int indent);
52 
53  // Description:
54  // Copy the node's attributes to this object
55  virtual void Copy(vtkMRMLNode *node);
56 
57  // Description:
58  // Get node XML tag name (like Volume, Model)
59  virtual const char* GetNodeTagName() {return "MultiVolumeRenderingParameters";};
60 
61  // Description:
62  // Update the stored reference to another node in the scene
63  virtual void UpdateReferenceID(const char *oldID, const char *newID);
64 
65  // Description:
66  // Updates this node if it depends on other nodes
67  // when the node is deleted in the scene
68  virtual void UpdateReferences();
69 
70  // Description:
71  // Observe the reference transform node
72  virtual void UpdateScene(vtkMRMLScene *scene);
73 
74  virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData);
75 
76  // Description:
77  // the ID of a MRMLVolumeNode (bg volume)
78  vtkGetStringMacro (BgVolumeNodeID);
79  void SetAndObserveBgVolumeNodeID(const char *volumeNodeID);
80 
81  // Description:
82  // the ID of a MRMLVolumeNode (fg volume)
83  vtkGetStringMacro (FgVolumeNodeID);
84  void SetAndObserveFgVolumeNodeID(const char *volumeNodeID);
85 
86  // Description:
87  // the ID of a MRMLVolumeNode (fg volume)
88  vtkGetStringMacro (LabelmapVolumeNodeID);
89  void SetAndObserveLabelmapVolumeNodeID(const char *volumeNodeID);
90 
91  // Description:
92  // Associated transform MRML node (bg volume)
93  vtkMRMLVolumeNode* GetBgVolumeNode();
94 
95  // Description:
96  // Associated transform MRML node (fg volume)
97  vtkMRMLVolumeNode* GetFgVolumeNode();
98 
99  // Description:
100  // Associated transform MRML node (labelmap volume)
101  vtkMRMLVolumeNode* GetLabelmapVolumeNode();
102 
103  // Description:
104  // the ID of a parameter MRMLVolumePropertyNode (bg volume)
105  vtkGetStringMacro (BgVolumePropertyNodeID);
106  void SetAndObserveBgVolumePropertyNodeID(const char *volumePropertyNodeID);
107 
108  // Description:
109  // the ID of a parameter MRMLVolumePropertyNode (fg volume)
110  vtkGetStringMacro (FgVolumePropertyNodeID);
111  void SetAndObserveFgVolumePropertyNodeID(const char *volumePropertyNodeID);
112 
113  // Description:
114  // Associated property MRML node (bg volume)
115  vtkMRMLVolumePropertyNode* GetBgVolumePropertyNode();
116 
117  // Description:
118  // Associated property MRML node (fg volume)
119  vtkMRMLVolumePropertyNode* GetFgVolumePropertyNode();
120 
121  // Description:
122  // the ID of a parameter MRMLROINode (bg volume)
123  vtkGetStringMacro (BgROINodeID);
124  void SetAndObserveBgROINodeID(const char *rOINodeID);
125 
126  // Description:
127  // the ID of a parameter MRMLROINode (fg volume)
128  vtkGetStringMacro (FgROINodeID);
129  void SetAndObserveFgROINodeID(const char *rOINodeID);
130 
131  // Description:
132  // the ID of a parameter MRMLROINode (labelmap volume)
133  vtkGetStringMacro (LabelmapROINodeID);
134  void SetAndObserveLabelmapROINodeID(const char *rOINodeID);
135 
136  // Description:
137  // Associated ROI MRML node
138  vtkMRMLAnnotationROINode* GetBgROINode();
139  vtkMRMLAnnotationROINode* GetFgROINode();
140  vtkMRMLAnnotationROINode* GetLabelmapROINode();
141 
142  // Description:
143  // Is cropping enabled?
144  vtkSetMacro(BgCroppingEnabled,int);
145  vtkGetMacro(BgCroppingEnabled,int);
146  vtkBooleanMacro(BgCroppingEnabled,int);
147 
148  // Description:
149  // Is cropping enabled?
150  vtkSetMacro(FgCroppingEnabled,int);
151  vtkGetMacro(FgCroppingEnabled,int);
152  vtkBooleanMacro(FgCroppingEnabled,int);
153 
154  // Description:
155  // Is cropping enabled?
156  vtkSetMacro(LabelmapCroppingEnabled,int);
157  vtkGetMacro(LabelmapCroppingEnabled,int);
158  vtkBooleanMacro(LabelmapCroppingEnabled,int);
159 
160  // Description:
161  // Estimated Sample Distance
162  vtkSetMacro(EstimatedSampleDistance,double);
163  vtkGetMacro(EstimatedSampleDistance,double);
164 
165  // Description:
166  // Expected FPS
167  vtkSetMacro(ExpectedFPS,double);
168  vtkGetMacro(ExpectedFPS,double);
169 
170  vtkSetMacro(PerformanceControl,int);
171  vtkGetMacro(PerformanceControl,int);
172 
174  {
175  Linked = 0,
176  Independent
177  };
178 
179  vtkSetMacro(MultiVolumeRenderingMode, int);
180  vtkGetMacro(MultiVolumeRenderingMode, int);
181 
182  vtkGetMacro (GPUMemorySize, int);
183  vtkSetMacro (GPUMemorySize, int);
184 
186  {
187  Composite = 0, // composite with directional lighting (default)
188  CompositeEdgeColoring, // composite with fake lighting (edge coloring, faster)
192  IllustrativeContextPreservingExploration
193  };
194 
195  vtkGetMacro (BgRaycastTechnique, int);
196  vtkSetMacro (BgRaycastTechnique, int);
197 
198  vtkGetMacro (FgRaycastTechnique, int);
199  vtkSetMacro (FgRaycastTechnique, int);
200 
202  {
203  AlphaBlendingOR = 0, // (default)
205  AlphaBlendingNOT
206  };
207 
208  vtkGetMacro (MultiVolumeFusionMethod, int);
209  vtkSetMacro (MultiVolumeFusionMethod, int);
210 
211  vtkGetMacro (BgFgRatio, float);
212  vtkSetMacro (BgFgRatio, float);
213 
214  vtkGetMacro(BgFollowVolumeDisplayNode, int);
215  vtkSetMacro(BgFollowVolumeDisplayNode, int);
216 
217  vtkGetMacro(FgFollowVolumeDisplayNode, int);
218  vtkSetMacro(FgFollowVolumeDisplayNode, int);
219 
220  vtkGetMacro(BgIgnoreVolumeDisplayNodeThreshold, int);
221  vtkSetMacro(BgIgnoreVolumeDisplayNodeThreshold, int);
222 
223  vtkGetMacro(FgIgnoreVolumeDisplayNodeThreshold, int);
224  vtkSetMacro(FgIgnoreVolumeDisplayNodeThreshold, int);
225 
226  vtkGetMacro(BgVisibility, bool);
227  vtkSetMacro(BgVisibility, bool);
228 
229  vtkGetMacro(FgVisibility, bool);
230  vtkSetMacro(FgVisibility, bool);
231 
232  vtkGetMacro(LabelmapVisibility, bool);
233  vtkSetMacro(LabelmapVisibility, bool);
234 
235  //Description:
236  //update display node visibility based on user settings for bg, fg and labelmap
237  void UpdateVisibility();
238 
239 protected:
244 
245  vtkIntArray* ObservedEvents;
246 
248  virtual void SetBgVolumeNodeID(const char* arg);
250 
252  virtual void SetFgVolumeNodeID(const char* arg);
254 
256  virtual void SetLabelmapVolumeNodeID(const char* arg);
258 
260  virtual void SetBgVolumePropertyNodeID(const char* arg);
262 
264  virtual void SetFgVolumePropertyNodeID(const char* arg);
266 
267  char *BgROINodeID;
268  virtual void SetBgROINodeID(const char* arg);
270 
271  char *FgROINodeID;
272  virtual void SetFgROINodeID(const char* arg);
274 
276  virtual void SetLabelmapROINodeID(const char* arg);
278 
282 
284  double ExpectedFPS;
285 
286  /* Tracking GPU memory size (in MB), not saved into scene file
287  * because different machines may have different GPU memory
288  * values.
289  * A value of 0 indicates to use the default value in the settings
290  */
292 
293  /* techniques in GPU ray cast
294  * 0: composite with directional lighting (default)
295  * 1: composite with fake lighting (edge coloring, faster)
296  * 2: MIP
297  * 3: MINIP
298  * 4: Gradient Magnitude Opacity Modulation
299  * 5: Illustrative Context Preserving Exploration
300  * */
303 
304  /*
305  * fusion method in GPU ray cast II
306  * 0: Alpha Blending OR (default)
307  * 1: Alpha Blending AND
308  * 2: Alpha Blending NOT
309  * */
311 
313 
314  float BgFgRatio;
315 
316  //follow window/level and thresholding setting in volume display node
319 
322 
323  /*
324  * Performance Control method
325  * 0: Adaptive
326  * 1: Maximum Quality
327  * 2: Fixed Framerate
328  * */
330 
334 };
335 
336 #endif
337 
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE
Copy the node's attributes to this object.
virtual void UpdateReferences() VTK_OVERRIDE
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE
virtual void UpdateReferenceID(const char *oldID, const char *newID) VTK_OVERRIDE
Update the stored reference to another node in the scene.
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
void operator=(const vtkMRMLDisplayNode &)
MRML node for representing a volume (image stack).
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void WriteXML(ostream &of, int indent) VTK_OVERRIDE
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...
virtual void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE
Finds the storage node and read the data.
virtual void ReadXMLAttributes(const char **atts) VTK_OVERRIDE