Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLSliceCompositeNode.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: vtkMRMLSliceCompositeNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLSliceCompositeNode_h
16 #define __vtkMRMLSliceCompositeNode_h
17 
18 #include "vtkMRMLNode.h"
19 
20 class vtkMRMLModelNode;
22 
27 class VTK_MRML_EXPORT vtkMRMLSliceCompositeNode : public vtkMRMLNode
28 {
29 public:
30  static vtkMRMLSliceCompositeNode *New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
34  vtkMRMLNode* CreateNodeInstance() override;
35 
38  void ReadXMLAttributes( const char** atts) override;
39 
42  void WriteXML(ostream& of, int indent) override;
43 
47 
50  const char* GetNodeTagName() override {return "SliceComposite";}
51 
54  const char* GetBackgroundVolumeID();
55  void SetBackgroundVolumeID(const char* id);
56  void SetReferenceBackgroundVolumeID(const char *id) { this->SetBackgroundVolumeID(id); }
57 
60  const char* GetForegroundVolumeID();
61  void SetForegroundVolumeID(const char* id);
62  void SetReferenceForegroundVolumeID(const char *id) { this->SetForegroundVolumeID(id); }
63 
66  const char* GetLabelVolumeID();
67  void SetLabelVolumeID(const char* id);
68  void SetReferenceLabelVolumeID(const char *id) { this->SetLabelVolumeID(id); }
69 
73  vtkGetMacro (Compositing, int);
74  vtkSetMacro (Compositing, int);
75 
80  vtkGetMacro (ForegroundOpacity, double);
81  vtkSetMacro (ForegroundOpacity, double);
82 
87  vtkGetMacro (LabelOpacity, double);
88  vtkSetMacro (LabelOpacity, double);
89 
92  vtkGetMacro (LinkedControl, int );
93  vtkSetMacro (LinkedControl, int );
94  vtkBooleanMacro(LinkedControl, int);
95 
99  vtkGetMacro (HotLinkedControl, int );
100  vtkSetMacro (HotLinkedControl, int );
101  vtkBooleanMacro(HotLinkedControl, int);
102 
105  vtkGetMacro (FiducialVisibility, int );
106  vtkSetMacro (FiducialVisibility, int );
107  vtkGetMacro (FiducialLabelVisibility, int );
108  vtkSetMacro (FiducialLabelVisibility, int );
109 
114  int GetSliceIntersectionVisibility();
115  void SetSliceIntersectionVisibility(int visibility);
116 
118  vtkGetMacro ( AnnotationSpace, int );
119 
123  vtkSetMacro ( AnnotationSpace, int );
124 
126  vtkGetMacro ( AnnotationMode, int );
127 
131  vtkSetMacro ( AnnotationMode, int );
132 
137  vtkSetMacro (DoPropagateVolumeSelection, bool );
138  vtkGetMacro (DoPropagateVolumeSelection, bool );
139 
147  void SetLayoutName(const char *layoutName) {
148  this->SetSingletonTag(layoutName);
149  }
150  char *GetLayoutName() {
151  return this->GetSingletonTag();
152  }
153 
156  {
157  XYZ = 0,
161  AnnotationSpace_Last // insert values above this line
162  };
163 
166  {
167  NoAnnotation = 0,
171  AnnotationMode_Last // insert values above this line
172  };
173 
175  enum
176  {
177  Alpha = 0,
180  Subtract
181  };
182 
188  void SetInteracting(int);
189  vtkGetMacro(Interacting, int);
190  vtkBooleanMacro(Interacting, int);
191 
201  {
202  None = 0,
203  ForegroundVolumeFlag = 1,
204  BackgroundVolumeFlag = 2,
205  LabelVolumeFlag = 4,
206  LabelOpacityFlag = 8,
207  ForegroundOpacityFlag = 16
208  // Next one needs to be 32
209  };
210 
216  void SetInteractionFlags(unsigned int);
217  vtkGetMacro(InteractionFlags, unsigned int);
218 
224  void SetInteractionFlagsModifier(unsigned int);
225  vtkGetMacro(InteractionFlagsModifier, unsigned int);
226 
230  void ResetInteractionFlagsModifier();
231 
233  const char* GetAnnotationSpaceAsString(int id);
234  int GetAnnotationSpaceFromString(const char* name);
235 
237  const char* GetAnnotationModeAsString(int id);
238  int GetAnnotationModeFromString(const char* name);
239 
240 protected:
241 
243  ~vtkMRMLSliceCompositeNode() override;
246 
247  // Helper functions for deprecated SetSliceIntersectionVisibility/GetSliceIntersectionVisibility methods.
248  vtkMRMLSliceDisplayNode* GetSliceDisplayNode();
249  std::string GetCompositeNodeIDFromSliceModelNode(vtkMRMLModelNode* sliceModelNode);
250 
251  // Cached value of last found displayable node (it is expensive to determine it)
252  vtkWeakPointer<vtkMRMLSliceDisplayNode> LastFoundSliceDisplayNode;
253 
254  // start by showing only the background volume
255  double ForegroundOpacity{ 0.0 };
256 
257  int Compositing{ Alpha };
258 
259  // Show the label if there is one
260  double LabelOpacity{ 1.0 };
261  int LinkedControl{ 0 };
262  int HotLinkedControl{ 0 };
263 
264  int FiducialVisibility{ 1 };
265  int FiducialLabelVisibility{ 1 };
266 
267  int AnnotationSpace{ IJKAndRAS };
268  int AnnotationMode{ All };
269 
270  bool DoPropagateVolumeSelection{ true };
271 
272  int Interacting{ 0 };
273  unsigned int InteractionFlags{ 0 };
274  unsigned int InteractionFlagsModifier{ (unsigned int)-1 };
275 };
276 
277 #endif
void SetReferenceLabelVolumeID(const char *id)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
MRML node to represent a 3D surface model.
MRML node to store display properties of slice nodes.
MRML node for storing a slice through RAS space.
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual char * GetSingletonTag()
virtual void WriteXML(ostream &of, int indent)
void SetLayoutName(const char *layoutName)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
Definition: vtkMRMLNode.h:142
vtkWeakPointer< vtkMRMLSliceDisplayNode > LastFoundSliceDisplayNode
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.
void SetReferenceForegroundVolumeID(const char *id)
void SetReferenceBackgroundVolumeID(const char *id)