21 #ifndef __vtkMRMLSegmentationStorageNode_h 22 #define __vtkMRMLSegmentationStorageNode_h 26 #define SUPPORT_4D_SPATIAL_NRRD 31 #ifdef SUPPORT_4D_SPATIAL_NRRD 33 #include <itkImageRegionIteratorWithIndex.h> 43 class vtkInformationStringKey;
44 class vtkInformationIntegerVectorKey;
65 #ifdef SUPPORT_4D_SPATIAL_NRRD 69 typedef itk::Image<unsigned char, 4> BinaryLabelmap4DImageType;
70 typedef itk::ImageRegionIteratorWithIndex<BinaryLabelmap4DImageType> BinaryLabelmap4DIteratorType;
76 void PrintSelf(ostream& os, vtkIndent indent)
override;
84 void WriteXML(ostream& of,
int indent)
override;
101 void ResetSupportedWriteFileTypes();
110 vtkSetMacro(CropToMinimumExtent,
bool);
111 vtkGetMacro(CropToMinimumExtent,
bool);
112 vtkBooleanMacro(CropToMinimumExtent,
bool);
139 #ifdef SUPPORT_4D_SPATIAL_NRRD 140 virtual int ReadBinaryLabelmapRepresentation4DSpatial(
vtkMRMLSegmentationNode* segmentationNode, std::string path);
149 void AddPolyDataFileNames(std::string path,
vtkSegmentation* segmentation);
152 std::string SerializeContainedRepresentationNames(
vtkSegmentation* segmentation);
155 void CreateRepresentationsBySerializedNames(
vtkSegmentation* segmentation, std::string representationNames);
158 static bool GetSegmentMetaDataFromDicitionary(std::string& headerValue, itk::MetaDataDictionary dictionary,
int segmentIndex, std::string keyName);
161 static bool GetSegmentationMetaDataFromDicitionary(std::string& headerValue, itk::MetaDataDictionary dictionary, std::string keyName);
163 static std::string GetSegmentMetaDataKey(
int segmentIndex,
const std::string& keyName);
165 static std::string GetSegmentationMetaDataKey(
const std::string& keyName);
167 static std::string GetSegmentTagsAsString(
vtkSegment* segment);
168 static void SetSegmentTagsFromString(
vtkSegment* segment, std::string tagsValue);
171 static std::string GetImageExtentAsString(
int extent[6]);
172 static void GetImageExtentFromString(
int extent[6], std::string extentValue);
174 static std::string GetSegmentColorAsString(
vtkMRMLSegmentationNode* segmentationNode,
const std::string& segmentId);
175 static void GetSegmentColorFromString(
double color[3], std::string colorString);
178 bool CropToMinimumExtent{
false};
vtkMRMLNode * CreateNodeInstance() override=0
Create instance of the default node. Like New only virtual.
This class encapsulates a segment that is part of a segmentation.
virtual int ReadDataInternal(vtkMRMLNode *refNode)
virtual void InitializeSupportedReadFileTypes()
MRML node for segmentation storage on disk.
virtual const char * GetDefaultWriteFileExtension()
Return default file extension for writing.
void operator=(const vtkMRMLStorageNode &)
Image data containing orientation information.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object
void PrintSelf(ostream &os, vtkIndent indent) override
const char * GetNodeTagName() override
Get node XML tag name (like Storage, Model)
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
A superclass for other storage nodes.
virtual void InitializeSupportedWriteFileTypes()
virtual int WriteDataInternal(vtkMRMLNode *refNode)
Abstract Superclass for all specific types of MRML nodes.
virtual bool CanReadInReferenceNode(vtkMRMLNode *refNode)=0
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...