15#ifndef __vtkMRMLColorNode_h
16#define __vtkMRMLColorNode_h
25class vtkScalarsToColors;
46 void PrintSelf(ostream& os, vtkIndent indent)
override;
58 void WriteXML(ostream& of,
int indent)
override;
162 std::string categoryCodingScheme, std::string categoryCodeValue, std::string categoryCodeMeaning,
163 std::string typeCodingScheme, std::string typeCodeValue, std::string typeCodeMeaning,
164 std::string typeModifierCodingScheme=
"", std::string typeModifierCodeValue=
"", std::string typeModifierCodeMeaning=
"",
165 std::string regionCodingScheme=
"", std::string regionCodeValue=
"", std::string regionCodeMeaning=
"",
166 std::string regionModifierCodingScheme=
"", std::string regionModifierCodeValue=
"", std::string regionModifierCodeMeaning=
"");
183 virtual bool GetColor(
int ind,
double color[4]) = 0;
200 vtkWarningMacro(
"GetNoName() method is deprecated use GetColorDefined() and SetColorDefined() methods instead");
208 vtkErrorMacro(
"SetNoName() method is deprecated use GetColorDefined() and SetColorDefined() methods instead");
219 vtkErrorMacro(
"NamesInitialisedOn() method is deprecated and has no effect and no longer necessary.");
223 vtkErrorMacro(
"NamesInitialisedOff() method is deprecated and has no effect and no longer necessary.");
227 vtkErrorMacro(
"SetNamesInitialised() method is deprecated and has no effect. Use SetColorName() and SetColorDefined() methods instead.");
231 vtkErrorMacro(
"GetNamesInitialised() method is deprecated. Use SetColorName() and SetColorDefined() methods to set and unset color names.");
279 vtkSmartPointer<vtkCodedEntry>
Type;
286 this->Name = source.
Name;
288 this->Type = source.
Type;
290 this->Region = source.
Region;
297 this->Category =
nullptr;
298 this->Type =
nullptr;
299 this->TypeModifier =
nullptr;
300 this->Region =
nullptr;
301 this->RegionModifier =
nullptr;
306 this->Name == other.
Name &&
315 return !(*
this == other);
Simple class for storing standard coded entries (coding scheme, value, meaning triplets)
static bool AreEqual(vtkCodedEntry *entry1, vtkCodedEntry *entry2)
Returns true if the two coded entries have the same content.
virtual vtkLookupTable * GetLookupTable()
Most color nodes will implement a look up table, so provide a top level get method.
static std::string GetTerminologyAsString(std::string terminologyContextName, vtkCodedEntry *category, vtkCodedEntry *type, vtkCodedEntry *typeModifier, std::string regionContextName="", vtkCodedEntry *region=nullptr, vtkCodedEntry *regionModifier=nullptr)
Convert coded entries to a string.
vtkCodedEntry * GetTerminologyRegion(int ind)
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Propagate events generated in mrml.
void ReadXMLAttributes(const char **atts) override
MRMLNode methods.
vtkMRMLCopyContentMacro(vtkMRMLColorNode)
vtkCodedEntry * GetTerminologyRegionModifier(int ind)
virtual void SetType(int type)
Set Type to type, then build colors and set names.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void SetContainsTerminology(bool containsTerminology)
Sets whether the color table has terminology information.
const char * GetContainsTerminologyAttributeName()
Get attribute name that indicates if the color table has terminology entries.
void SetNamesInitialised(int)
void operator=(const vtkMRMLColorNode &)
virtual vtkLookupTable * CreateLookupTableCopy()
vtkCodedEntry * GetTerminologyCategory(int ind)
Get terminology information for a color entry.
vtkMRMLColorNode(const vtkMRMLColorNode &)
bool SetTerminologyFromString(int ind, std::string terminologyString)
const char * GetColorName(int ind)
std::string GetColorNameWithoutSpaces(int ind, const char *subst)
void PrintSelf(ostream &os, vtkIndent indent) override
vtkCodedEntry * GetTerminologyTypeModifier(int ind)
void NamesInitialisedOn()
void Reset(vtkMRMLNode *defaultNode) override
void SetColorDefined(int ind, bool defined)
Set the color defined flag for the given entry.
void SetNoName(const char *)
std::vector< PropertyType > Properties
Vector of names and other properties for the color table elements.
virtual const char * GetTypeAsString()
Return a text string describing the color look up table type.
int GetColorIndexByName(const char *name)
void UpdateScene(vtkMRMLScene *scene) override
int SetColorName(int ind, const char *name)
int GetNamesInitialised(int)
virtual int GetNumberOfColors()=0
Get the number of colors in the table.
virtual bool SetNameFromColor(int index)
Set values in the names vector from the colors in the node.
vtkCodedEntry * GetTerminologyType(int ind)
bool GetColorDefined(int ind)
Returns true if the entry is defined.
std::string GetTerminologyAsString(int ind)
std::string GetColorNameAsFileName(int colorIndex, const char *subst="_")
bool GetModifiedSinceRead() override
bool GetContainsTerminology()
Returns true if the color table has terminology information.
void NamesInitialisedOff()
virtual int GetFirstType()
bool SetTerminology(int ind, std::string categoryCodingScheme, std::string categoryCodeValue, std::string categoryCodeMeaning, std::string typeCodingScheme, std::string typeCodeValue, std::string typeCodeMeaning, std::string typeModifierCodingScheme="", std::string typeModifierCodeValue="", std::string typeModifierCodeMeaning="", std::string regionCodingScheme="", std::string regionCodeValue="", std::string regionCodeMeaning="", std::string regionModifierCodingScheme="", std::string regionModifierCodeValue="", std::string regionModifierCodeMeaning="")
virtual vtkScalarsToColors * GetScalarsToColors()
~vtkMRMLColorNode() override
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
virtual bool GetColor(int ind, double color[4])=0
bool GetProperty(int ind, PropertyType &prop)
int SetColorNameWithSpaces(int ind, const char *name, const char *subst)
void SetNamesFromColors()
virtual int GetLastType()
friend class vtkMRMLScene
bool operator!=(const PropertyType &other) const
void DeepCopy(PropertyType &source)
vtkSmartPointer< vtkCodedEntry > Region
vtkSmartPointer< vtkCodedEntry > Category
bool operator==(const PropertyType &other) const
vtkSmartPointer< vtkCodedEntry > RegionModifier
vtkSmartPointer< vtkCodedEntry > TypeModifier
vtkSmartPointer< vtkCodedEntry > Type