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,
190 std::string editedSegmentID=
"", std::string maskSegmentID=
"",
208 virtual bool SetMasterRepresentationToBinaryLabelmap();
211 virtual bool SetMasterRepresentationToClosedSurface();
214 virtual bool CreateBinaryLabelmapRepresentation();
217 virtual void RemoveBinaryLabelmapRepresentation();
223 virtual bool GetBinaryLabelmapRepresentation(
const std::string segmentId,
vtkOrientedImageData* outputBinaryLabelmap);
231 virtual vtkOrientedImageData* GetBinaryLabelmapInternalRepresentation(
const std::string segmentId);
235 virtual bool CreateClosedSurfaceRepresentation();
238 virtual void RemoveClosedSurfaceRepresentation();
244 virtual bool GetClosedSurfaceRepresentation(
const std::string segmentId, vtkPolyData* outputClosedSurface);
249 virtual vtkPolyData* GetClosedSurfaceInternalRepresentation(
const std::string segmentId);
253 virtual std::string AddSegmentFromClosedSurfaceRepresentation(vtkPolyData* polyData,
254 std::string segmentName =
"",
double color[3] =
nullptr, std::string segmentId =
"");
259 std::string segmentName =
"",
double color[3] =
nullptr, std::string segmentId =
"");
262 void RemoveSegment(
const std::string& segmentID);
265 double* GetSegmentCenter(
const std::string& segmentID) VTK_SIZEHINT(3);
268 void GetSegmentCenter(
const std::string& segmentID,
double center[3]);
273 double* GetSegmentCenterRAS(
const std::string& segmentID) VTK_SIZEHINT(3);
276 void GetSegmentCenterRAS(
const std::string& segmentID,
double centerRAS[3]);
279 vtkSetMacro(SegmentListFilterEnabled,
bool);
280 vtkGetMacro(SegmentListFilterEnabled,
bool);
281 vtkBooleanMacro(SegmentListFilterEnabled,
bool);
284 vtkSetMacro(SegmentListFilterOptions, std::string);
285 vtkGetMacro(SegmentListFilterOptions, std::string);
290 void SetLabelmapConversionColorTableNodeID(
const char* labelmapConversionColorTableNodeID);
296 ReferenceImageGeometryChangedEvent = 23000
304 static void SegmentationModifiedCallback(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
308 void OnMasterRepresentationModified();
312 void OnSegmentAdded(
const char* segmentId);
316 void OnSegmentRemoved(
const char* segmentId);
320 void OnSegmentModified(
const char* segmentId);
348 double SegmentCenterTmp[4];
354 #endif // __vtkMRMLSegmentationNode_h vtkSmartPointer< vtkCallbackCommand > SegmentationModifiedCallbackCommand
Command handling events from segmentation object.
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()
Modification is allowed only over the area covered by segment specified in MaskSegmentID.
bool SegmentListFilterEnabled
MRML node for representing segmentation display attributes.
static const char * GetSegmentIDAttributeName()
A superclass for other storage nodes.
Modification is allowed inside all segments.
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
Extent is computed as union of effective extent of all segments.
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 inside all visible segments.
Modification is allowed outside all segments.
virtual void GetRASBounds(double bounds[6])
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...