Slicer
4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Base/QTCore/qSlicerCoreApplication.h>
Public Types | |
enum | ApplicationAttribute { AA_DisablePython = 1000, AA_EnableTesting } |
enum | ReturnCode { ExitNotRequested = -1, ExitSuccess = EXIT_SUCCESS, ExitFailure = EXIT_FAILURE } |
typedef QApplication | Superclass |
Properties | |
QString | arch |
QString | defaultScenePath |
QString | extensionsInstallPath |
QString | intDir |
bool | isCustomMainApplication |
bool | isInstalled |
QString | launcherExecutableFilePath |
QString | launcherSettingsFilePath |
int | mainApplicationMajorVersion |
int | mainApplicationMinorVersion |
QString | mainApplicationName |
int | mainApplicationPatchVersion |
QString | mainApplicationRepositoryRevision |
QString | mainApplicationRepositoryUrl |
int | majorVersion |
int | minorVersion |
QString | os |
QString | platform |
QString | releaseType |
QString | repositoryBranch |
QString | repositoryRevision |
QString | repositoryUrl |
QString | slicerDefaultSettingsFilePath |
QString | slicerHome |
QString | slicerRevisionUserSettingsFilePath |
QString | slicerSharePath |
QString | slicerUserSettingsFilePath |
QString | temporaryPath |
Public Slots | |
static void | restart () |
bool | unregisterResource (int handle) |
Signals | |
void | invokeEventRequested (unsigned int delay, void *caller, unsigned long event, void *callData) |
void | mrmlSceneChanged (vtkMRMLScene *mrmlScene) |
Public Member Functions | |
virtual QString | acknowledgment () const |
Return the acknowledgment text of Slicer. More... | |
Q_INVOKABLE void | addModuleAssociatedNodeType (const QString &nodeClassName, const QString &moduleName) |
Q_INVOKABLE QStringList | allModuleAssociatedNodeTypes () const |
List of all node types that are associated with any module. More... | |
void | appendEnvironmentVariable (const QString &key, const QString &value, QChar separator=';') |
Q_INVOKABLE vtkSlicerApplicationLogic * | applicationLogic () const |
Get application logic. More... | |
QString | arch () const |
virtual QString | copyrights () const |
Return the copyrights of Slicer. More... | |
qSlicerCoreCommandOptions * | coreCommandOptions () const |
Get coreCommandOptions. More... | |
Q_INVOKABLE qSlicerCoreIOManager * | coreIOManager () const |
Get the IO manager. More... | |
QString | defaultExtensionsInstallPath () const |
Get slicer default extensions path. More... | |
QString | defaultScenePath () const |
Q_INVOKABLE QSettings * | defaultSettings () const |
QString | defaultTemporaryPath () const |
Get slicer default temporary directory. More... | |
Q_INVOKABLE QProcessEnvironment | environment () const |
Returns the current environment. More... | |
QString | extensionsInstallPath () const |
Get slicer extension directory. More... | |
void | gatherExtensionsHistoryInformationOnStartup () |
QString | intDir () const |
bool | isCustomMainApplication () const |
Return if main application is custom application (not Slicer). More... | |
bool | isEmbeddedModule (const QString &moduleFileName) const |
bool | isEnvironmentVariableValueSet (const QString &key, const QString &value) |
Returns True if environment variable identified by key is set to value. More... | |
bool | isInstalled () const |
Return true is this instance of Slicer is running from an installed directory. More... | |
QString | launcherExecutableFilePath () const |
If any, return slicer launcher executable file path. More... | |
QString | launcherRevisionSpecificUserSettingsFilePath () const |
If any, return slicer user settings file path specific to a given revision of Slicer. More... | |
QString | launcherSettingsFilePath () const |
If any, return slicer launcher settings file path. More... | |
virtual QString | libraries () const |
Return the libraries of Slicer. More... | |
int | mainApplicationMajorVersion () const |
int | mainApplicationMinorVersion () const |
QString | mainApplicationName () const |
Return the name of the main application. More... | |
int | mainApplicationPatchVersion () const |
QString | mainApplicationRepositoryRevision () const |
QString | mainApplicationRepositoryUrl () const |
int | majorVersion () const |
Return the Slicer major version number. More... | |
int | minorVersion () const |
Return the Slicer minor version number. More... | |
Q_INVOKABLE qSlicerModuleManager * | moduleManager () const |
Get the module manager. More... | |
Q_INVOKABLE QStringList | modulesAssociatedWithNodeType (const QString &nodeClassName) const |
List of all modules that are associated with the specified node type. More... | |
Q_INVOKABLE vtkMRMLScene * | mrmlScene () const |
Get MRML Scene. More... | |
QString | os () const |
void | parseArguments (bool &exitWhenDone) |
QString | platform () const |
void | prependEnvironmentVariable (const QString &key, const QString &value, QChar separator=';') |
qSlicerCoreApplication (int &argc, char **argv) | |
Q_INVOKABLE int | registerResource (const QByteArray &data) |
QString | releaseType () const |
Return the release type of this instance of Slicer. More... | |
Q_INVOKABLE void | removeModuleAssociatedNodeType (const QString &nodeClassName, const QString &moduleName) |
Remove association between a module and a node type. More... | |
QString | repositoryBranch () const |
QString | repositoryRevision () const |
QString | repositoryUrl () const |
int | returnCode () const |
Q_INVOKABLE QSettings * | revisionUserSettings () const |
void | setCoreCommandOptions (qSlicerCoreCommandOptions *options) |
void | setCoreIOManager (qSlicerCoreIOManager *ioManager) |
void | setDefaultScenePath (const QString &path) |
Set default slicer scene directory. More... | |
void | setEnvironmentVariable (const QString &key, const QString &value) |
Convenient function to set an environment variable. More... | |
void | setExtensionsInstallPath (const QString &path) |
Set slicer extension directory. More... | |
void | setTemporaryPath (const QString &path) |
Set slicer temporary directory. More... | |
Q_INVOKABLE QSettings * | settings () const |
Q_INVOKABLE void | showConsoleMessage (QString message, bool error=true) const |
QString | slicerDefaultSettingsFilePath () const |
QString | slicerHome () const |
QString | slicerRevisionUserSettingsFilePath () const |
QString | slicerSharePath () const |
QString | slicerUserSettingsFilePath () const |
Q_INVOKABLE QProcessEnvironment | startupEnvironment () const |
Returns the environment without the Slicer specific values. More... | |
QString | temporaryPath () const |
Get slicer temporary directory. More... | |
Q_INVOKABLE QSettings * | userSettings () const |
virtual | ~qSlicerCoreApplication () |
Static Public Member Functions | |
static qSlicerCoreApplication * | application () |
Return a reference to the application singleton. More... | |
static bool | loadCaCertificates (const QString &slicerHome) |
static void | loadLanguage () |
static void | loadTranslations (const QString &dir) |
static void | setAttribute (qSlicerCoreApplication::ApplicationAttribute attribute, bool on=true) |
static bool | testAttribute (qSlicerCoreApplication::ApplicationAttribute attribute) |
Protected Slots | |
virtual void | handleCommandLineArguments () |
void | invokeEvent () |
virtual void | onSlicerApplicationLogicModified () |
void | onSlicerApplicationLogicRequest (vtkObject *, void *, unsigned long) |
virtual void | onUserInformationModified () |
void | processAppLogicModified () |
void | processAppLogicReadData () |
void | processAppLogicWriteData () |
void | requestInvokeEvent (vtkObject *caller, void *callData) |
void | scheduleInvokeEvent (unsigned int delay, void *caller, unsigned long event, void *callData) |
void | terminate (int exitCode=qSlicerCoreApplication::ExitSuccess) |
Set the ReturnCode flag and call QCoreApplication::exit() More... | |
Protected Member Functions | |
virtual void | handlePreApplicationCommandLineArguments () |
qSlicerCoreApplication (qSlicerCoreApplicationPrivate *pimpl, int &argc, char **argv) | |
virtual void | setMRMLScene (vtkMRMLScene *scene) |
Protected Attributes | |
QScopedPointer< qSlicerCoreApplicationPrivate > | d_ptr |
Definition at line 59 of file qSlicerCoreApplication.h.
typedef QApplication qSlicerCoreApplication::Superclass |
Definition at line 100 of file qSlicerCoreApplication.h.
Used in addition to existing QCoreApplication attribute.
Enumerator | |
---|---|
AA_DisablePython | |
AA_EnableTesting |
Definition at line 109 of file qSlicerCoreApplication.h.
Enumerator | |
---|---|
ExitNotRequested | |
ExitSuccess | |
ExitFailure |
Definition at line 172 of file qSlicerCoreApplication.h.
|
read |
Definition at line 88 of file qSlicerCoreApplication.h.
|
readwrite |
Definition at line 70 of file qSlicerCoreApplication.h.
|
readwrite |
Definition at line 78 of file qSlicerCoreApplication.h.
|
read |
Definition at line 79 of file qSlicerCoreApplication.h.
|
read |
Definition at line 90 of file qSlicerCoreApplication.h.
|
read |
Definition at line 80 of file qSlicerCoreApplication.h.
|
read |
Definition at line 73 of file qSlicerCoreApplication.h.
|
read |
Definition at line 74 of file qSlicerCoreApplication.h.
|
read |
Definition at line 94 of file qSlicerCoreApplication.h.
|
read |
Definition at line 95 of file qSlicerCoreApplication.h.
|
read |
Definition at line 91 of file qSlicerCoreApplication.h.
|
read |
Definition at line 96 of file qSlicerCoreApplication.h.
|
read |
Definition at line 93 of file qSlicerCoreApplication.h.
|
read |
Definition at line 92 of file qSlicerCoreApplication.h.
|
read |
Definition at line 85 of file qSlicerCoreApplication.h.
|
read |
Definition at line 86 of file qSlicerCoreApplication.h.
|
read |
Definition at line 89 of file qSlicerCoreApplication.h.
|
read |
Definition at line 87 of file qSlicerCoreApplication.h.
|
read |
Definition at line 81 of file qSlicerCoreApplication.h.
|
read |
Definition at line 83 of file qSlicerCoreApplication.h.
|
read |
Definition at line 84 of file qSlicerCoreApplication.h.
|
read |
Definition at line 82 of file qSlicerCoreApplication.h.
|
read |
Definition at line 75 of file qSlicerCoreApplication.h.
|
read |
This property holds the path where the Slicer application is. For example, for an installed Slicer on Windows, the path can be "C:\Program Files (x86)\Slicer 4.4.0\".
Definition at line 69 of file qSlicerCoreApplication.h.
|
read |
Definition at line 77 of file qSlicerCoreApplication.h.
|
read |
Definition at line 71 of file qSlicerCoreApplication.h.
|
read |
Definition at line 76 of file qSlicerCoreApplication.h.
|
readwrite |
Definition at line 72 of file qSlicerCoreApplication.h.
qSlicerCoreApplication::qSlicerCoreApplication | ( | int & | argc, |
char ** | argv | ||
) |
|
virtual |
|
protected |
|
virtual |
Return the acknowledgment text of Slicer.
Q_INVOKABLE void qSlicerCoreApplication::addModuleAssociatedNodeType | ( | const QString & | nodeClassName, |
const QString & | moduleName | ||
) |
Associate a module with a node type. It is currently only used for determining which module can edit a specific node. If multiple modules are registered for the same class then the node widget's nodeEditable method is used for determining which module is the most suitable for editing.
Q_INVOKABLE QStringList qSlicerCoreApplication::allModuleAssociatedNodeTypes | ( | ) | const |
List of all node types that are associated with any module.
void qSlicerCoreApplication::appendEnvironmentVariable | ( | const QString & | key, |
const QString & | value, | ||
QChar | separator = ';' |
||
) |
Convenient function allowing to append value to environment variable identified by by key using separator
|
static |
Return a reference to the application singleton.
Q_INVOKABLE vtkSlicerApplicationLogic* qSlicerCoreApplication::applicationLogic | ( | ) | const |
Get application logic.
QString qSlicerCoreApplication::arch | ( | ) | const |
Return the arch associated to this build
|
virtual |
Return the copyrights of Slicer.
qSlicerCoreCommandOptions* qSlicerCoreApplication::coreCommandOptions | ( | ) | const |
Get coreCommandOptions.
Q_INVOKABLE qSlicerCoreIOManager* qSlicerCoreApplication::coreIOManager | ( | ) | const |
Get the IO manager.
QString qSlicerCoreApplication::defaultExtensionsInstallPath | ( | ) | const |
Get slicer default extensions path.
QString qSlicerCoreApplication::defaultScenePath | ( | ) | const |
Get default scene directory
This returns the full path where scenes are saved to by default
Q_INVOKABLE QSettings* qSlicerCoreApplication::defaultSettings | ( | ) | const |
Get slicer application default settings.
QString qSlicerCoreApplication::defaultTemporaryPath | ( | ) | const |
Get slicer default temporary directory.
Q_INVOKABLE QProcessEnvironment qSlicerCoreApplication::environment | ( | ) | const |
Returns the current environment.
The returned environment contains all values found in the launcher settings.
os.environ
or set from c++ directly calling putenv()
will NOT be found in the environment returned by this function.QString qSlicerCoreApplication::extensionsInstallPath | ( | ) | const |
Get slicer extension directory.
void qSlicerCoreApplication::gatherExtensionsHistoryInformationOnStartup | ( | ) |
|
protectedvirtualslot |
Process command line arguments atfer the applicaton event loop is started.
Reimplemented in qSlicerApplication.
|
protectedvirtual |
Process command line arguments before the applicaton event loop is started.
Reimplemented in qSlicerApplication.
QString qSlicerCoreApplication::intDir | ( | ) | const |
If any, this method return the build intermediate directory See on http://msdn.microsoft.com/en-us/library/c02as0cs%28VS.71%29.aspx
|
protectedslot |
Internal method called only when a special QTimer times out. The timer contains dynamic properties describing an event to invoke on a specific object.
|
signal |
Internal method used to move an invocation from a thread to the main thread.
bool qSlicerCoreApplication::isCustomMainApplication | ( | ) | const |
Return if main application is custom application (not Slicer).
bool qSlicerCoreApplication::isEmbeddedModule | ( | const QString & | moduleFileName | ) | const |
Returns True if module identified by moduleFileName is a descendant of slicer home.
bool qSlicerCoreApplication::isEnvironmentVariableValueSet | ( | const QString & | key, |
const QString & | value | ||
) |
Returns True if environment variable identified by key is set to value.
bool qSlicerCoreApplication::isInstalled | ( | ) | const |
Return true is this instance of Slicer is running from an installed directory.
QString qSlicerCoreApplication::launcherExecutableFilePath | ( | ) | const |
If any, return slicer launcher executable file path.
QString qSlicerCoreApplication::launcherRevisionSpecificUserSettingsFilePath | ( | ) | const |
If any, return slicer user settings file path specific to a given revision of Slicer.
QString qSlicerCoreApplication::launcherSettingsFilePath | ( | ) | const |
If any, return slicer launcher settings file path.
|
virtual |
Return the libraries of Slicer.
|
static |
Load certificates bundled into '<slicerHome>/<SLICER_SHARE_DIR>/Slicer.crt'. For more details, see Slicer/Base/QTCore/Resources/Certs/README Returns False if 'Slicer.crt' failed to be loaded.
|
static |
|
static |
int qSlicerCoreApplication::mainApplicationMajorVersion | ( | ) | const |
Return the main application's major version number. Useful for custom applications.
int qSlicerCoreApplication::mainApplicationMinorVersion | ( | ) | const |
Return the main application's minor version number. Useful for custom applications.
QString qSlicerCoreApplication::mainApplicationName | ( | ) | const |
Return the name of the main application.
int qSlicerCoreApplication::mainApplicationPatchVersion | ( | ) | const |
Return the main application's patch version number. Useful for custom applications.
QString qSlicerCoreApplication::mainApplicationRepositoryRevision | ( | ) | const |
Return the main application's source repository Revision associated with this build. Useful for custom applications.
QString qSlicerCoreApplication::mainApplicationRepositoryUrl | ( | ) | const |
Return the main application's source repository URL associated with this build. Useful for custom applications.
int qSlicerCoreApplication::majorVersion | ( | ) | const |
Return the Slicer major version number.
int qSlicerCoreApplication::minorVersion | ( | ) | const |
Return the Slicer minor version number.
Q_INVOKABLE qSlicerModuleManager* qSlicerCoreApplication::moduleManager | ( | ) | const |
Get the module manager.
Q_INVOKABLE QStringList qSlicerCoreApplication::modulesAssociatedWithNodeType | ( | const QString & | nodeClassName | ) | const |
List of all modules that are associated with the specified node type.
Q_INVOKABLE vtkMRMLScene* qSlicerCoreApplication::mrmlScene | ( | ) | const |
Get MRML Scene.
|
signal |
|
protectedvirtualslot |
Reimplemented in qSlicerApplication.
|
protectedslot |
|
protectedvirtualslot |
QString qSlicerCoreApplication::os | ( | ) | const |
Return the os associated to this build
void qSlicerCoreApplication::parseArguments | ( | bool & | exitWhenDone | ) |
Parse arguments
QString qSlicerCoreApplication::platform | ( | ) | const |
Return the platform associated to this build
void qSlicerCoreApplication::prependEnvironmentVariable | ( | const QString & | key, |
const QString & | value, | ||
QChar | separator = ';' |
||
) |
Convenient function allowing to prepend value to environment variable identified by by key using separator
|
protectedslot |
|
protectedslot |
|
protectedslot |
Q_INVOKABLE int qSlicerCoreApplication::registerResource | ( | const QByteArray & | data | ) |
QString qSlicerCoreApplication::releaseType | ( | ) | const |
Return the release type of this instance of Slicer.
Release type can be Experimental
, Nightly
or Stable
.
Q_INVOKABLE void qSlicerCoreApplication::removeModuleAssociatedNodeType | ( | const QString & | nodeClassName, |
const QString & | moduleName | ||
) |
Remove association between a module and a node type.
QString qSlicerCoreApplication::repositoryBranch | ( | ) | const |
Return the Slicer source repository Branch associated with this build
QString qSlicerCoreApplication::repositoryRevision | ( | ) | const |
Return the Slicer source repository Revision associated with this build
QString qSlicerCoreApplication::repositoryUrl | ( | ) | const |
Return the Slicer source repository URL associated with this build
|
protectedslot |
Called when the application logic requests a delayed event invocation. When the singleton application logic fires the RequestInvokeEvent,
|
staticslot |
Restart the application with the arguments passed at startup time
int qSlicerCoreApplication::returnCode | ( | ) | const |
After parsing arguments and before exec() is called, returnCode contains the return code if any (!= -1). -1 if the application has not been asked to exit. EXIT_SUCCESS (0) if the application must return in success. EXIT_FAILURE (1) if the application failed.
Q_INVOKABLE QSettings* qSlicerCoreApplication::revisionUserSettings | ( | ) | const |
Get revision specific slicer application user settings
|
protectedslot |
a timer is created, and on timeout, invokeEvent() is called to propagate the requested event invocation.
|
static |
void qSlicerCoreApplication::setCoreCommandOptions | ( | qSlicerCoreCommandOptions * | options | ) |
Set coreCommandOptions
void qSlicerCoreApplication::setCoreIOManager | ( | qSlicerCoreIOManager * | ioManager | ) |
Set the IO manager
void qSlicerCoreApplication::setDefaultScenePath | ( | const QString & | path | ) |
Set default slicer scene directory.
void qSlicerCoreApplication::setEnvironmentVariable | ( | const QString & | key, |
const QString & | value | ||
) |
Convenient function to set an environment variable.
void qSlicerCoreApplication::setExtensionsInstallPath | ( | const QString & | path | ) |
Set slicer extension directory.
|
protectedvirtual |
Set MRML Scene
void qSlicerCoreApplication::setTemporaryPath | ( | const QString & | path | ) |
Set slicer temporary directory.
Q_INVOKABLE QSettings* qSlicerCoreApplication::settings | ( | ) | const |
This function has been deprecated: userSettings() should be used.
Q_INVOKABLE void qSlicerCoreApplication::showConsoleMessage | ( | QString | message, |
bool | error = true |
||
) | const |
Print message on console. If error is true then the message is printed on stderr, otherwise on stdout.
QString qSlicerCoreApplication::slicerDefaultSettingsFilePath | ( | ) | const |
If any, return slicer default settings file path.
QString qSlicerCoreApplication::slicerHome | ( | ) | const |
Get slicer home directory
QString qSlicerCoreApplication::slicerRevisionUserSettingsFilePath | ( | ) | const |
Return slicer settings file path specific to a given revision of Slicer.
QString qSlicerCoreApplication::slicerSharePath | ( | ) | const |
Get slicer share directory
This returns the partial path where slicer resources are located, which is normally of the form "share/Slicer-<i>version</i>"
.
QString qSlicerCoreApplication::slicerUserSettingsFilePath | ( | ) | const |
Return slicer user settings file path.
Q_INVOKABLE QProcessEnvironment qSlicerCoreApplication::startupEnvironment | ( | ) | const |
Returns the environment without the Slicer specific values.
Path environment variables like PATH
, LD_LIBRARY_PATH
or PYTHONPATH
will not contain values found in the launcher settings.
Similarly key=value
environment variables also found in the launcher settings are excluded. Note that if a value was associated with a key prior starting Slicer, it will not be set in the environment returned by this function.
The function excludes both the Slicer launcher settings and the revision specific launcher settings.
QString qSlicerCoreApplication::temporaryPath | ( | ) | const |
Get slicer temporary directory.
|
protectedslot |
Set the ReturnCode flag and call QCoreApplication::exit()
|
static |
|
slot |
Q_INVOKABLE QSettings* qSlicerCoreApplication::userSettings | ( | ) | const |
Get slicer application user settings
|
protected |
Definition at line 503 of file qSlicerCoreApplication.h.