Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLSegmentEditorNode.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __vtkMRMLSegmentEditorNode_h
24 #define __vtkMRMLSegmentEditorNode_h
25 
26 // MRML includes
27 #include <vtkMRMLNode.h>
28 
29 // Segmentations includes
30 #include "vtkSlicerSegmentationsModuleMRMLExport.h"
31 
32 #include "vtkOrientedImageData.h"
33 
34 class vtkMRMLScene;
37 
46 class VTK_SLICER_SEGMENTATIONS_MODULE_MRML_EXPORT vtkMRMLSegmentEditorNode : public vtkMRMLNode
47 {
48 public:
49  enum
50  {
54  EffectParameterModified = 62200
55  };
56 
59  enum
60  {
62  PaintAllowedEverywhere=0,
73  // Insert valid types above this line
74  PaintAllowed_Last
75  };
76 
77  enum
78  {
80  OverwriteAllSegments=0,
85  // Insert valid types above this line
86  Overwrite_Last
87  };
88 
89 public:
90  static vtkMRMLSegmentEditorNode *New();
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
95  vtkMRMLNode* CreateNodeInstance() override;
96 
98  void ReadXMLAttributes( const char** atts) override;
99 
101  void WriteXML(ostream& of, int indent) override;
102 
104  void Copy(vtkMRMLNode *node) override;
105 
107  const char* GetNodeTagName() override { return "SegmentEditor"; }
108 
110  static int ConvertOverwriteModeFromString(const char* modeStr);
112  static const char* ConvertOverwriteModeToString(int mode);
113  static const char* ConvertMaskModeToString(int mode);
114  static int ConvertMaskModeFromString(const char* modeStr);
116 
117 public:
118 
120  vtkMRMLScalarVolumeNode* GetMasterVolumeNode();
123  void SetAndObserveMasterVolumeNode(vtkMRMLScalarVolumeNode* node);
125 
127  vtkMRMLSegmentationNode* GetSegmentationNode();
129  void SetAndObserveSegmentationNode(vtkMRMLSegmentationNode* node);
131 
133  vtkGetStringMacro(SelectedSegmentID);
136  vtkSetStringMacro(SelectedSegmentID);
138 
140  vtkGetStringMacro(ActiveEffectName);
142  vtkSetStringMacro(ActiveEffectName);
144 
146  vtkSetMacro(MaskMode, int);
151  vtkGetMacro(MaskMode, int);
153 
155  vtkGetStringMacro(MaskSegmentID);
159  vtkSetStringMacro(MaskSegmentID);
161 
163  vtkBooleanMacro(MasterVolumeIntensityMask, bool);
165  vtkGetMacro(MasterVolumeIntensityMask, bool);
166  vtkSetMacro(MasterVolumeIntensityMask, bool);
168 
170  vtkSetVector2Macro(MasterVolumeIntensityMaskRange, double);
175  vtkGetVector2Macro(MasterVolumeIntensityMaskRange, double);
177 
179  vtkSetMacro(OverwriteMode, int);
182  vtkGetMacro(OverwriteMode, int);
184 
185 protected:
187  ~vtkMRMLSegmentEditorNode() override;
189  void operator=(const vtkMRMLSegmentEditorNode&);
190 
192  char* SelectedSegmentID{nullptr};
193 
195  char* ActiveEffectName{nullptr};
196 
197  int MaskMode{PaintAllowedEverywhere};
198  char* MaskSegmentID{nullptr};
199 
200  int OverwriteMode{OverwriteAllSegments};
201 
202  bool MasterVolumeIntensityMask{false};
203  double MasterVolumeIntensityMaskRange[2];
204 };
205 
206 #endif // __vtkMRMLSegmentEditorNode_h
Modification is allowed inside all segments.
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
Modification is allowed outside all segments.
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:61
Parameter set node for the segment editor widget.
Areas added to selected segment will not be removed from any segments. (overlap with all other segmen...
Areas added to selected segment will be removed from all visible segments. (no overlap with visible...
virtual void WriteXML(ostream &of, int indent)
Modification is allowed outside all visible segments.
Modification is allowed inside all visible segments.
Modification is allowed only over the area covered by segment specified in MaskSegmentID.
void PrintSelf(ostream &os, vtkIndent indent) override
MRML node for representing a volume (image stack).
const char * GetNodeTagName() override
Get unique node XML tag name (like Volume, Model)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...