Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Properties | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends
qSlicerSubjectHierarchyPluginHandler Class Reference

Singleton class managing Subject Hierarchy plugins. More...

#include <Modules/Loadable/SubjectHierarchy/Widgets/qSlicerSubjectHierarchyPluginHandler.h>

Inheritance diagram for qSlicerSubjectHierarchyPluginHandler:
Inheritance graph
[legend]
Collaboration diagram for qSlicerSubjectHierarchyPluginHandler:
Collaboration graph
[legend]

Properties

bool autoDeleteSubjectHierarchyChildren
 
bool displayPatientBirthDateInSubjectHierarchyItemName
 
bool displayPatientIDInSubjectHierarchyItemName
 
bool displayStudyDateInSubjectHierarchyItemName
 
bool displayStudyIDInSubjectHierarchyItemName
 

Public Member Functions

Q_INVOKABLE QList< qSlicerSubjectHierarchyAbstractPlugin * > allPlugins ()
 Returns all plugins (registered plugins and default plugin) More...
 
Q_INVOKABLE bool autoDeleteSubjectHierarchyChildren () const
 
Q_INVOKABLE vtkIdType currentItem ()
 
Q_INVOKABLE QList< vtkIdType > currentItems ()
 
Q_INVOKABLE qSlicerSubjectHierarchyDefaultPlugindefaultPlugin ()
 Get default plugin instance. More...
 
Q_INVOKABLE bool displayPatientBirthDateInSubjectHierarchyItemName () const
 
Q_INVOKABLE bool displayPatientIDInSubjectHierarchyItemName () const
 
Q_INVOKABLE bool displayStudyDateInSubjectHierarchyItemName () const
 
Q_INVOKABLE bool displayStudyIDInSubjectHierarchyItemName () const
 
qSlicerSubjectHierarchyAbstractPluginfindAndSetOwnerPluginForSubjectHierarchyItem (vtkIdType itemID)
 
qSlicerSubjectHierarchyAbstractPluginfindOwnerPluginForSubjectHierarchyItem (vtkIdType itemID)
 
Q_INVOKABLE qSlicerSubjectHierarchyAbstractPlugingetOwnerPluginForSubjectHierarchyItem (vtkIdType itemID)
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 Get MRML scene. More...
 
Q_INVOKABLE qSlicerSubjectHierarchyAbstractPluginpluginByName (QString name)
 
Q_INVOKABLE qSlicerSubjectHierarchyPluginLogicpluginLogic ()
 Get plugin logic. More...
 
QList< qSlicerSubjectHierarchyAbstractPlugin * > pluginsForAddingNodeToSubjectHierarchy (vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID)
 
QList< qSlicerSubjectHierarchyAbstractPlugin * > pluginsForReparentingItemInSubjectHierarchy (vtkIdType itemID, vtkIdType parentItemID)
 
 qSlicerSubjectHierarchyPluginHandler (QObject *parent=NULL)
 
Q_INVOKABLE QList< qSlicerSubjectHierarchyAbstractPlugin * > registeredPlugins ()
 Get list of registered plugins. More...
 
Q_INVOKABLE bool registerPlugin (qSlicerSubjectHierarchyAbstractPlugin *plugin)
 
qSlicerSubjectHierarchyAbstractPluginselectPluginFromDialog (QString textToDisplay, QList< qSlicerSubjectHierarchyAbstractPlugin *> candidatePlugins)
 
Q_INVOKABLE void setAutoDeleteSubjectHierarchyChildren (bool flag)
 
Q_INVOKABLE void setCurrentItem (vtkIdType itemID)
 
Q_INVOKABLE void setCurrentItems (QList< vtkIdType > items)
 
Q_INVOKABLE void setDisplayPatientBirthDateInSubjectHierarchyItemName (bool on)
 
Q_INVOKABLE void setDisplayPatientIDInSubjectHierarchyItemName (bool on)
 
Q_INVOKABLE void setDisplayStudyDateInSubjectHierarchyItemName (bool on)
 
Q_INVOKABLE void setDisplayStudyIDInSubjectHierarchyItemName (bool on)
 
void setMRMLScene (vtkMRMLScene *scene)
 Set MRML scene. More...
 
Q_INVOKABLE void setPluginLogic (qSlicerSubjectHierarchyPluginLogic *pluginLogic)
 Set plugin logic. More...
 
void setSubjectHierarchyNode (vtkMRMLSubjectHierarchyNode *shNode)
 Set subject hierarchy node. More...
 
Q_INVOKABLE vtkMRMLSubjectHierarchyNodesubjectHierarchyNode () const
 Get subject hierarchy node. More...
 
virtual ~qSlicerSubjectHierarchyPluginHandler ()
 Private destructor made public to enable python wrapping. More...
 

Static Public Member Functions

static Q_INVOKABLE qSlicerSubjectHierarchyPluginHandlerinstance ()
 
static void setInstance (qSlicerSubjectHierarchyPluginHandler *instance)
 Allows cleanup of the singleton at application exit. More...
 

Static Protected Member Functions

static void onSubjectHierarchyNodeEvent (vtkObject *caller, unsigned long event, void *clientData, void *callData)
 Handle subject hierarchy node events. More...
 

Protected Attributes

vtkSmartPointer< vtkCallbackCommand > m_CallBack
 Callback handling deletion of the subject hierarchy node. More...
 
QList< vtkIdType > m_CurrentItems
 
qSlicerSubjectHierarchyDefaultPluginm_DefaultPlugin
 
vtkWeakPointer< vtkMRMLScenem_MRMLScene
 MRML scene (to get new subject hierarchy node if the stored one is deleted) More...
 
qSlicerSubjectHierarchyPluginLogicm_PluginLogic
 Plugin logic. More...
 
QList< qSlicerSubjectHierarchyAbstractPlugin * > m_RegisteredPlugins
 List of registered plugin instances. More...
 
vtkWeakPointer< vtkMRMLSubjectHierarchyNodem_SubjectHierarchyNode
 Subject hierarchy node. More...
 

Friends

class qSlicerSubjectHierarchyPluginHandlerCleanup
 

Detailed Description

Singleton class managing Subject Hierarchy plugins.

In Widgets, not Plugins because the paths and libs need to be exported to extensions

Definition at line 54 of file qSlicerSubjectHierarchyPluginHandler.h.

Property Documentation

◆ autoDeleteSubjectHierarchyChildren

bool qSlicerSubjectHierarchyPluginHandler::autoDeleteSubjectHierarchyChildren
readwrite

Flag determining whether children of subject hierarchy nodes are automatically deleted upon deleting a parent subject hierarchy node. By default, a pop-up question asking the user to confirm the deletion of children nodes will be shown.

Definition at line 62 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ displayPatientBirthDateInSubjectHierarchyItemName

bool qSlicerSubjectHierarchyPluginHandler::displayPatientBirthDateInSubjectHierarchyItemName
readwrite

Flag determining whether the patient birth date tag is included in the name of the patient subject hierarchy item name after loading from DICOM. False by default

Definition at line 70 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ displayPatientIDInSubjectHierarchyItemName

bool qSlicerSubjectHierarchyPluginHandler::displayPatientIDInSubjectHierarchyItemName
readwrite

Flag determining whether the patient ID tag is included in the name of the patient subject hierarchy item name after loading from DICOM. True by default

Definition at line 66 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ displayStudyDateInSubjectHierarchyItemName

bool qSlicerSubjectHierarchyPluginHandler::displayStudyDateInSubjectHierarchyItemName
readwrite

Flag determining whether the study date tag is included in the name of the study subject hierarchy item name after loading from DICOM. True by default

Definition at line 78 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ displayStudyIDInSubjectHierarchyItemName

bool qSlicerSubjectHierarchyPluginHandler::displayStudyIDInSubjectHierarchyItemName
readwrite

Flag determining whether the study ID tag is included in the name of the study subject hierarchy item name after loading from DICOM. False by default

Definition at line 74 of file qSlicerSubjectHierarchyPluginHandler.h.

Constructor & Destructor Documentation

◆ qSlicerSubjectHierarchyPluginHandler()

qSlicerSubjectHierarchyPluginHandler::qSlicerSubjectHierarchyPluginHandler ( QObject *  parent = NULL)

Private constructor made public to enable python wrapping IMPORTANT: Should not be used for creating plugin handler! Use instance() instead.

◆ ~qSlicerSubjectHierarchyPluginHandler()

virtual qSlicerSubjectHierarchyPluginHandler::~qSlicerSubjectHierarchyPluginHandler ( )
virtual

Private destructor made public to enable python wrapping.

Member Function Documentation

◆ allPlugins()

Q_INVOKABLE QList<qSlicerSubjectHierarchyAbstractPlugin*> qSlicerSubjectHierarchyPluginHandler::allPlugins ( )

Returns all plugins (registered plugins and default plugin)

◆ autoDeleteSubjectHierarchyChildren()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::autoDeleteSubjectHierarchyChildren ( ) const

◆ currentItem()

Q_INVOKABLE vtkIdType qSlicerSubjectHierarchyPluginHandler::currentItem ( )

Get current subject hierarchy item (single selection only). This function is called from the plugins when exposing and performing the supported actions. As the plugin actions are not aggregated on multi-selection, this function is never called from plugins in that case (and thus invalid ID is returned). IMPORTANT NOTE: This function is solely used for plugin-provided context menus. This is NOT to be used for getting the selected item of individual widgets (tree views, comboboxes).

Returns
Current item if only one is selected, otherwise INVALID_ITEM_ID

◆ currentItems()

Q_INVOKABLE QList<vtkIdType> qSlicerSubjectHierarchyPluginHandler::currentItems ( )

Get current subject hierarchy items in case of multi-selection IMPORTANT NOTE: This function is solely used for plugin-provided context menus. This is NOT to be used for getting the selected items of individual widgets (tree views, comboboxes).

◆ defaultPlugin()

Q_INVOKABLE qSlicerSubjectHierarchyDefaultPlugin* qSlicerSubjectHierarchyPluginHandler::defaultPlugin ( )

Get default plugin instance.

◆ displayPatientBirthDateInSubjectHierarchyItemName()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::displayPatientBirthDateInSubjectHierarchyItemName ( ) const

◆ displayPatientIDInSubjectHierarchyItemName()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::displayPatientIDInSubjectHierarchyItemName ( ) const

◆ displayStudyDateInSubjectHierarchyItemName()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::displayStudyDateInSubjectHierarchyItemName ( ) const

◆ displayStudyIDInSubjectHierarchyItemName()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::displayStudyIDInSubjectHierarchyItemName ( ) const

◆ findAndSetOwnerPluginForSubjectHierarchyItem()

qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginHandler::findAndSetOwnerPluginForSubjectHierarchyItem ( vtkIdType  itemID)

Find and set plugin that is most suitable to own a subject hierarchy item The best plugins are found based on the confidence numbers they return for the inputs.

Parameters
itemItem to be owned

◆ findOwnerPluginForSubjectHierarchyItem()

qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginHandler::findOwnerPluginForSubjectHierarchyItem ( vtkIdType  itemID)

Find plugin that is most suitable to own a subject hierarchy item. This method does not set it to the item! The best plugins are found based on the confidence numbers they return for the inputs.

Parameters
itemItem to be owned

◆ getOwnerPluginForSubjectHierarchyItem()

Q_INVOKABLE qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginHandler::getOwnerPluginForSubjectHierarchyItem ( vtkIdType  itemID)

Get plugin owning a certain subject hierarchy item. This function doesn't try to find a suitable plugin, it just returns the one already assigned.

◆ instance()

static Q_INVOKABLE qSlicerSubjectHierarchyPluginHandler* qSlicerSubjectHierarchyPluginHandler::instance ( )
static

Instance getter for the singleton class

Returns
Instance object

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qSlicerSubjectHierarchyPluginHandler::mrmlScene ( ) const

Get MRML scene.

◆ onSubjectHierarchyNodeEvent()

static void qSlicerSubjectHierarchyPluginHandler::onSubjectHierarchyNodeEvent ( vtkObject *  caller,
unsigned long  event,
void *  clientData,
void *  callData 
)
staticprotected

Handle subject hierarchy node events.

◆ pluginByName()

Q_INVOKABLE qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginHandler::pluginByName ( QString  name)

Get a plugin by name

Returns
The plugin instance if exists, NULL otherwise

◆ pluginLogic()

Q_INVOKABLE qSlicerSubjectHierarchyPluginLogic* qSlicerSubjectHierarchyPluginHandler::pluginLogic ( )

Get plugin logic.

◆ pluginsForAddingNodeToSubjectHierarchy()

QList<qSlicerSubjectHierarchyAbstractPlugin*> qSlicerSubjectHierarchyPluginHandler::pluginsForAddingNodeToSubjectHierarchy ( vtkMRMLNode node,
vtkIdType  parentItemID = vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID 
)

Returns the plugin that can handle a node the best for adding it from outside to inside the subject hierarchy The best plugins are found based on the confidence numbers they return for the inputs.

Parameters
nodeNode to be added to the hierarchy
parentItemIDProspective parent of the node to add. Default value is invalid. In that case the parent will be ignored, the confidence numbers are got based on the to-be child node alone.
Returns
The most suitable plugins if found, empty list otherwise

◆ pluginsForReparentingItemInSubjectHierarchy()

QList<qSlicerSubjectHierarchyAbstractPlugin*> qSlicerSubjectHierarchyPluginHandler::pluginsForReparentingItemInSubjectHierarchy ( vtkIdType  itemID,
vtkIdType  parentItemID 
)

Returns the plugin that can handle an item the best for reparenting it inside the subject hierarchy The best plugins are found based on the confidence numbers they return for the inputs.

Parameters
itemIDItem to be reparented in the hierarchy
parentItemIDProspective parent of the item to reparent.
Returns
The most suitable plugins if found, empty list otherwise

◆ registeredPlugins()

Q_INVOKABLE QList<qSlicerSubjectHierarchyAbstractPlugin*> qSlicerSubjectHierarchyPluginHandler::registeredPlugins ( )
inline

Get list of registered plugins.

Definition at line 142 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ registerPlugin()

Q_INVOKABLE bool qSlicerSubjectHierarchyPluginHandler::registerPlugin ( qSlicerSubjectHierarchyAbstractPlugin plugin)

Register a plugin

Returns
True if plugin registered successfully, false otherwise

◆ selectPluginFromDialog()

qSlicerSubjectHierarchyAbstractPlugin* qSlicerSubjectHierarchyPluginHandler::selectPluginFromDialog ( QString  textToDisplay,
QList< qSlicerSubjectHierarchyAbstractPlugin *>  candidatePlugins 
)

Used when multiple plugins are found with the same confidence number for an item. Pops up a simple dialog asking to choose one plugin from a list. Note: This should happen very rarely. If happens frequently, then confidence numbers returned by plugins need review.

Parameters
textToDisplayText assembled by the caller displaying the reason and basis (items) of the choice
candidatePluginsList of plugins to choose from
Returns
Plugin chosen by the user

◆ setAutoDeleteSubjectHierarchyChildren()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setAutoDeleteSubjectHierarchyChildren ( bool  flag)

◆ setCurrentItem()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setCurrentItem ( vtkIdType  itemID)

Set current subject hierarchy item (single selection only) IMPORTANT NOTE: This function will not change the selection in individual widgets (tree views, comboboxes). This is solely used for plugin-provided context menus.

◆ setCurrentItems()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setCurrentItems ( QList< vtkIdType >  items)

Set current subject hierarchy items in case of multi-selection IMPORTANT NOTE: This function will not change the selection in individual widgets (tree views, comboboxes). This is solely used for plugin-provided context menus.

◆ setDisplayPatientBirthDateInSubjectHierarchyItemName()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setDisplayPatientBirthDateInSubjectHierarchyItemName ( bool  on)

◆ setDisplayPatientIDInSubjectHierarchyItemName()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setDisplayPatientIDInSubjectHierarchyItemName ( bool  on)

◆ setDisplayStudyDateInSubjectHierarchyItemName()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setDisplayStudyDateInSubjectHierarchyItemName ( bool  on)

◆ setDisplayStudyIDInSubjectHierarchyItemName()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setDisplayStudyIDInSubjectHierarchyItemName ( bool  on)

◆ setInstance()

static void qSlicerSubjectHierarchyPluginHandler::setInstance ( qSlicerSubjectHierarchyPluginHandler instance)
static

Allows cleanup of the singleton at application exit.

◆ setMRMLScene()

void qSlicerSubjectHierarchyPluginHandler::setMRMLScene ( vtkMRMLScene scene)

Set MRML scene.

◆ setPluginLogic()

Q_INVOKABLE void qSlicerSubjectHierarchyPluginHandler::setPluginLogic ( qSlicerSubjectHierarchyPluginLogic pluginLogic)

Set plugin logic.

◆ setSubjectHierarchyNode()

void qSlicerSubjectHierarchyPluginHandler::setSubjectHierarchyNode ( vtkMRMLSubjectHierarchyNode shNode)

Set subject hierarchy node.

◆ subjectHierarchyNode()

Q_INVOKABLE vtkMRMLSubjectHierarchyNode* qSlicerSubjectHierarchyPluginHandler::subjectHierarchyNode ( ) const

Get subject hierarchy node.

Friends And Related Function Documentation

◆ qSlicerSubjectHierarchyPluginHandlerCleanup

friend class qSlicerSubjectHierarchyPluginHandlerCleanup
friend

Definition at line 232 of file qSlicerSubjectHierarchyPluginHandler.h.

Member Data Documentation

◆ m_CallBack

vtkSmartPointer<vtkCallbackCommand> qSlicerSubjectHierarchyPluginHandler::m_CallBack
protected

Callback handling deletion of the subject hierarchy node.

Definition at line 220 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_CurrentItems

QList<vtkIdType> qSlicerSubjectHierarchyPluginHandler::m_CurrentItems
protected

Current subject hierarchy item(s) (selected items in the tree view e.g. for context menu request)

Definition at line 209 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_DefaultPlugin

qSlicerSubjectHierarchyDefaultPlugin* qSlicerSubjectHierarchyPluginHandler::m_DefaultPlugin
protected

Instance of the default plugin to access it if there is no suitable plugin found (the default plugin instance cannot be in the registered list, as then it would never be returned)

Definition at line 205 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_MRMLScene

vtkWeakPointer<vtkMRMLScene> qSlicerSubjectHierarchyPluginHandler::m_MRMLScene
protected

MRML scene (to get new subject hierarchy node if the stored one is deleted)

Definition at line 214 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_PluginLogic

qSlicerSubjectHierarchyPluginLogic* qSlicerSubjectHierarchyPluginHandler::m_PluginLogic
protected

Plugin logic.

Definition at line 217 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_RegisteredPlugins

QList<qSlicerSubjectHierarchyAbstractPlugin*> qSlicerSubjectHierarchyPluginHandler::m_RegisteredPlugins
protected

List of registered plugin instances.

Definition at line 201 of file qSlicerSubjectHierarchyPluginHandler.h.

◆ m_SubjectHierarchyNode

vtkWeakPointer<vtkMRMLSubjectHierarchyNode> qSlicerSubjectHierarchyPluginHandler::m_SubjectHierarchyNode
protected

Subject hierarchy node.

Definition at line 212 of file qSlicerSubjectHierarchyPluginHandler.h.


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