21 #ifndef __vtkMRMLSegmentationNode_h 22 #define __vtkMRMLSegmentationNode_h 35 class vtkCallbackCommand;
61 void PrintSelf(ostream& os, vtkIndent indent)
override;
70 void WriteXML(ostream& of,
int indent)
override;
88 void GetBounds(
double bounds[6])
override;
138 const std::vector<std::string>& segmentIDs = std::vector<std::string>(), vtkIntArray* labelValues =
nullptr);
140 #endif // __VTK_WRAP__ 157 vtkOrientedImageData* mergedLabelmapGeometry =
nullptr, vtkStringArray* segmentIDs =
nullptr, vtkIntArray* labelValues =
nullptr);
162 EditAllowedEverywhere = 0,
178 static const char* ConvertMaskModeToString(
int mode);
180 static int ConvertMaskModeFromString(
const char* modeStr);
196 std::string editedSegmentID=
"", std::string maskSegmentID=
"",
214 virtual bool SetMasterRepresentationToBinaryLabelmap();
217 virtual bool SetMasterRepresentationToClosedSurface();
220 virtual bool CreateBinaryLabelmapRepresentation();
223 virtual void RemoveBinaryLabelmapRepresentation();
229 virtual bool GetBinaryLabelmapRepresentation(
const std::string segmentId,
vtkOrientedImageData* outputBinaryLabelmap);
237 virtual vtkOrientedImageData* GetBinaryLabelmapInternalRepresentation(
const std::string segmentId);
241 virtual bool CreateClosedSurfaceRepresentation();
244 virtual void RemoveClosedSurfaceRepresentation();
250 virtual bool GetClosedSurfaceRepresentation(
const std::string segmentId, vtkPolyData* outputClosedSurface);
255 virtual vtkPolyData* GetClosedSurfaceInternalRepresentation(
const std::string segmentId);
259 virtual std::string AddSegmentFromClosedSurfaceRepresentation(vtkPolyData* polyData,
260 std::string segmentName =
"",
double color[3] =
nullptr, std::string segmentId =
"");
265 std::string segmentName =
"",
double color[3] =
nullptr, std::string segmentId =
"");
268 void RemoveSegment(
const std::string& segmentID);
271 double* GetSegmentCenter(
const std::string& segmentID) VTK_SIZEHINT(3);
274 void GetSegmentCenter(
const std::string& segmentID,
double center[3]);
279 double* GetSegmentCenterRAS(
const std::string& segmentID) VTK_SIZEHINT(3);
282 void GetSegmentCenterRAS(
const std::string& segmentID,
double centerRAS[3]);
285 vtkSetMacro(SegmentListFilterEnabled,
bool);
286 vtkGetMacro(SegmentListFilterEnabled,
bool);
287 vtkBooleanMacro(SegmentListFilterEnabled,
bool);
290 vtkSetMacro(SegmentListFilterOptions, std::string);
291 vtkGetMacro(SegmentListFilterOptions, std::string);
296 void SetLabelmapConversionColorTableNodeID(
const char* labelmapConversionColorTableNodeID);
303 ReferenceImageGeometryChangedEvent = 23000,
304 SegmentationChangedEvent
312 static void SegmentationModifiedCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
316 void OnMasterRepresentationModified();
320 void OnSegmentAdded(
const char* segmentId);
324 void OnSegmentRemoved(
const char* segmentId);
328 void OnSegmentModified(
const char* segmentId);
356 double SegmentCenterTmp[4];
362 #endif // __vtkMRMLSegmentationNode_h vtkSmartPointer< vtkCallbackCommand > SegmentationModifiedCallbackCommand
Command handling events from segmentation object.
Modification is allowed inside all visible segments.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
static const char * GetLabelmapConversionColorTableNodeReferenceMRMLAttributeName()
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
std::string SegmentListFilterOptions
static std::string GetReferenceImageGeometryReferenceRole()
Expose reference identifier to get the volume node defining the reference image geometry if any...
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
virtual void GetBounds(double bounds[6])
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
Modification is allowed outside all visible segments.
const char * GetNodeTagName() override
Get unique node XML tag name (like Volume, Model)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void operator=(const vtkMRMLDisplayableNode &)
MRML node to represent a complete subject hierarchy tree.
Image data containing orientation information.
A set of MRML Nodes that supports serialization and undo/redo.
void PrintSelf(ostream &os, vtkIndent indent) override
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
vtkSegmentation * Segmentation
Segmentation object to store the actual data.
virtual void CreateDefaultDisplayNodes()
bool SegmentListFilterEnabled
MRML node for representing segmentation display attributes.
static const char * GetSegmentIDAttributeName()
Extent is computed as union of effective extent of all segments.
A superclass for other storage nodes.
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
Modification is allowed only over the area covered by segment specified in MaskSegmentID.
static const char * GetLabelmapConversionColorTableNodeReferenceRole()
vtkMRMLCopyContentMacro(vtkMRMLStorableNode)
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent discrete color information.
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
Modification is allowed outside all segments.
Modification is allowed inside all segments.
virtual void GetRASBounds(double bounds[6])
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...