Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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>
29
30// Segmentations includes
31#include "vtkSlicerSegmentationsModuleMRMLExport.h"
32
34
35class vtkMRMLScene;
37
46class VTK_SLICER_SEGMENTATIONS_MODULE_MRML_EXPORT vtkMRMLSegmentEditorNode : public vtkMRMLNode
47{
48public:
49 enum
50 {
54 EffectParameterModified = 62200
55 };
56
57 enum
58 {
60 OverwriteAllSegments=0,
65 // Insert valid types above this line
66 Overwrite_Last
67 };
68
69public:
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
76
78 void ReadXMLAttributes( const char** atts) override;
79
81 void WriteXML(ostream& of, int indent) override;
82
84 void Copy(vtkMRMLNode *node) override;
85
87 const char* GetNodeTagName() override { return "SegmentEditor"; }
88
90
91 static int ConvertOverwriteModeFromString(const char* modeStr);
92 static const char* ConvertOverwriteModeToString(int mode);
94
95public:
96
98
103
105
109
111
115
117
119 vtkGetStringMacro(SelectedSegmentID);
120 vtkSetStringMacro(SelectedSegmentID);
122
124
125 vtkGetStringMacro(ActiveEffectName);
126 vtkSetStringMacro(ActiveEffectName);
128
130
135 vtkSetMacro(MaskMode, int);
136 vtkGetMacro(MaskMode, int);
138
140
143 vtkGetStringMacro(MaskSegmentID);
144 vtkSetStringMacro(MaskSegmentID);
146
148
149 vtkBooleanMacro(SourceVolumeIntensityMask, bool);
150 vtkGetMacro(SourceVolumeIntensityMask, bool);
151 vtkSetMacro(SourceVolumeIntensityMask, bool);
153
155
156 virtual void MasterVolumeIntensityMaskOn() { this->SourceVolumeIntensityMaskOn(); }
157 virtual void MasterVolumeIntensityMaskOff() { this->SourceVolumeIntensityMaskOff(); }
158 virtual void SetMasterVolumeIntensityMask(bool enable) { this->SetSourceVolumeIntensityMask(enable); }
159 virtual bool GetMasterVolumeIntensityMask() { return this->GetSourceVolumeIntensityMask(); }
161
163
167 vtkSetVector2Macro(SourceVolumeIntensityMaskRange, double);
168 vtkGetVector2Macro(SourceVolumeIntensityMaskRange, double);
170
172
173 virtual void SetMasterVolumeIntensityMaskRange(double _arg1, double _arg2)
174 {
175 vtkWarningMacro("vtkMRMLSegmentEditorNode::SetMasterVolumeIntensityMaskRange() method is deprecated, use SetSourceVolumeIntensityMaskRange method instead");
176 this->SetSourceVolumeIntensityMaskRange(_arg1, _arg2);
177 }
178 void SetMasterVolumeIntensityMaskRange(const double _arg[2])
179 {
180 vtkWarningMacro("vtkMRMLSegmentEditorNode::SetMasterVolumeIntensityMaskRange() method is deprecated, use SetSourceVolumeIntensityMaskRange method instead");
181 this->SetSourceVolumeIntensityMaskRange(_arg);
182 }
183
184 virtual double* GetMasterVolumeIntensityMaskRange() VTK_SIZEHINT(2)
185 {
186 vtkWarningMacro("vtkMRMLSegmentEditorNode::GetMasterVolumeIntensityMaskRange() method is deprecated, use GetSourceVolumeIntensityMaskRange method instead");
187 return this->GetSourceVolumeIntensityMaskRange();
188 }
189
190 VTK_WRAPEXCLUDE
191 virtual void GetMasterVolumeIntensityMaskRange(double& _arg1, double& _arg2)
192 {
193 vtkWarningMacro("vtkMRMLSegmentEditorNode::GetMasterVolumeIntensityMaskRange() method is deprecated, use GetSourceVolumeIntensityMaskRange method instead");
194 this->GetSourceVolumeIntensityMaskRange(_arg1, _arg2);
195 }
196
197 VTK_WRAPEXCLUDE
198 virtual void GetMasterVolumeIntensityMaskRange(double _arg[2])
199 {
200 vtkWarningMacro("vtkMRMLSegmentEditorNode::GetMasterVolumeIntensityMaskRange() method is deprecated, use GetSourceVolumeIntensityMaskRange method instead");
201 this->GetSourceVolumeIntensityMaskRange(_arg);
202 }
204
206
208 vtkSetMacro(OverwriteMode, int);
209 vtkGetMacro(OverwriteMode, int);
211
212protected:
217
219 char* SelectedSegmentID{nullptr};
220
222 char* ActiveEffectName{nullptr};
223
225 char* MaskSegmentID{nullptr};
226
227 int OverwriteMode{OverwriteAllSegments};
228
229 bool SourceVolumeIntensityMask{false};
230 double SourceVolumeIntensityMaskRange[2];
231};
232
233#endif
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing a volume (image stack).
A set of MRML Nodes that supports serialization and undo/redo.
Parameter set node for the segment editor widget.
vtkMRMLScalarVolumeNode * GetMasterVolumeNode()
Deprecated. Use GetSourceVolumeNode/SetAndObserveSourceVolumeNode methods instead.
const char * GetNodeTagName() override
Get unique node XML tag name (like Volume, Model)
vtkMRMLSegmentEditorNode(const vtkMRMLSegmentEditorNode &)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
virtual void SetMasterVolumeIntensityMaskRange(double _arg1, double _arg2)
Deprecated. Use Get/SetSourceVolumeIntensityMaskRange method instead.
void SetAndObserveSourceVolumeNode(vtkMRMLScalarVolumeNode *node)
virtual VTK_WRAPEXCLUDE void GetMasterVolumeIntensityMaskRange(double _arg[2])
static int ConvertOverwriteModeFromString(const char *modeStr)
Convert between constants IDs to/from string.
virtual VTK_WRAPEXCLUDE void GetMasterVolumeIntensityMaskRange(double &_arg1, double &_arg2)
@ OverwriteNone
Areas added to selected segment will not be removed from any segments. (overlap with all other segmen...
@ OverwriteVisibleSegments
Areas added to selected segment will be removed from all visible segments. (no overlap with visible,...
vtkMRMLSegmentationNode * GetSegmentationNode()
Get/set segmentation node.
virtual void MasterVolumeIntensityMaskOn()
Deprecated. Use Get/SetSourceVolumeIntensityMask method instead.
static const char * ConvertOverwriteModeToString(int mode)
void SetAndObserveSegmentationNode(vtkMRMLSegmentationNode *node)
void ReadXMLAttributes(const char **atts) override
Set node attributes from name/value pairs.
vtkMRMLNode * CreateNodeInstance() override
Create a new node of this type.
void PrintSelf(ostream &os, vtkIndent indent) override
void SetMasterVolumeIntensityMaskRange(const double _arg[2])
static vtkMRMLSegmentEditorNode * New()
virtual void SetMasterVolumeIntensityMask(bool enable)
virtual double * GetMasterVolumeIntensityMaskRange() VTK_SIZEHINT(2)
void operator=(const vtkMRMLSegmentEditorNode &)
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
~vtkMRMLSegmentEditorNode() override
void SetAndObserveMasterVolumeNode(vtkMRMLScalarVolumeNode *node)
vtkMRMLScalarVolumeNode * GetSourceVolumeNode()
MRML node containing segmentations.
@ EditAllowedEverywhere
Modification is allowed everywhere.