Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkSlicerTerminologiesModuleLogic Class Reference

#include <Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.h>

Inheritance diagram for vtkSlicerTerminologiesModuleLogic:
Collaboration diagram for vtkSlicerTerminologiesModuleLogic:

Classes

class  CodeIdentifier
 Information needed to uniquely identify a terminology code. More...
 

Public Types

typedef vtkSlicerModuleLogic Superclass
 
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

bool FindCategoriesInTerminology (std::string terminologyName, std::vector< CodeIdentifier > &categories, std::string search)
 
std::vector< std::string > FindColorNodes (std::string categoryCodingSchemeDesignator, std::string categoryCodeValue, std::string typeCodingSchemeDesignator, std::string typeCodeValue, std::string typeModifierCodingSchemeDesignator, std::string typeModifierCodeValue, std::string regionCodingSchemeDesignator, std::string regionCodeValue, std::string regionModifierCodingSchemeDesignator, std::string regionModifierCodeValue, std::vector< std::string > preferredColorNodeNames, vtkIntArray *foundColorIndices=nullptr, vtkIntArray *foundPreferredColorNodeIndices=nullptr)
 
bool FindFirstColorNodeOrTerminology (std::string categoryCodingSchemeDesignator, std::string categoryCodeValue, std::string typeCodingSchemeDesignator, std::string typeCodeValue, std::string typeModifierCodingSchemeDesignator, std::string typeModifierCodeValue, std::string regionCodingSchemeDesignator, std::string regionCodeValue, std::string regionModifierCodingSchemeDesignator, std::string regionModifierCodeValue, std::vector< std::string > preferredTerminologyNames, std::string &foundTerminologyName, std::string &foundColorNodeID, int &foundColorIndex)
 
bool FindFirstColorNodeOrTerminology (vtkSlicerTerminologyEntry *entry, std::vector< std::string > preferredTerminologyNames, std::string &foundTerminologyName, std::string &foundColorNodeID, int &foundColorIndex)
 
std::vector< std::string > FindRegionContextNames (std::string regionCodingSchemeDesignator, std::string regionCodeValue, std::string regionModifierCodingSchemeDesignator, std::string regionModifierCodeValue, std::vector< std::string > preferredRegionContextNames, vtkCollection *foundEntries=nullptr)
 
bool FindRegionsInRegionContext (std::string regionContextName, std::vector< CodeIdentifier > &regions, std::string search)
 
std::vector< std::string > FindTerminologyNames (std::string categoryCodingSchemeDesignator, std::string categoryCodeValue, std::string typeCodingSchemeDesignator, std::string typeCodeValue, std::string typeModifierCodingSchemeDesignator, std::string typeModifierCodeValue, std::vector< std::string > preferredTerminologyNames, vtkCollection *foundEntries=nullptr, vtkIntArray *foundPreferredTerminologyNameIndices=nullptr)
 
bool FindTypeInTerminologyBy3dSlicerLabel (std::string terminologyName, std::string slicerLabel, vtkSlicerTerminologyEntry *entry)
 
bool FindTypesInTerminologyCategory (std::string terminologyName, CodeIdentifier categoryId, std::vector< CodeIdentifier > &types, std::string search, std::vector< vtkSmartPointer< vtkSlicerTerminologyType > > *typeObjects=nullptr)
 
bool GetCategoriesInTerminology (std::string terminologyName, std::vector< CodeIdentifier > &categories)
 
bool GetCategoryInTerminology (std::string terminologyName, CodeIdentifier categoryId, vtkSlicerTerminologyCategory *categoryObject)
 
virtual const char * GetClassName ()
 
std::vector< std::string > GetCompatibleColorNodeIDs ()
 Get list of color node IDs that contain terminology information.
 
vtkMRMLColorNodeGetFirstCompatibleColorNodeByName (std::string name)
 Return the first compatible color node that has a matching name.
 
void GetLoadedRegionContextNames (std::vector< std::string > &regionContextNames)
 Get context names of loaded region contexts.
 
void GetLoadedRegionContextNames (vtkStringArray *regionContextNames)
 Python accessor variant of.
 
void GetLoadedTerminologyNames (std::vector< std::string > &terminologyNames)
 Get context names of loaded terminologies.
 
void GetLoadedTerminologyNames (vtkStringArray *terminologyNames)
 Python accessor variant of.
 
bool GetNthCategoryInTerminology (std::string terminologyName, int categoryIndex, vtkSlicerTerminologyCategory *category)
 
bool GetNthRegionInRegionContext (std::string regionContextName, int regionIndex, vtkSlicerTerminologyType *regionObject)
 
bool GetNthRegionModifierInRegion (std::string regionContextName, vtkSlicerTerminologyType *regionObject, int regionModifierIndex, vtkSlicerTerminologyType *regionModifier)
 
bool GetNthTypeInTerminologyCategory (std::string terminologyName, vtkSlicerTerminologyCategory *category, int typeIndex, vtkSlicerTerminologyType *type)
 
bool GetNthTypeModifierInTerminologyType (std::string terminologyName, vtkSlicerTerminologyCategory *category, vtkSlicerTerminologyType *type, int typeModifierIndex, vtkSlicerTerminologyType *typeModifier)
 
int GetNumberOfCategoriesInTerminology (std::string terminologyName)
 Get number of categories in a terminology.
 
int GetNumberOfRegionModifierInRegion (std::string regionContextName, vtkSlicerTerminologyType *regionObject)
 
int GetNumberOfRegionsInRegionContext (std::string regionContextName)
 
int GetNumberOfTypeModifiersInTerminologyType (std::string terminologyName, vtkSlicerTerminologyCategory *category, vtkSlicerTerminologyType *type)
 Get number of type modifiers for the chosen category and type in a terminology.
 
int GetNumberOfTypesInTerminologyCategory (std::string terminologyName, vtkSlicerTerminologyCategory *category)
 Get number of types in the chosen category in a terminology.
 
bool GetRegionInRegionContext (std::string regionContextName, CodeIdentifier regionId, vtkSlicerTerminologyType *regionObject)
 
bool GetRegionModifierInRegion (std::string regionContextName, CodeIdentifier regionId, CodeIdentifier modifierId, vtkSlicerTerminologyType *regionModifier)
 
bool GetRegionModifiersInRegion (std::string regionContextName, CodeIdentifier regionId, std::vector< CodeIdentifier > &regionModifiers)
 
bool GetRegionsInRegionContext (std::string regionContextName, std::vector< CodeIdentifier > &regions)
 
bool GetTypeInTerminologyCategory (std::string terminologyName, CodeIdentifier categoryId, CodeIdentifier typeId, vtkSlicerTerminologyType *typeObject)
 
bool GetTypeModifierInTerminologyType (std::string terminologyName, CodeIdentifier categoryId, CodeIdentifier typeId, CodeIdentifier modifierId, vtkSlicerTerminologyType *typeModifier)
 
bool GetTypeModifiersInTerminologyType (std::string terminologyName, CodeIdentifier categoryId, CodeIdentifier typeId, std::vector< CodeIdentifier > &typeModifiers)
 
bool GetTypesInTerminologyCategory (std::string terminologyName, CodeIdentifier categoryId, std::vector< CodeIdentifier > &types)
 
virtual char * GetUserContextsPath ()
 
virtual int IsA (const char *type)
 
bool IsTerminologyContextLoaded (std::string terminologyName)
 Returns true if the terminology name is loaded.
 
bool LoadContextFromFile (std::string filePath)
 
std::string LoadRegionContextFromFile (std::string filePath)
 
bool LoadRegionContextFromSegmentDescriptorFile (std::string contextName, std::string filePath)
 
std::string LoadTerminologyFromFile (std::string filePath)
 
bool LoadTerminologyFromSegmentDescriptorFile (std::string contextName, std::string filePath)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetUserContextsPath (const char *)
 
bool UpdateEntryFromLoadedTerminologies (vtkSlicerTerminologyEntry *entry, std::vector< std::string > preferredTerminologyNames, std::vector< std::string > preferredRegionContextNames)
 
bool AreSegmentTerminologyEntriesEqual (vtkSegment *segment1, vtkSegment *segment2)
 
bool AreTerminologyEntriesEqual (vtkSlicerTerminologyEntry *entry1, vtkSlicerTerminologyEntry *entry2)
 
bool AreTerminologyEntriesEqual (std::string terminologyEntry1, std::string terminologyEntry2)
 
bool AreCodedEntriesEqual (vtkCodedEntry *codedEntry1, vtkCodedEntry *codedEntry2)
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state.
 
virtual vtkMRMLAbstractLogicGetModuleLogic (const char *moduleName)
 Convenience method for getting another module's logic from the application logic.
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetModuleShareDirectory (const std::string &shareDirectory)
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state.
 
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene.
 

Static Public Member Functions

static bool AreCodedEntriesExactMatch (vtkCodedEntry *codedEntry1, vtkCodedEntry *codedEntry2)
 
static bool DeserializeTerminologyEntry (std::string serializedEntry, vtkSlicerTerminologyEntry *entry)
 
static CodeIdentifier GetCodeIdentifierFromCodedEntry (vtkCodedEntry *entry)
 Convert terminology category, type, etc. object to code identifier.
 
static const char * GetColorAutoGeneratedAttributeName ()
 Node attribute name for color auto generated.
 
static int GetColorIndexByTerminology (vtkMRMLColorNode *colorNode, const std::string &terminologyStr, bool ignoreContextName=true)
 
static bool GetDefaultTerminologyEntry (vtkMRMLNode *node, vtkSlicerTerminologyEntry *entry)
 
static std::string GetDefaultTerminologyEntryAsString (vtkMRMLNode *node)
 
static const char * GetDefaultTerminologyEntryAttributeName ()
 
static std::string GetInfoStringFromTerminologyEntry (vtkSlicerTerminologyEntry *entry)
 Assemble human readable info string from a terminology entry, for example for tooltips.
 
static const char * GetNameAutoGeneratedAttributeName ()
 Node attribute name for name auto generated.
 
static bool GetTerminologyEntry (vtkMRMLNode *node, vtkSlicerTerminologyEntry *entry)
 
static std::string GetTerminologyEntryAsString (vtkMRMLNode *node)
 
static const char * GetTerminologyEntryAttributeName ()
 Terminology entry (serialized to string)
 
static int IsTypeOf (const char *type)
 
static vtkSlicerTerminologiesModuleLogicNew ()
 
static vtkSlicerTerminologiesModuleLogicSafeDownCast (vtkObject *o)
 
static std::string SerializeTerminologyEntry (std::string terminologyContextName, std::string categoryValue, std::string categorySchemeDesignator, std::string categoryMeaning, std::string typeValue, std::string typeSchemeDesignator, std::string typeMeaning, std::string modifierValue, std::string modifierSchemeDesignator, std::string modifierMeaning, std::string regionContextName, std::string regionValue, std::string regionSchemeDesignator, std::string regionMeaning, std::string regionModifierValue, std::string regionModifierSchemeDesignator, std::string regionModifierMeaning)
 
static std::string SerializeTerminologyEntry (vtkSlicerTerminologyEntry *entry)
 
static void SetDefaultTerminologyEntry (vtkMRMLNode *node, vtkSlicerTerminologyEntry *entry)
 
static void SetDefaultTerminologyEntryAsString (vtkMRMLNode *node, std::string entryStr)
 
static void SetTerminologyEntry (vtkMRMLNode *node, vtkSlicerTerminologyEntry *entry)
 
static void SetTerminologyEntryAsString (vtkMRMLNode *node, std::string entryStr)
 
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
 
static vtkSlicerModuleLogicNew ()
 The Usual vtk class functions.
 
static vtkSlicerModuleLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Protected Member Functions

void LoadDefaultRegionContexts ()
 Load default region context dictionaries from JSON into.
 
void LoadDefaultTerminologies ()
 Load default terminology dictionaries from JSON into.
 
void LoadUserContexts ()
 Load terminologies and region contexts from the user settings directory.
 
void SetMRMLSceneInternal (vtkMRMLScene *newScene) override
 
 vtkSlicerTerminologiesModuleLogic ()
 
 ~vtkSlicerTerminologiesModuleLogic () override
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
 ~vtkSlicerModuleLogic () override
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManagerGetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManagerGetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManagerGetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any.
 
int InvokePendingModifiedEvent ()
 
void Modified () override
 
virtual void ObserveMRMLScene ()
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneNodeAdded (vtkMRMLNode *)
 
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *)
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void RegisterNodes ()
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
virtual void UpdateFromMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Protected Attributes

char * UserContextsPath {nullptr}
 The path from which the json files are automatically loaded on startup.
 

Friends

class vtkInternal
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics.
 
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes.
 
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Detailed Description

Definition at line 39 of file vtkSlicerTerminologiesModuleLogic.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkSlicerTerminologiesModuleLogic()

vtkSlicerTerminologiesModuleLogic::vtkSlicerTerminologiesModuleLogic ( )
protected

◆ ~vtkSlicerTerminologiesModuleLogic()

vtkSlicerTerminologiesModuleLogic::~vtkSlicerTerminologiesModuleLogic ( )
overrideprotected

Member Function Documentation

◆ AreCodedEntriesEqual()

bool vtkSlicerTerminologiesModuleLogic::AreCodedEntriesEqual ( vtkCodedEntry * codedEntry1,
vtkCodedEntry * codedEntry2 )

◆ AreCodedEntriesExactMatch()

static bool vtkSlicerTerminologiesModuleLogic::AreCodedEntriesExactMatch ( vtkCodedEntry * codedEntry1,
vtkCodedEntry * codedEntry2 )
static

Compare two terminology entries for exact equality.

Returns
True if the entries are equal, false otherwise.

◆ AreSegmentTerminologyEntriesEqual()

bool vtkSlicerTerminologiesModuleLogic::AreSegmentTerminologyEntriesEqual ( vtkSegment * segment1,
vtkSegment * segment2 )

Compare two terminology entries for equality.

Returns
True if the entries are equal, false otherwise.

◆ AreTerminologyEntriesEqual() [1/2]

bool vtkSlicerTerminologiesModuleLogic::AreTerminologyEntriesEqual ( std::string terminologyEntry1,
std::string terminologyEntry2 )

◆ AreTerminologyEntriesEqual() [2/2]

bool vtkSlicerTerminologiesModuleLogic::AreTerminologyEntriesEqual ( vtkSlicerTerminologyEntry * entry1,
vtkSlicerTerminologyEntry * entry2 )

◆ DeserializeTerminologyEntry()

static bool vtkSlicerTerminologiesModuleLogic::DeserializeTerminologyEntry ( std::string serializedEntry,
vtkSlicerTerminologyEntry * entry )
static

Populate terminology entry VTK object based on serialized entry Serialized terminology entry consists of the following: terminologyContextName, category (codingScheme, codeValue, codeMeaning triple), type, typeModifier, regionContextName, region, regionModifier

Returns
Success flag

◆ FindCategoriesInTerminology()

bool vtkSlicerTerminologiesModuleLogic::FindCategoriesInTerminology ( std::string terminologyName,
std::vector< CodeIdentifier > & categories,
std::string search )

Find category names (codeMeaning) in terminology containing a given string

Parameters
categoriesOutput argument containing all the
See also
vtkSlicerTerminologyCategory objects created from the categories found in the given terminology
Returns
Success flag

◆ FindColorNodes()

std::vector< std::string > vtkSlicerTerminologiesModuleLogic::FindColorNodes ( std::string categoryCodingSchemeDesignator,
std::string categoryCodeValue,
std::string typeCodingSchemeDesignator,
std::string typeCodeValue,
std::string typeModifierCodingSchemeDesignator,
std::string typeModifierCodeValue,
std::string regionCodingSchemeDesignator,
std::string regionCodeValue,
std::string regionModifierCodingSchemeDesignator,
std::string regionModifierCodeValue,
std::vector< std::string > preferredColorNodeNames,
vtkIntArray * foundColorIndices = nullptr,
vtkIntArray * foundPreferredColorNodeIndices = nullptr )

Return collection of color node IDs designated by the given codes.

Parameters
preferredTerminologyNamesList of terminology names in order of preference. If an empty list is provided then all terminologies are searched.
foundColorIndicesif specified then it will contain the indices of the found colors in the color table.
foundPreferredColorNodeIndicesif specified then it will contain the indices of the found color nodes in the preferredColorNodeNames list.

◆ FindFirstColorNodeOrTerminology() [1/2]

bool vtkSlicerTerminologiesModuleLogic::FindFirstColorNodeOrTerminology ( std::string categoryCodingSchemeDesignator,
std::string categoryCodeValue,
std::string typeCodingSchemeDesignator,
std::string typeCodeValue,
std::string typeModifierCodingSchemeDesignator,
std::string typeModifierCodeValue,
std::string regionCodingSchemeDesignator,
std::string regionCodeValue,
std::string regionModifierCodingSchemeDesignator,
std::string regionModifierCodeValue,
std::vector< std::string > preferredTerminologyNames,
std::string & foundTerminologyName,
std::string & foundColorNodeID,
int & foundColorIndex )

Find the best fitting color node or terminology

Parameters
preferredTerminologyNamesList of terminology names in order of preference. If an empty list is provided then all terminologies are searched.
foundTerminologyNamefound terminology name (color node name in case a color node was found)
foundColorNodeIDfound color node ID (empty if terminology was found)
foundColorIndexfound color index in the color node (-1 if color was not found in the table)

◆ FindFirstColorNodeOrTerminology() [2/2]

bool vtkSlicerTerminologiesModuleLogic::FindFirstColorNodeOrTerminology ( vtkSlicerTerminologyEntry * entry,
std::vector< std::string > preferredTerminologyNames,
std::string & foundTerminologyName,
std::string & foundColorNodeID,
int & foundColorIndex )

Find the best fitting color node or terminology

Parameters
preferredTerminologyNamesList of terminology names in order of preference. If an empty list is provided then all terminologies are searched.
foundTerminologyNamefound terminology name (color node name in case a color node was found)
foundColorNodeIDfound color node ID (empty if terminology was found)
foundColorIndexfound color index in the color node (-1 if color was not found in the table)

◆ FindRegionContextNames()

std::vector< std::string > vtkSlicerTerminologiesModuleLogic::FindRegionContextNames ( std::string regionCodingSchemeDesignator,
std::string regionCodeValue,
std::string regionModifierCodingSchemeDesignator,
std::string regionModifierCodeValue,
std::vector< std::string > preferredRegionContextNames,
vtkCollection * foundEntries = nullptr )

Return list of region context names containing the specified region.

Parameters
preferredRegionContextNamesList of region context names in order of preference. If an empty list is provided then all context are searched.

◆ FindRegionsInRegionContext()

bool vtkSlicerTerminologiesModuleLogic::FindRegionsInRegionContext ( std::string regionContextName,
std::vector< CodeIdentifier > & regions,
std::string search )

Get all region names (codeMeaning) in an context

Returns
Success flag

◆ FindTerminologyNames()

std::vector< std::string > vtkSlicerTerminologiesModuleLogic::FindTerminologyNames ( std::string categoryCodingSchemeDesignator,
std::string categoryCodeValue,
std::string typeCodingSchemeDesignator,
std::string typeCodeValue,
std::string typeModifierCodingSchemeDesignator,
std::string typeModifierCodeValue,
std::vector< std::string > preferredTerminologyNames,
vtkCollection * foundEntries = nullptr,
vtkIntArray * foundPreferredTerminologyNameIndices = nullptr )

Return collection of vtkSlicerTerminologyEntry objects designated by the given codes.

Parameters
preferredTerminologyNamesList of terminology names in order of preference. If an empty list is provided then all terminologies are searched.
foundEntriesif specified then it will contain the found terminology entries.
foundPreferredColorNodeIndicesif specified then it will contain the indices of the found terminologies in the in the preferredTerminologyNames list.

◆ FindTypeInTerminologyBy3dSlicerLabel()

bool vtkSlicerTerminologiesModuleLogic::FindTypeInTerminologyBy3dSlicerLabel ( std::string terminologyName,
std::string slicerLabel,
vtkSlicerTerminologyEntry * entry )

Find terminology type or type modifier based on '3dSlicerLabel' attribute

Parameters
terminologyNameTerminology context in which the attribute is looked for
slicerLabelAttribute to look for
entryTerminology entry populated if the attribute is found
Returns
Flag indicating whether the attribute was found

◆ FindTypesInTerminologyCategory()

bool vtkSlicerTerminologiesModuleLogic::FindTypesInTerminologyCategory ( std::string terminologyName,
CodeIdentifier categoryId,
std::vector< CodeIdentifier > & types,
std::string search,
std::vector< vtkSmartPointer< vtkSlicerTerminologyType > > * typeObjects = nullptr )

Get terminology types from a terminology category as collection of

See also
vtkSlicerTerminologyType container objects
Parameters
typesOutput argument containing all the
See also
type IDs in the category. from the types found in the given terminology category
Parameters
typeObjectsOutput argument containing all the
See also
type objects in the category.. This is useful if type objects need to be retrieved for a large number of types, because it avoids the need to do a costly search in the json tree.
Returns
Success flag

◆ GetCategoriesInTerminology()

bool vtkSlicerTerminologiesModuleLogic::GetCategoriesInTerminology ( std::string terminologyName,
std::vector< CodeIdentifier > & categories )

Get terminology categories from a terminology as collection of

See also
vtkSlicerTerminologyCategory container objects
Parameters
categoriesOutput argument containing all the
See also
vtkSlicerTerminologyCategory objects created from the categories found in the given terminology
Returns
Success flag

◆ GetCategoryInTerminology()

bool vtkSlicerTerminologiesModuleLogic::GetCategoryInTerminology ( std::string terminologyName,
CodeIdentifier categoryId,
vtkSlicerTerminologyCategory * categoryObject )

Get a category with given name from a terminology

Parameters
categoryOutput argument containing the details of the found category if any (if return value is true)
Returns
Success flag

◆ GetClassName()

virtual const char * vtkSlicerTerminologiesModuleLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetCodeIdentifierFromCodedEntry()

static CodeIdentifier vtkSlicerTerminologiesModuleLogic::GetCodeIdentifierFromCodedEntry ( vtkCodedEntry * entry)
static

Convert terminology category, type, etc. object to code identifier.

◆ GetColorAutoGeneratedAttributeName()

static const char * vtkSlicerTerminologiesModuleLogic::GetColorAutoGeneratedAttributeName ( )
inlinestatic

Node attribute name for color auto generated.

Definition at line 70 of file vtkSlicerTerminologiesModuleLogic.h.

◆ GetColorIndexByTerminology()

static int vtkSlicerTerminologiesModuleLogic::GetColorIndexByTerminology ( vtkMRMLColorNode * colorNode,
const std::string & terminologyStr,
bool ignoreContextName = true )
static

Return the index of the first color that matches the provided terminology. For matching, the category, type, type modifier, region, region modifier codes have to be equal. Coding scheme designator and code value must match, code meaning is ignored. Terminology and region context names are taken into account depending on ignoreContextName parameter.

Parameters
colorNodeThe color node to search for the terminology entry.
terminologyStrThe string representation of the searched terminology entry.
ignoreContextNameOnly consider the category, type, etc. coded entries if true, otherwise look for exact match in the terminology context name as well. True by default.
Returns
Index of the first match in the color table, -1 if no matching color entry is found.

◆ GetCompatibleColorNodeIDs()

std::vector< std::string > vtkSlicerTerminologiesModuleLogic::GetCompatibleColorNodeIDs ( )

Get list of color node IDs that contain terminology information.

◆ GetDefaultTerminologyEntry()

static bool vtkSlicerTerminologiesModuleLogic::GetDefaultTerminologyEntry ( vtkMRMLNode * node,
vtkSlicerTerminologyEntry * entry )
static

◆ GetDefaultTerminologyEntryAsString()

static std::string vtkSlicerTerminologiesModuleLogic::GetDefaultTerminologyEntryAsString ( vtkMRMLNode * node)
static

◆ GetDefaultTerminologyEntryAttributeName()

static const char * vtkSlicerTerminologiesModuleLogic::GetDefaultTerminologyEntryAttributeName ( )
inlinestatic

Terminology entry (serialized to string) to be used as default when specifying terminology code for the node. It can be incomplete (e.g., it is valid to specify just the context name).

Definition at line 75 of file vtkSlicerTerminologiesModuleLogic.h.

◆ GetFirstCompatibleColorNodeByName()

vtkMRMLColorNode * vtkSlicerTerminologiesModuleLogic::GetFirstCompatibleColorNodeByName ( std::string name)

Return the first compatible color node that has a matching name.

◆ GetInfoStringFromTerminologyEntry()

static std::string vtkSlicerTerminologiesModuleLogic::GetInfoStringFromTerminologyEntry ( vtkSlicerTerminologyEntry * entry)
static

Assemble human readable info string from a terminology entry, for example for tooltips.

◆ GetLoadedRegionContextNames() [1/2]

void vtkSlicerTerminologiesModuleLogic::GetLoadedRegionContextNames ( std::vector< std::string > & regionContextNames)

Get context names of loaded region contexts.

◆ GetLoadedRegionContextNames() [2/2]

void vtkSlicerTerminologiesModuleLogic::GetLoadedRegionContextNames ( vtkStringArray * regionContextNames)

Python accessor variant of.

See also
GetLoadedRegionContextNames

◆ GetLoadedTerminologyNames() [1/2]

void vtkSlicerTerminologiesModuleLogic::GetLoadedTerminologyNames ( std::vector< std::string > & terminologyNames)

Get context names of loaded terminologies.

◆ GetLoadedTerminologyNames() [2/2]

void vtkSlicerTerminologiesModuleLogic::GetLoadedTerminologyNames ( vtkStringArray * terminologyNames)

Python accessor variant of.

See also
GetLoadedTerminologyNames

◆ GetNameAutoGeneratedAttributeName()

static const char * vtkSlicerTerminologiesModuleLogic::GetNameAutoGeneratedAttributeName ( )
inlinestatic

Node attribute name for name auto generated.

Definition at line 68 of file vtkSlicerTerminologiesModuleLogic.h.

◆ GetNthCategoryInTerminology()

bool vtkSlicerTerminologiesModuleLogic::GetNthCategoryInTerminology ( std::string terminologyName,
int categoryIndex,
vtkSlicerTerminologyCategory * category )

Get a category from a terminology by index.

Parameters
categoryIndexspecifies which category to return
categorycategory is returned in this object
Returns
Success flag

◆ GetNthRegionInRegionContext()

bool vtkSlicerTerminologiesModuleLogic::GetNthRegionInRegionContext ( std::string regionContextName,
int regionIndex,
vtkSlicerTerminologyType * regionObject )

Get region by index. Allows iterating through all regions in Python.

Parameters
regionContextNameregion context name
regionIndexindex of region to return, must be between 0 and GetNumberOfRegionsInRegionContext(...)-1
regionObjectfound region
Returns
Success flag

◆ GetNthRegionModifierInRegion()

bool vtkSlicerTerminologiesModuleLogic::GetNthRegionModifierInRegion ( std::string regionContextName,
vtkSlicerTerminologyType * regionObject,
int regionModifierIndex,
vtkSlicerTerminologyType * regionModifier )

Get region by index. Allows iterating through region modifiers in Python.

Parameters
regionContextNameregion context name
regionObjectregion
regionModifierIndexindex of region to return, must be between 0 and GetNumberOfRegionsInRegionContext(...)-1
regionModifierfound region modifier object
Returns
Success flag

◆ GetNthTypeInTerminologyCategory()

bool vtkSlicerTerminologiesModuleLogic::GetNthTypeInTerminologyCategory ( std::string terminologyName,
vtkSlicerTerminologyCategory * category,
int typeIndex,
vtkSlicerTerminologyType * type )

Get a terminology type by index

Parameters
terminologyNameinput terminology name
categoryinput category
typeIndexindex of type to return
typeObjectoutput type
Returns
Success flag

◆ GetNthTypeModifierInTerminologyType()

bool vtkSlicerTerminologiesModuleLogic::GetNthTypeModifierInTerminologyType ( std::string terminologyName,
vtkSlicerTerminologyCategory * category,
vtkSlicerTerminologyType * type,
int typeModifierIndex,
vtkSlicerTerminologyType * typeModifier )

Get a terminology type by index

Parameters
terminologyNameinput terminology name
categoryinput category
typeObjectinput type
typeModifierIndexindex of type modifier to return
typeModifieroutput type modifier
Returns
Success flag

◆ GetNumberOfCategoriesInTerminology()

int vtkSlicerTerminologiesModuleLogic::GetNumberOfCategoriesInTerminology ( std::string terminologyName)

Get number of categories in a terminology.

◆ GetNumberOfRegionModifierInRegion()

int vtkSlicerTerminologiesModuleLogic::GetNumberOfRegionModifierInRegion ( std::string regionContextName,
vtkSlicerTerminologyType * regionObject )

Get number of regions in region context. Allows iterating through region modifiers in Python.

◆ GetNumberOfRegionsInRegionContext()

int vtkSlicerTerminologiesModuleLogic::GetNumberOfRegionsInRegionContext ( std::string regionContextName)

Get number of regions in region context. Allows iterating through all regions in Python.

◆ GetNumberOfTypeModifiersInTerminologyType()

int vtkSlicerTerminologiesModuleLogic::GetNumberOfTypeModifiersInTerminologyType ( std::string terminologyName,
vtkSlicerTerminologyCategory * category,
vtkSlicerTerminologyType * type )

Get number of type modifiers for the chosen category and type in a terminology.

◆ GetNumberOfTypesInTerminologyCategory()

int vtkSlicerTerminologiesModuleLogic::GetNumberOfTypesInTerminologyCategory ( std::string terminologyName,
vtkSlicerTerminologyCategory * category )

Get number of types in the chosen category in a terminology.

◆ GetRegionInRegionContext()

bool vtkSlicerTerminologiesModuleLogic::GetRegionInRegionContext ( std::string regionContextName,
CodeIdentifier regionId,
vtkSlicerTerminologyType * regionObject )

Get a region with given name from a region context

Parameters
regionOutput argument containing the details of the found region if any (if return value is true)
Returns
Success flag

◆ GetRegionModifierInRegion()

bool vtkSlicerTerminologiesModuleLogic::GetRegionModifierInRegion ( std::string regionContextName,
CodeIdentifier regionId,
CodeIdentifier modifierId,
vtkSlicerTerminologyType * regionModifier )

Get a region modifier with given name from a region

Parameters
regionModifierOutput argument containing the details of the found region modifier if any (if return value is true)
Returns
Success flag

◆ GetRegionModifiersInRegion()

bool vtkSlicerTerminologiesModuleLogic::GetRegionModifiersInRegion ( std::string regionContextName,
CodeIdentifier regionId,
std::vector< CodeIdentifier > & regionModifiers )

Get region modifiers from a region as collection of

See also
vtkSlicerTerminologyType container objects
Parameters
regionModifierCollectionOutput argument containing all the
See also
vtkSlicerTerminologyType objects created from the region modifiers found in the given region
Returns
Success flag

◆ GetRegionsInRegionContext()

bool vtkSlicerTerminologiesModuleLogic::GetRegionsInRegionContext ( std::string regionContextName,
std::vector< CodeIdentifier > & regions )

Get regions from an region context as collection of

See also
vtkSlicerTerminologyType container objects
Parameters
regionCollectionOutput argument containing all the
See also
vtkSlicerTerminologyType objects created from the regions found in the given region context
Returns
Success flag

◆ GetTerminologyEntry()

static bool vtkSlicerTerminologiesModuleLogic::GetTerminologyEntry ( vtkMRMLNode * node,
vtkSlicerTerminologyEntry * entry )
static

◆ GetTerminologyEntryAsString()

static std::string vtkSlicerTerminologiesModuleLogic::GetTerminologyEntryAsString ( vtkMRMLNode * node)
static

◆ GetTerminologyEntryAttributeName()

static const char * vtkSlicerTerminologiesModuleLogic::GetTerminologyEntryAttributeName ( )
inlinestatic

Terminology entry (serialized to string)

Definition at line 72 of file vtkSlicerTerminologiesModuleLogic.h.

◆ GetTypeInTerminologyCategory()

bool vtkSlicerTerminologiesModuleLogic::GetTypeInTerminologyCategory ( std::string terminologyName,
CodeIdentifier categoryId,
CodeIdentifier typeId,
vtkSlicerTerminologyType * typeObject )

Get a type with given name from a terminology category

Parameters
typeOutput argument containing the details of the found type if any (if return value is true)
Returns
Success flag

◆ GetTypeModifierInTerminologyType()

bool vtkSlicerTerminologiesModuleLogic::GetTypeModifierInTerminologyType ( std::string terminologyName,
CodeIdentifier categoryId,
CodeIdentifier typeId,
CodeIdentifier modifierId,
vtkSlicerTerminologyType * typeModifier )

Get a type modifier with given name from a terminology type

Parameters
typeModifierOutput argument containing the details of the found type modifier if any (if return value is true)
Returns
Success flag

◆ GetTypeModifiersInTerminologyType()

bool vtkSlicerTerminologiesModuleLogic::GetTypeModifiersInTerminologyType ( std::string terminologyName,
CodeIdentifier categoryId,
CodeIdentifier typeId,
std::vector< CodeIdentifier > & typeModifiers )

Get terminology type modifiers from a terminology type as collection of

See also
vtkSlicerTerminologyType container objects
Parameters
typeModifierCollectionOutput argument containing all the
See also
vtkSlicerTerminologyType objects created from the type modifiers found in the given terminology type
Returns
Success flag

◆ GetTypesInTerminologyCategory()

bool vtkSlicerTerminologiesModuleLogic::GetTypesInTerminologyCategory ( std::string terminologyName,
CodeIdentifier categoryId,
std::vector< CodeIdentifier > & types )

Get terminology types from a terminology category as collection of

See also
vtkSlicerTerminologyType container objects
Parameters
typesOutput argument containing all the
See also
vtkSlicerTerminologyType objects created from the types found in the given terminology category
Returns
Success flag

◆ GetUserContextsPath()

virtual char * vtkSlicerTerminologiesModuleLogic::GetUserContextsPath ( )
virtual

◆ IsA()

virtual int vtkSlicerTerminologiesModuleLogic::IsA ( const char * type)
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ IsTerminologyContextLoaded()

bool vtkSlicerTerminologiesModuleLogic::IsTerminologyContextLoaded ( std::string terminologyName)

Returns true if the terminology name is loaded.

◆ IsTypeOf()

static int vtkSlicerTerminologiesModuleLogic::IsTypeOf ( const char * type)
static

◆ LoadContextFromFile()

bool vtkSlicerTerminologiesModuleLogic::LoadContextFromFile ( std::string filePath)

Load terminology or region context from JSON file. Note: Separate generic loader function was created so that the file does not need to be loaded twice in case the type of the context in the JSON file is not known

Parameters
filePathFile containing the context to load
Returns
Success flag

◆ LoadDefaultRegionContexts()

void vtkSlicerTerminologiesModuleLogic::LoadDefaultRegionContexts ( )
protected

Load default region context dictionaries from JSON into.

See also
LoadedRegionContexts

◆ LoadDefaultTerminologies()

void vtkSlicerTerminologiesModuleLogic::LoadDefaultTerminologies ( )
protected

Load default terminology dictionaries from JSON into.

See also
LoadedTerminologies

◆ LoadRegionContextFromFile()

std::string vtkSlicerTerminologiesModuleLogic::LoadRegionContextFromFile ( std::string filePath)

Load region context dictionaries from JSON into

See also
LoadedRegionContexts
Parameters
filePathFile containing the region context to load
Returns
Context name (RegionContextName) of the loaded region context. Empty string on failure.

◆ LoadRegionContextFromSegmentDescriptorFile()

bool vtkSlicerTerminologiesModuleLogic::LoadRegionContextFromSegmentDescriptorFile ( std::string contextName,
std::string filePath )

Load region context dictionary from segmentation descriptor JSON file into

See also
LoadedRegionContexts. See also
LoadTerminologyFromSegmentDescriptorFile

◆ LoadTerminologyFromFile()

std::string vtkSlicerTerminologiesModuleLogic::LoadTerminologyFromFile ( std::string filePath)

Load terminology dictionary from JSON terminology context file into

See also
LoadedTerminologies.
Parameters
filePathFile containing the terminology to load
Returns
Context name (SegmentationCategoryTypeContextName) of the loaded terminology. Empty string on failure.

◆ LoadTerminologyFromSegmentDescriptorFile()

bool vtkSlicerTerminologiesModuleLogic::LoadTerminologyFromSegmentDescriptorFile ( std::string contextName,
std::string filePath )

Load terminology dictionary from segmentation descriptor JSON file into

See also
LoadedTerminologies.
Parameters
Terminologycontext name (the descriptor file does not contain information about that)
filePathFile containing the terminology to load
Returns
Success flag

◆ LoadUserContexts()

void vtkSlicerTerminologiesModuleLogic::LoadUserContexts ( )
protected

Load terminologies and region contexts from the user settings directory.

See also
UserContextsPath

◆ New()

static vtkSlicerTerminologiesModuleLogic * vtkSlicerTerminologiesModuleLogic::New ( )
static

◆ PrintSelf()

void vtkSlicerTerminologiesModuleLogic::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ SafeDownCast()

static vtkSlicerTerminologiesModuleLogic * vtkSlicerTerminologiesModuleLogic::SafeDownCast ( vtkObject * o)
static

◆ SerializeTerminologyEntry() [1/2]

static std::string vtkSlicerTerminologiesModuleLogic::SerializeTerminologyEntry ( std::string terminologyContextName,
std::string categoryValue,
std::string categorySchemeDesignator,
std::string categoryMeaning,
std::string typeValue,
std::string typeSchemeDesignator,
std::string typeMeaning,
std::string modifierValue,
std::string modifierSchemeDesignator,
std::string modifierMeaning,
std::string regionContextName,
std::string regionValue,
std::string regionSchemeDesignator,
std::string regionMeaning,
std::string regionModifierValue,
std::string regionModifierSchemeDesignator,
std::string regionModifierMeaning )
static

Assemble terminology string from terminology codes The serialized string will have the following format: "terminologyContextName~" "categorySchemeDesignator^categoryValue^categoryMeaning~" "typeSchemeDesignator^typeValue^typeMeaning~" "modifierSchemeDesignator^modifierValue^modifierMeaning~" "regionContextName~" "regionSchemeDesignator^regionValue^regionMeaning~" "regionModifierSchemeDesignator^regionModifierValue^regionModifierMeaning" Note: The order of the attributes are inconsistent with the codes used in this class for compatibility reasons (to vtkMRMLColorLogic::AddTermToTerminology)

◆ SerializeTerminologyEntry() [2/2]

static std::string vtkSlicerTerminologiesModuleLogic::SerializeTerminologyEntry ( vtkSlicerTerminologyEntry * entry)
static

Convert terminology entry VTK object to string containing identifiers Serialized terminology entry consists of the following: terminologyContextName, category (codingScheme, codeValue, codeMeaning triple), type, typeModifier, regionContextName, region, regionModifier

◆ SetDefaultTerminologyEntry()

static void vtkSlicerTerminologiesModuleLogic::SetDefaultTerminologyEntry ( vtkMRMLNode * node,
vtkSlicerTerminologyEntry * entry )
static

◆ SetDefaultTerminologyEntryAsString()

static void vtkSlicerTerminologiesModuleLogic::SetDefaultTerminologyEntryAsString ( vtkMRMLNode * node,
std::string entryStr )
static

◆ SetMRMLSceneInternal()

void vtkSlicerTerminologiesModuleLogic::SetMRMLSceneInternal ( vtkMRMLScene * newScene)
overrideprotectedvirtual

Called each time a new scene is set. Can be reimplemented in derived classes. Doesn't observe the scene by default, that means that UpdateFromMRMLScene() won't be called by default when a scene is imported, closed or restored, only when a new scene is set.

See also
SetAndObserveMRMLSceneInternal() SetAndObserveMRMLSceneEventsInternal()
UpdateFromMRMLScene()

Reimplemented from vtkMRMLAbstractLogic.

◆ SetTerminologyEntry()

static void vtkSlicerTerminologiesModuleLogic::SetTerminologyEntry ( vtkMRMLNode * node,
vtkSlicerTerminologyEntry * entry )
static

◆ SetTerminologyEntryAsString()

static void vtkSlicerTerminologiesModuleLogic::SetTerminologyEntryAsString ( vtkMRMLNode * node,
std::string entryStr )
static

◆ SetUserContextsPath()

virtual void vtkSlicerTerminologiesModuleLogic::SetUserContextsPath ( const char * )
virtual

◆ UpdateEntryFromLoadedTerminologies()

bool vtkSlicerTerminologiesModuleLogic::UpdateEntryFromLoadedTerminologies ( vtkSlicerTerminologyEntry * entry,
std::vector< std::string > preferredTerminologyNames,
std::vector< std::string > preferredRegionContextNames )

Get metadata (such as recommended color) from loaded terminologies. The entry will be first searched in the terminology context that is specified in the entry, if not found then it is searched in all the other loaded terminology contexts.

Friends And Related Symbol Documentation

◆ vtkInternal

friend class vtkInternal
friend

Definition at line 411 of file vtkSlicerTerminologiesModuleLogic.h.

Member Data Documentation

◆ UserContextsPath

char* vtkSlicerTerminologiesModuleLogic::UserContextsPath {nullptr}
protected

The path from which the json files are automatically loaded on startup.

Definition at line 403 of file vtkSlicerTerminologiesModuleLogic.h.


The documentation for this class was generated from the following file: