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;
88 virtual vtkMRMLNode* CreateNodeInstance() 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);
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);
201 void SetSegmentOverrideColor(std::string segmentID,
double r,
double g,
double b);
203 void SetSegmentOverrideColor(std::string segmentID, vtkVector3d overrideColor);
205 void UnsetSegmentOverrideColor(std::string segmentID);
209 bool GetSegmentVisibility(std::string segmentID);
211 void SetSegmentVisibility(std::string segmentID,
bool visible);
212 void SetAllSegmentsVisibility(
bool visible);
216 bool GetSegmentVisibility3D(std::string segmentID);
218 void SetSegmentVisibility3D(std::string segmentID,
bool visible);
219 void SetAllSegmentsVisibility3D(
bool visible,
bool changeVisibleSegmentsOnly =
false);
223 bool GetSegmentVisibility2DFill(std::string segmentID);
225 void SetSegmentVisibility2DFill(std::string segmentID,
bool visible);
226 void SetAllSegmentsVisibility2DFill(
bool visible,
bool changeVisibleSegmentsOnly =
false);
230 bool GetSegmentVisibility2DOutline(std::string segmentID);
232 void SetSegmentVisibility2DOutline(std::string segmentID,
bool visible);
233 void SetAllSegmentsVisibility2DOutline(
bool visible,
bool changeVisibleSegmentsOnly =
false);
237 double GetSegmentOpacity3D(std::string segmentID);
239 void SetSegmentOpacity3D(std::string segmentID,
double opacity);
240 void SetAllSegmentsOpacity3D(
double opacity,
bool changeVisibleSegmentsOnly =
false);
244 double GetSegmentOpacity2DFill(std::string segmentID);
246 void SetSegmentOpacity2DFill(std::string segmentID,
double opacity);
247 void SetAllSegmentsOpacity2DFill(
double opacity,
bool changeVisibleSegmentsOnly =
false);
251 double GetSegmentOpacity2DOutline(std::string segmentID);
253 void SetSegmentOpacity2DOutline(std::string segmentID,
double opacity);
254 void SetAllSegmentsOpacity2DOutline(
double opacity,
bool changeVisibleSegmentsOnly =
false);
257 void SetSegmentOpacity(std::string segmentID,
double opacity);
258 void SetAllSegmentsOpacity(
double opacity,
bool changeVisibleSegmentsOnly =
false);
261 void GetVisibleSegmentIDs(vtkStringArray* segmentIDs);
264 void GetVisibleSegmentIDs(std::vector<std::string>& segmentIDs);
268 void GetSegmentIDs(std::vector<std::string>& segmentIDs,
bool visibleSegmentsOnly);
272 void UpdateSegmentList();
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
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
MRML node for representing segmentation display attributes.
double Opacity2DOutline
2D outline opacity for the whole segmentation
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 ...