23 #ifndef __vtkMRMLSegmentationDisplayNode_h 24 #define __vtkMRMLSegmentationDisplayNode_h 51 double OverrideColor[3];
67 , Visible2DOutline(true)
70 , Opacity2DOutline(1.0)
72 OverrideColor[0] = SEGMENT_COLOR_NO_OVERRIDE;
73 OverrideColor[1] = SEGMENT_COLOR_NO_OVERRIDE;
74 OverrideColor[2] = SEGMENT_COLOR_NO_OVERRIDE;
86 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
91 virtual
void ReadXMLAttributes( const
char** atts) VTK_OVERRIDE;
94 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
100 virtual const
char* GetNodeTagName() VTK_OVERRIDE {
return "SegmentationDisplay"; }
105 vtkGetStringMacro(PreferredDisplayRepresentationName2D);
107 vtkSetStringMacro(PreferredDisplayRepresentationName2D);
109 vtkGetStringMacro(PreferredDisplayRepresentationName3D);
111 vtkSetStringMacro(PreferredDisplayRepresentationName3D);
114 vtkGetMacro(Visibility3D,
bool);
115 vtkSetMacro(Visibility3D,
bool);
116 vtkBooleanMacro(Visibility3D,
bool);
118 vtkGetMacro(Visibility2DFill,
bool);
119 vtkSetMacro(Visibility2DFill,
bool);
120 vtkBooleanMacro(Visibility2DFill,
bool);
122 vtkGetMacro(Visibility2DOutline,
bool);
123 vtkSetMacro(Visibility2DOutline,
bool);
124 vtkBooleanMacro(Visibility2DOutline,
bool);
127 vtkGetMacro(Opacity3D,
double);
128 vtkSetMacro(Opacity3D,
double);
130 vtkGetMacro(Opacity2DFill,
double);
131 vtkSetMacro(Opacity2DFill,
double);
133 vtkGetMacro(Opacity2DOutline,
double);
134 vtkSetMacro(Opacity2DOutline,
double);
142 bool GetSegmentDisplayProperties(std::string segmentID, SegmentDisplayProperties &properties);
145 void SetSegmentDisplayProperties(std::string segmentID, SegmentDisplayProperties &properties);
148 void SetSegmentDisplayPropertiesToDefault(
const std::string& segmentId);
151 void RemoveSegmentDisplayProperties(std::string segmentID);
154 void ClearSegmentDisplayProperties();
159 bool CalculateAutoOpacitiesForSegments();
167 void GenerateSegmentColor(
double color[3],
int colorNumber=0);
170 void GenerateSegmentColor(
double &r,
double &g,
double &b);
173 void GetPolyDataRepresentationNames(std::set<std::string> &representationNames);
180 std::string GetDisplayRepresentationName3D();
185 std::string GetDisplayRepresentationName2D();
191 vtkVector3d GetSegmentColor(std::string segmentID);
193 bool GetSegmentColor(std::string segmentID,
double* color);
195 bool GetSegmentColor(std::string segmentID,
double &r,
double &g,
double &b);
199 vtkVector3d GetSegmentOverrideColor(std::string segmentID);
205 void SetSegmentOverrideColor(std::string segmentID,
double r,
double g,
double b);
207 void SetSegmentOverrideColor(std::string segmentID, vtkVector3d overrideColor);
209 void UnsetSegmentOverrideColor(std::string segmentID);
213 bool GetSegmentVisibility(std::string segmentID);
215 void SetSegmentVisibility(std::string segmentID,
bool visible);
216 void SetAllSegmentsVisibility(
bool visible);
220 bool GetSegmentVisibility3D(std::string segmentID);
222 void SetSegmentVisibility3D(std::string segmentID,
bool visible);
223 void SetAllSegmentsVisibility3D(
bool visible,
bool changeVisibleSegmentsOnly =
false);
227 bool GetSegmentVisibility2DFill(std::string segmentID);
229 void SetSegmentVisibility2DFill(std::string segmentID,
bool visible);
230 void SetAllSegmentsVisibility2DFill(
bool visible,
bool changeVisibleSegmentsOnly =
false);
234 bool GetSegmentVisibility2DOutline(std::string segmentID);
236 void SetSegmentVisibility2DOutline(std::string segmentID,
bool visible);
237 void SetAllSegmentsVisibility2DOutline(
bool visible,
bool changeVisibleSegmentsOnly =
false);
241 double GetSegmentOpacity3D(std::string segmentID);
243 void SetSegmentOpacity3D(std::string segmentID,
double opacity);
244 void SetAllSegmentsOpacity3D(
double opacity,
bool changeVisibleSegmentsOnly =
false);
248 double GetSegmentOpacity2DFill(std::string segmentID);
250 void SetSegmentOpacity2DFill(std::string segmentID,
double opacity);
251 void SetAllSegmentsOpacity2DFill(
double opacity,
bool changeVisibleSegmentsOnly =
false);
255 double GetSegmentOpacity2DOutline(std::string segmentID);
257 void SetSegmentOpacity2DOutline(std::string segmentID,
double opacity);
258 void SetAllSegmentsOpacity2DOutline(
double opacity,
bool changeVisibleSegmentsOnly =
false);
261 void SetSegmentOpacity(std::string segmentID,
double opacity);
262 void SetAllSegmentsOpacity(
double opacity,
bool changeVisibleSegmentsOnly =
false);
265 void GetVisibleSegmentIDs(vtkStringArray* segmentIDs);
268 void GetVisibleSegmentIDs(std::vector<std::string>& segmentIDs);
272 void GetSegmentIDs(std::vector<std::string>& segmentIDs,
bool visibleSegmentsOnly);
277 void UpdateSegmentList(
bool removeUnusedDisplayProperties =
true);
SegmentDisplayPropertiesMap SegmentationDisplayProperties
double Opacity2DFill
2D fill opacity for the whole segmentation
vtkSegmentation * SegmentListUpdateSource
vtkMTimeType SegmentListUpdateTime
For checking if cached segment list in SegmentationDisplayProperties has to be updated.
bool Visibility3D
3D visibility for the whole segmentation
double Opacity3D
3D opacity for the whole segmentation
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
Display properties per segment.
SegmentDisplayProperties()
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
bool Visibility2DFill
2D fill visibility for the whole segmentation
static const double SEGMENT_COLOR_NO_OVERRIDE
unsigned int NumberOfGeneratedColors
char * PreferredDisplayRepresentationName2D
void operator=(const vtkMRMLDisplayNode &)
MRML node for representing segmentation display attributes.
double Opacity2DOutline
2D outline opacity for the whole segmentation
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
bool Visibility2DOutline
2D outline visibility for the whole segmentation
std::map< std::string, SegmentDisplayProperties > SegmentDisplayPropertiesMap
Abstract class that contains graphical display properties for displayable nodes.
char * PreferredDisplayRepresentationName3D
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent discrete color information.
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...