brainvisa configuration modules

brainvisa.configuration.api

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.neuroConfig

Several global variables are defined in this module to store Brainvisa configuration and user options:

brainvisa.configuration.neuroConfig.logFileName

path of Brainvisa log file where the history of the current session will be saved.

brainvisa.configuration.neuroConfig.platform

linux, windows…

brainvisa.configuration.neuroConfig.gui

false if Brainvisa is in batch mode

brainvisa.configuration.neuroConfig.sessionID
brainvisa.configuration.neuroConfig.fullVersion
brainvisa.configuration.neuroConfig.shortVersion

Brainvisa version

brainvisa.configuration.neuroConfig.userProfile

if Brainvisa is started with -u option, the name of the profile stored in this variable is used to create a specific log file for this profile.

brainvisa.configuration.neuroConfig.siteOptionFile

path to a general options file that may be used for all users.

brainvisa.configuration.neuroConfig.userOptionFile

path to user options file.

brainvisa.configuration.neuroConfig.logFileName

path of Brainvisa log file where the history of the current session will be saved.

brainvisa.configuration.neuroConfig.runsInfo

information about the current executions of Brainvisa.

brainvisa.configuration.neuroConfig.temporaryDirectory

directory where temporary files will be written.

brainvisa.configuration.neuroConfig.mainPath

Path of Brainvisa main module.

brainvisa.configuration.neuroConfig.sharePath

Brainvisa share directory

brainvisa.configuration.neuroConfig.iconPath
brainvisa.configuration.neuroConfig.homeBrainVISADir

path to Brainvisa home directory (usually $HOME/.brainvisa)

brainvisa.configuration.neuroConfig.toolboxesDir

Brainvisa toolboxes directory

brainvisa.configuration.neuroConfig.processesPath

list of paths to Brainvisa processes (outside any toolbox)

brainvisa.configuration.neuroConfig.dataPath

list of DatabaseSettings objects indicating the selected databases.

brainvisa.configuration.neuroConfig.typesPath

list of paths to Brainvisa type files that contain the description of Brainvisa ontology.

brainvisa.configuration.neuroConfig.fileSystemOntologiesPath

list of paths to Brainvisa hierarchy files that contain the rules to organize Brainvisa databases directories.

brainvisa.configuration.neuroConfig.debugHierarchyScanning

stream where debug information about hierarchy rules may be written. Set with --debugHierarchy option.

stream where debug information about parameter links may be written. Set with –debugLinks option.

brainvisa.configuration.neuroConfig.sharedDatabaseFound

True if Brainvisa shared database which contain models, templates, referentials, etc, was found.

brainvisa.configuration.neuroConfig.mainDocPath

path to Brainvisa documentation directory

brainvisa.configuration.neuroConfig.docPath

path to Brainvisa documentation directory according to the choosen language.

brainvisa.configuration.neuroConfig.brainvisaSysEnv

soma.env.BrainvisaSystemEnv - defines system environment variables that have to be passed to external command to restore environment if it have been modified at brainvisa startup

brainvisa.configuration.neuroConfig.ignoreValidation

Do not check vor invalid processes, all are enabled. Set with --ignoreValidation.

brainvisa.configuration.neuroConfig.language

fr or en

brainvisa.configuration.neuroConfig.userLevel

the processes which level is greater than the user level are hidden. Basic = 0, advanced = 1, expert = 2.

brainvisa.configuration.neuroConfig.supportEmail
brainvisa.configuration.neuroConfig.SMTP_server_name
brainvisa.configuration.neuroConfig.textEditor
brainvisa.configuration.neuroConfig.HTMLBrowser
brainvisa.configuration.neuroConfig.fastStart

if this mode is enabled, brainvisa starts faster but with less features. Set with -f or -r options.

brainvisa.configuration.neuroConfig.noToolBox

if enabled, Brainvisa toolboxes are not loaded. Set with --noToolBox.

brainvisa.configuration.neuroConfig.setup

if enabled, the shared database is updated at startup. Set with --setup option.

brainvisa.configuration.neuroConfig.anatomistExecutable
brainvisa.configuration.neuroConfig.anatomistImplementation
brainvisa.configuration.neuroConfig.matlabRelease
brainvisa.configuration.neuroConfig.matlabExecutable
brainvisa.configuration.neuroConfig.matlabOptions
brainvisa.configuration.neuroConfig.matlabPath
brainvisa.configuration.neuroConfig.matlabStartup
brainvisa.configuration.neuroConfig.spmDirectory
brainvisa.configuration.neuroConfig.Roptions
brainvisa.configuration.neuroConfig.Rexecutable
brainvisa.configuration.neuroConfig.profileFileName

filename where profiling information may be written. Set with --profile option.

brainvisa.configuration.neuroConfig.historyBookDirectory

path to history_book directory, where processes executions and logs will be saved. Normally it is None so that it is stored in the database of each output data. But in some specific cases (distributed execution of single process) it can be useful to force it. May be a list of directories: in that case, history files are duplicated in each of them.

class brainvisa.configuration.neuroConfig.RunsInfo(dontrecordruns=False)[source]

Bases: object

This class gets information about possibly existing runs of Brainvisa and adds information about the current one.

Variables:
  • file (string) – information about current runs is stored in <Brainvisa home dir>/current_runs.minf
  • currentRun (integer) – index of the current execution of Brainvisa (from 1)
  • timeout (float) – timeout before asking the user if the execution of Brainvisa is still alive. When Brainvisa fails, the file current_runs.minf may not be cleaned.
  • runs (dictionary) – information about current executions of Brainvisa. The information is loaded from the minf file and information about the current execution is added. It is a dictionary {index -> {host, pid, time, logFileName} }
  • count (integer) – number of executions of Brainvisa
  • expiredRuns (dictonary) – dictionary containing the runs for which the timeout is reached. The user will be asked if these runs are still alive. If not, the corresponding log files will be deleted and the current_runs.minf file will be cleaned.
check(context)[source]

Checks if there are expired runs and asks the user what to do.

delete()[source]

Removes current run information from the current_runs.minf file.

brainvisa.configuration.neuroConfig.chooseDatabaseVersionSyncOption(context)[source]

Asks user to choose a database synchronization mode (Automatic or manual) when a database is used with different versions of Brainvisa. The choice is saved in brainvisa options file.

Parameters:context – The context enables to adapt the interaction with the user according to Brainvisa mode of execution (graphical, batch)
Returns:the user choice: auto for automatic mode, man for manual mode.
brainvisa.configuration.neuroConfig.environmentHTML()[source]

Returns an HTML page displaying Brainvisa configuration:

  • Brainvisa version
  • Python Version
  • Command line used to start Brainvisa
  • Environment variables
  • Brainvisa options (global variables of this module)

This page is displayed in Brainvisa log in starting Brainvisa item.

brainvisa.configuration.neuroConfig.findInPath(file, pathlist=['/casa/host/build/build_files/axon/../../bin', '/casa/host/src/development/casa-distro/5.0/cbin', '/casa/host/build/bin', '/casa/host/build/bin', '/casa/casa-distro/cbin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/local/bin', '/casa/host/bootstrap/brainvisa-cmake/bin', '/casa/bootstrap/brainvisa-cmake'], is_dir=False)[source]

Returns the directory containing file

brainvisa.configuration.neuroConfig.findPlatform()[source]

Identify system platform, possible return values are :

  • ‘windows’: Windows
  • ‘linux’: Linux
  • ‘sunos’: SunOS (Solaris)
  • ‘darwin’: Darwin (MacOS X)
  • ‘irix’: Irix
  • None: unknown
brainvisa.configuration.neuroConfig.getDocFile(filename)[source]

Search doc file in doc path and if not found, in english documentation path.

brainvisa.configuration.neuroConfig.getDocPath(path, project='')[source]

Returns the path of the documentation directory of the given project.

brainvisa.configuration.neuroConfig.getSharePath()[source]

Returns BrainVISA share directory path.

brainvisa.configuration.neuroConfig.initializeOntologyPaths()[source]

Initializes the global variables typesPath and fileSystemOntologiesPath. This function is used when toolboxes are reloaded.

brainvisa.configuration.neuroConfig.openDebugFile(fileName)[source]

Opens a file to put debug messages in. If ‘-‘ is given, sys.stdout is returned. If ‘~’ is given, sys.stderr is returned. If this function is used several times with the same fileName, the same file object is retured.

brainvisa.configuration.neuroConfig.stdinLoop()[source]

Reads Brainvisa commands on stdin and executes them.

brainvisa.configuration.neuroConfig.versionNumber()[source]

Returns Brainvisa short version X.Y as a float number

brainvisa.configuration.neuroConfig.versionString()[source]

Returns Brainvisa full version ‘X.Y.Z’

brainvisa.configuration.neuroConfig.versionText()[source]

Returns the text ‘BrainVISA X.Y.Z’

brainvisa.configuration.brainvisa_configuration

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.brainvisa_configuration.defaultCSVViewer()[source]

If a real CSV viewer is found, use it dy default. If there is no CSV viewer available, the built-in Qt viewer is used.

brainvisa.configuration.brainvisa_configuration.defaultHTMLBrowser()[source]

If a real web browser is found, use it dy default. If there is no web browser available, the built-in Qt Browser is used but it cannot open websites.

brainvisa.configuration.brainvisa_configuration.defaultPNGViewer()[source]

If a real PNG viewer is found, use it dy default. If there is no PNG viewer available, the built-in Qt viewer is used.

brainvisa.configuration.anatomist_configuration

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.databases_configuration

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.fsl_configuration

@organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.matlab_configuration

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.mpegConfig

brainvisa.configuration.spm_configuration

@organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.r_configuration

@author: Yann Cointepas @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

brainvisa.configuration.soma_workflow_configuration

brainvisa.configuration.qt4gui

brainvisa.configuration.qt4gui.neuroConfigGUI.editConfiguration()[source]

Opens Brainvisa options window. When the user closes the window, the configuration is saved in Brainvisa options file.

Some options are taken into account immediately:

  • if databases selection has changed, databases are reloaded
  • if userLevel has changed, the list of available processes is updated
  • new HTML browser and new text editors are taken into account
  • language change is applied to documentation pages.

Some other options are not applied directly but are saved in the options file and will be applied next time Brainvisa is started.

@author: Dominique Geffroy @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

@author: Dominique Geffroy @organization: U{NeuroSpin<http://www.neurospin.org>} and U{IFR 49<http://www.ifr49.org>} @license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}

class brainvisa.configuration.qt4gui.matlab_configuration_qt4gui.MatlabConfiguration_Qt4GUI(instance)[source]

Bases: soma.qt4gui.automatic.Qt4GUI

This class adds a ‘guess configuration’ button to default GUI.

class brainvisa.configuration.qt4gui.spm_configuration_qt4gui.SPMConfiguration_Qt4GUI(instance)[source]

Bases: soma.qt4gui.automatic.Qt4GUI

This class adds a ‘guess configuration’ button to default GUI.