Slicer
4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
qSlicerAbstractCoreModule is the base class of any module in Slicer. More...
#include <Base/QTCore/qSlicerAbstractCoreModule.h>
and not \a title. | |
Any object deriving from QObject must have the Q_OBJECT macro in order to have the signal/slots working and the meta-class name valid. The following properties are added to the meta-class and though are available through PythonQt. This property contains the name of the module. e.g. "Volumes", "VolumeRendering", "SampleData"... The name identifies a module and must be unique. In comparison to title, name contains only letter characters, no space/hyphen/apostrophe. The module name is set by the module factory (the registered item key string). Because name is unique, slots and functions that take a module as argument should use | |
typedef QObject | Superclass |
QString | name |
QString | title |
QStringList | categories |
int | index |
bool | hidden |
bool | widgetRepresentationCreationEnabled |
QString | helpText |
QString | acknowledgementText |
QStringList | contributors |
QString | slicerWikiUrl |
QStringList | dependencies |
QString | path |
bool | isInstalled |
bool | isBuiltIn |
QStringList | associatedNodeTypes |
QScopedPointer< qSlicerAbstractCoreModulePrivate > | d_ptr |
class | qSlicerAbstractModuleRepresentation |
qSlicerAbstractCoreModule (QObject *parent=0) | |
virtual | ~qSlicerAbstractCoreModule () |
virtual void | printAdditionalInfo () |
QString | slicerWikiUrl () const |
Convenient method to return slicer wiki URL. More... | |
void | initialize (vtkSlicerApplicationLogic *appLogic) |
bool | initialized () |
virtual QString | name () const |
virtual void | setName (const QString &name) |
virtual QString | title () const =0 |
virtual QStringList | categories () const |
virtual int | index () const |
Return the category index of the module. More... | |
virtual bool | isHidden () const |
virtual QStringList | contributors () const |
Return the contributors of the module. More... | |
virtual QString | helpText () const |
virtual QString | acknowledgementText () const |
bool | isWidgetRepresentationCreationEnabled () const |
void | setWidgetRepresentationCreationEnabled (bool value) |
qSlicerAbstractModuleRepresentation * | widgetRepresentation () |
qSlicerAbstractModuleRepresentation * | createNewWidgetRepresentation () |
void | setAppLogic (vtkSlicerApplicationLogic *appLogic) |
vtkSlicerApplicationLogic * | appLogic () const |
Q_INVOKABLE vtkMRMLAbstractLogic * | logic () |
Q_INVOKABLE vtkMRMLScene * | mrmlScene () const |
Return a pointer on the MRML scene. More... | |
virtual QStringList | dependencies () const |
QString | path () const |
void | setPath (const QString &newPath) |
bool | isInstalled () const |
void | setInstalled (bool value) |
bool | isBuiltIn () const |
void | setBuiltIn (bool value) |
virtual QStringList | associatedNodeTypes () const |
Return node types associated with this module (e.g., node types this module can edit) More... | |
virtual void | setMRMLScene (vtkMRMLScene *) |
virtual void | setup ()=0 |
All initialization code should be done in the setup. More... | |
virtual qSlicerAbstractModuleRepresentation * | createWidgetRepresentation ()=0 |
Create and return a widget representation for the module. More... | |
virtual vtkMRMLAbstractLogic * | createLogic ()=0 |
qSlicerAbstractCoreModule is the base class of any module in Slicer.
Core modules, Loadable modules, CLI modules derive from it. It is responsible to create the UI and the Logic: createWidgetRepresentation() and createLogic() must be reimplemented in derived classes. A Slicer module has a name and a title: The name is its UID, the title displayed to the user. When a MRML scene is set to the module, the module set the scene to the UI widget and the logic.
Definition at line 55 of file qSlicerAbstractCoreModule.h.
typedef QObject qSlicerAbstractCoreModule::Superclass |
Definition at line 189 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the acknowledgments for the module Credits (organization, grants, thanks...) can be given and are displayed in the acknowledgment tab in the module panel. The contributors of the module will automatically be appended when needed, don't duplicate the information in the acknowledgements. acknowledgementText() must be reimplemented for each module.
Definition at line 132 of file qSlicerAbstractCoreModule.h.
|
read |
This property specifies node classes this module is associated with. All children node classes are also associated with the module. Currently association is only used for editing node properties. If a node class is specified in this property and setEditedNode() and nodeEditable() methods are implemented in the module's widget then "Edit properties" function in node selector widgets will activate this module and select the chosen node. Any module can associate nodes with any module, by calling qSlicerApplication::application()->registerNodeModule() method.
Definition at line 185 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the categories a module belongs to. It is used to organize modules in the modules menu. Sub-categories are supported by using '.' as a a separator to specify a subcategory (no depth limit), e.g.: "Filtering.Arithmetic". A category doesn't have to exist, it will be created if needed. The method categories() must be reimplemented for each module. An empty category means the module shows up at the top level. It is possible to define more than 1 category, the module will then be visible in all the listed categories
Definition at line 92 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the authors of the module It is shown in the Acknowledgement page. If there are multiple contributors, they must be listed in the order of contribution. For each contributor, the name of the institution can succeed the author: e.g. John Doe, CompanyName Inc. contributors() must be reimplemented for each module.
Definition at line 141 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the module name list of the module dependencies. It is used to order the loading of the modules. When setup() is called it is ensured that all the dependencies have already been setup. There is no dependency cycle check, so special care must be taken to avoid infinite loop. By default, there is no dependencies.
Definition at line 154 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the help of the module. The help is displayed inside the module as a tab. helpText must be reimplemented for each module.
Definition at line 123 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds whether the module is visible to the user. If the module is hidden, it doesn't appear in the list of modules menu. However, the module is programmatically accessible. By default, modules are visible (hidden == false).
Definition at line 108 of file qSlicerAbstractCoreModule.h.
|
read |
This property controls the index used to sort modules in the module selector's menu in the module's category. An index of 0 means the module should be first in the category, a value of 1 if the module should be second and so on. -1 means that the module should be added at the end. In case modules indexes have the same index, the alphabetical order will be used. -1 by default.
Definition at line 101 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds whether module is a built-in Slicer module or one from an extension or any user-specified folder. isBuiltIn is set by the module factory and shouldn't be reimplemented in each module.
Definition at line 174 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds whether the module is loaded from an installed directory. isInstalled is set by the module factory and shouldn't be reimplemented in each module.
Definition at line 168 of file qSlicerAbstractCoreModule.h.
|
read |
Definition at line 73 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the path of the module if any. The path is the library (dll, so...) location on disk. path is set by the module factory and shouldn't be reimplemented in each module.
Definition at line 162 of file qSlicerAbstractCoreModule.h.
|
read |
This property holds the URL of the module for the Slicer wiki. It can be used in the help/ackknowledgement.
Definition at line 146 of file qSlicerAbstractCoreModule.h.
|
read |
This property contains the title of the module. e.g. "Volumes", "Volume Rendering", "Welcome to Slicer"... title (not name) is displayed to the user in the GUI (but internally name is used to uniquely identify the module). The module title can contain any characters. title() must be overwritten for each module.
Definition at line 81 of file qSlicerAbstractCoreModule.h.
|
readwrite |
This property holds whether the module should be able to create new widget representations or not. By default, modules can create new widget representations.
Definition at line 117 of file qSlicerAbstractCoreModule.h.
qSlicerAbstractCoreModule::qSlicerAbstractCoreModule | ( | QObject * | parent = 0 | ) |
Constructor Warning: If there is no parent given, make sure you delete the object. The modules can typically be instantiated before the application is initialized (module manager, iomanager...). Most of the initialization must be done in qSlicerAbstractCoreModule::setup()
|
virtual |
|
virtual |
Return acknowledgement text for the module Must be reimplemented in the derived classes
Reimplemented in qSlicerScriptedLoadableModule, qSlicerTransformsModule, qSlicerCLIModule, qSlicerSubjectHierarchyModule, qSlicerWelcomeModule, qSlicerViewControllersModule, qSlicerDataModule, qSlicerSegmentationsModule, qSlicerTerminologiesModule, qSlicerVolumeRenderingModule, qSlicerCamerasModule, qSlicerColorsModule, qSlicerModelsModule, qSlicerPlotsModule, qSlicerReformatModule, qSlicerTablesModule, qSlicerUnitsModule, qSlicerEventBrokerModule, qSlicerMarkupsModule, qSlicerVolumesModule, qSlicerLoadableModule, qSlicerDoubleArraysModule, qSlicerCropVolumeModule, qSlicerAnnotationsModule, and qSlicerSceneViewsModule.
vtkSlicerApplicationLogic* qSlicerAbstractCoreModule::appLogic | ( | ) | const |
|
virtual |
Return node types associated with this module (e.g., node types this module can edit)
Reimplemented in qSlicerCLIModule, qSlicerSegmentationsModule, qSlicerScriptedLoadableModule, qSlicerTransformsModule, qSlicerVolumesModule, qSlicerReformatModule, qSlicerVolumeRenderingModule, qSlicerModelsModule, qSlicerMarkupsModule, qSlicerColorsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerCamerasModule, qSlicerAnnotationsModule, qSlicerCropVolumeModule, and qSlicerSceneViewsModule.
|
virtual |
Categories the module belongs to. Categories support subcategories. Use the '.' separator to specify a subcategory (no depth limit), e.g.: "Filtering.Arithmetic". The function must be reimplemented in derived classes. Note: If a category doesn't exist, it will be created.
Reimplemented in qSlicerCLIModule, qSlicerSegmentationsModule, qSlicerSubjectHierarchyModule, qSlicerScriptedLoadableModule, qSlicerVolumeRenderingModule, qSlicerTerminologiesModule, qSlicerMarkupsModule, qSlicerModelsModule, qSlicerReformatModule, qSlicerUnitsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerViewControllersModule, qSlicerWelcomeModule, qSlicerVolumesModule, qSlicerTransformsModule, qSlicerDoubleArraysModule, qSlicerDataModule, qSlicerCamerasModule, qSlicerColorsModule, qSlicerEventBrokerModule, qSlicerAnnotationsModule, qSlicerSceneViewsModule, and qSlicerCropVolumeModule.
|
virtual |
Return the contributors of the module.
Reimplemented in qSlicerCLIModule, qSlicerScriptedLoadableModule, qSlicerTransformsModule, qSlicerReformatModule, qSlicerSubjectHierarchyModule, qSlicerSegmentationsModule, qSlicerWelcomeModule, qSlicerTerminologiesModule, qSlicerViewControllersModule, qSlicerDataModule, qSlicerVolumeRenderingModule, qSlicerCamerasModule, qSlicerColorsModule, qSlicerModelsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerMarkupsModule, qSlicerUnitsModule, qSlicerEventBrokerModule, qSlicerVolumesModule, qSlicerDoubleArraysModule, qSlicerCropVolumeModule, qSlicerAnnotationsModule, and qSlicerSceneViewsModule.
|
protectedpure virtual |
Create and return the module logic Note: Only one instance of the logic will exist per module
Implemented in qSlicerCLIModule, qSlicerScriptedLoadableModule, qSlicerViewControllersModule, qSlicerSegmentationsModule, qSlicerTransformsModule, qSlicerSubjectHierarchyModule, qSlicerReformatModule, qSlicerTerminologiesModule, qSlicerVolumeRenderingModule, qSlicerMarkupsModule, qSlicerModelsModule, qSlicerColorsModule, qSlicerUnitsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerCamerasModule, qSlicerWelcomeModule, qSlicerDataModule, qSlicerVolumesModule, qSlicerDoubleArraysModule, qSlicerSceneViewsModule, qSlicerEventBrokerModule, qSlicerAnnotationsModule, and qSlicerCropVolumeModule.
qSlicerAbstractModuleRepresentation* qSlicerAbstractCoreModule::createNewWidgetRepresentation | ( | ) |
Force the creation of a new widget representation. It does not return the widget of the module, but a new instance instead. It can be useful when embedding a module widget into another module.
|
protectedpure virtual |
Create and return a widget representation for the module.
Implemented in qSlicerCLIModule, qSlicerScriptedLoadableModule, qSlicerViewControllersModule, qSlicerSegmentationsModule, qSlicerSubjectHierarchyModule, qSlicerTransformsModule, qSlicerReformatModule, qSlicerTerminologiesModule, qSlicerVolumeRenderingModule, qSlicerMarkupsModule, qSlicerModelsModule, qSlicerColorsModule, qSlicerUnitsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerCamerasModule, qSlicerWelcomeModule, qSlicerDataModule, qSlicerVolumesModule, qSlicerDoubleArraysModule, qSlicerSceneViewsModule, qSlicerEventBrokerModule, qSlicerAnnotationsModule, and qSlicerCropVolumeModule.
|
virtual |
Reimplemented in qSlicerScriptedLoadableModule, qSlicerTerminologiesModule, qSlicerSegmentationsModule, qSlicerModelsModule, qSlicerUnitsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerTransformsModule, qSlicerVolumesModule, qSlicerDoubleArraysModule, qSlicerDataModule, qSlicerCropVolumeModule, and qSlicerAnnotationsModule.
|
virtual |
Return help text of the module Must be reimplemented in the derived classes
Reimplemented in qSlicerScriptedLoadableModule, qSlicerTransformsModule, qSlicerCLIModule, qSlicerWelcomeModule, qSlicerSubjectHierarchyModule, qSlicerViewControllersModule, qSlicerDataModule, qSlicerCamerasModule, qSlicerColorsModule, qSlicerSegmentationsModule, qSlicerVolumeRenderingModule, qSlicerModelsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerTerminologiesModule, qSlicerUnitsModule, qSlicerReformatModule, qSlicerEventBrokerModule, qSlicerVolumesModule, qSlicerLoadableModule, qSlicerMarkupsModule, qSlicerDoubleArraysModule, qSlicerCropVolumeModule, qSlicerAnnotationsModule, and qSlicerSceneViewsModule.
|
virtual |
Return the category index of the module.
Reimplemented in qSlicerScriptedLoadableModule, and qSlicerCLIModule.
void qSlicerAbstractCoreModule::initialize | ( | vtkSlicerApplicationLogic * | appLogic | ) |
Initialize the module, an appLogic must be given to initialize the module
|
inline |
Definition at line 206 of file qSlicerAbstractCoreModule.h.
bool qSlicerAbstractCoreModule::isBuiltIn | ( | ) | const |
Determine if this module is a built-in Slicer module or one from an extension or any user-specified folder.
|
virtual |
Returns true if the module should be hidden to the user. By default, interactive modules are visible and non-interactive modules are hidden.
Reimplemented in qSlicerScriptedLoadableModule, qSlicerSubjectHierarchyModule, qSlicerUnitsModule, qSlicerColorsModule, and qSlicerDoubleArraysModule.
bool qSlicerAbstractCoreModule::isInstalled | ( | ) | const |
Return true is this instance of the module is loaded from an installed directory
bool qSlicerAbstractCoreModule::isWidgetRepresentationCreationEnabled | ( | ) | const |
Set/Get if the module should be able to create new widget representations or not.
Q_INVOKABLE vtkMRMLAbstractLogic* qSlicerAbstractCoreModule::logic | ( | ) |
This method allows to get a pointer to the module logic. If no moduleLogic already exists, one will be created calling the 'createLogic' method. A module logic is typically a vtkSlicerModuleLogic but not necessarily.
Q_INVOKABLE vtkMRMLScene* qSlicerAbstractCoreModule::mrmlScene | ( | ) | const |
Return a pointer on the MRML scene.
|
virtual |
Set/Get the name of the module. The name is used to uniquely describe a module: name must be unique. The name is set by the module factory (the registered item key string).
QString qSlicerAbstractCoreModule::path | ( | ) | const |
Returns path if any
|
virtual |
void qSlicerAbstractCoreModule::setAppLogic | ( | vtkSlicerApplicationLogic * | appLogic | ) |
Get/Set the application logic. It must be set.
void qSlicerAbstractCoreModule::setBuiltIn | ( | bool | value | ) |
void qSlicerAbstractCoreModule::setInstalled | ( | bool | value | ) |
|
virtualslot |
Set the current MRML scene to the module, it is propagated to the logic and representations if any
Reimplemented in qSlicerViewControllersModule, and qSlicerColorsModule.
|
virtual |
void qSlicerAbstractCoreModule::setPath | ( | const QString & | newPath | ) |
|
protectedpure virtual |
All initialization code should be done in the setup.
Implemented in qSlicerCLIModule, qSlicerScriptedLoadableModule, qSlicerViewControllersModule, qSlicerLoadableModule, qSlicerSegmentationsModule, qSlicerSubjectHierarchyModule, qSlicerTransformsModule, qSlicerReformatModule, qSlicerTerminologiesModule, qSlicerVolumeRenderingModule, qSlicerMarkupsModule, qSlicerModelsModule, qSlicerColorsModule, qSlicerUnitsModule, qSlicerPlotsModule, qSlicerTablesModule, qSlicerVolumesModule, qSlicerDoubleArraysModule, qSlicerSceneViewsModule, qSlicerAnnotationsModule, qSlicerDataModule, qSlicerCoreModule, and qSlicerCropVolumeModule.
void qSlicerAbstractCoreModule::setWidgetRepresentationCreationEnabled | ( | bool | value | ) |
|
inline |
Convenient method to return slicer wiki URL.
Definition at line 201 of file qSlicerAbstractCoreModule.h.
|
pure virtual |
Title of the module, (displayed to the user) title() must be reimplemented in derived classes.
Implemented in qSlicerCLIModule, and qSlicerScriptedLoadableModule.
qSlicerAbstractModuleRepresentation* qSlicerAbstractCoreModule::widgetRepresentation | ( | ) |
This method allows to get a pointer to the WidgetRepresentation. If no WidgetRepresentation already exists, one will be created calling 'createWidgetRepresentation' method.
|
friend |
Definition at line 321 of file qSlicerAbstractCoreModule.h.
|
protected |
Definition at line 316 of file qSlicerAbstractCoreModule.h.