brainvisa.processing.qt4gui modules

brainvisa.processing.qtgui.backwardCompatibleQt

brainvisa.processing.qt4gui.neuroProcessesGUI

class brainvisa.processing.qt4gui.neuroProcessesGUI.ParameterLabel(parameterName, mandatory, parent, userLevel=0)[source]

Bases: PyQt5.QtWidgets.QLabel

A QLabel that emits signal ‘contextMenuEvent’ whenever a contextMenuEvent occurs

lockChanged(checked=False)[source]

This function is to lock or unlock data if a user click on the lock menu

readText(txt)[source]

Function to return the value of text without value of tag for images

setlock(default)[source]

This function is to set lock or unlock data

class brainvisa.processing.qt4gui.neuroProcessesGUI.ProcessSelectionWidget[source]

Bases: PyQt5.QtWidgets.QMainWindow

This widget is the main window in brainvisa. Provides navigation among processes.

buttonSearch()[source]

Called when user click on search / next button. The text written in the search box is searched in tree leaves names (processes). The first item found which name contains the searched string becomes selected. If the user click another time on the search / next button, next item is searched…

itemSelected(item)[source]

Called when a tree item becomes selected. currentProcessId is updated and associated documentation is shown.

Parameters:item – the newly selected item ProcessTree.Item
openProcess(item=None)[source]

Called to open current process. If the process is not given, selected process in current tree is opened.

Parameters:item – the process to open. ProcessTree.Item
resetSearch()[source]

Called at the end of a search or when the user click on reset button.

updateList()[source]

Reloads the list of process trees.

class brainvisa.processing.qt4gui.neuroProcessesGUI.ProcessTreesWidget(processTrees=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QSplitter

A widget that shows a list of ProcessTree. Each process tree presents a sub group of existing processes.

It’s composed of two parts : * the list of process trees (use profiles) * a view of currently selected tree Each process tree can be opened in another window in order to enable drag and drop from one tree to another.

treeIndex

Widget containing items representing each process tree. TreeListWidget.

treeStack

A stack of EditableTreeWidget, representing the content of each processTree. QWidgetStack.

treeStackIdentifiers

dict associating a processTree to an unique integer identifier used with the widget stack. Only the selected processTree widget of the stack is visible.

widgets

list of EditableTreeWidget currently in the stack. Useful because QWidgetStack doesn’t provide iterator on its content.

openedTreeWidget

Currently opened process tree. It is in a window independant from the main window. EditableTreeWidget

model

list of ProcessTree which this widget represents. ProcessTrees

popupMenu

QPopupMenu contextual menu associated to the list of process trees.

savesTimer

QTimer started when the model has changed. When the timer times out, the model is saved. Used to delay model saves : it speeds up execution when there is several modification at the same time (drag&drop several elements).

Parameters:
  • processTrees – ProcessTrees, the list of process trees which this widget represents
  • parent – QWidget, container of this widget
addProcessTree(processTree)[source]

Add elements in the widget to add a representation of this process tree.

Parameters:processTree – new process tree for which the widget must be completed.
doubleClicked_slot(item, col)[source]

Called on double click on an item of current process tree. This method emits a signal that must be caught by parent widget.

findItem(name)[source]

Find items that contain the string given in parameters in their name. Each found item is selected and yield (and replace previous selection). Wide search.

Parameters:name – string searched in items names.
Return type:generator
menuDelTabEvent()[source]

Called on click on del option in contextual menu. Removes the selected tree from the model.

menuEditProcessEvent()[source]

Called on click on edit option in process menu. Emits a signal for the parent window which will edit the process.

menuIterateProcessEvent()[source]

Called on click on iterate option in process menu. Emits a signal for the parent window which will iterate the process.

menuNewTabEvent()[source]

Called on click on new option in contextual menu. Adds a new empty tree in the model.

menuOpenProcessEvent()[source]

Called on click on open option in process menu. Emits a signal for the parent window which will open the process.

menuOpenTabEvent()[source]

Called on click on open option in contextual menu. Opens selected tree in a new window.

menuSetDefaultEvent()[source]

Called on click on set default option in contextual menu. Sets the selected tree as the default selected tree. So on next run of brainvisa, this tree will be selected.

modelChanged(action=None, items=None, position=None)[source]

Method registred to be called when a process tree has changed or when the list of tree has changed. New ProcessTree list must be saved in a minf file. If change is insertion of a new item in a tree, registers listeners on this new item.

openContextMenu(point)[source]

Called on contextMenuRequested signal. It opens the popup menu at cursor position.

openProcessMenu(listView, point)[source]

Called on contextMenuRequested signal on the list of processes of a toolbox. It opens the process menu at cursor position if the current item represents a process.

select(widget, item, lastSelection)[source]

Select a process tree and an item in it. Undo last selection.

Parameters:
  • widget – EditableTreeWidget, the tree widget that contains the item to select.
  • item – EditableTreeItem, the item (process) to select
  • lastSelection – tuple(EditableTreeWidget, EditableTreeItem), previous selected item and its container, to be unselected.
selectIndex(model)[source]

Select a process tree in the left panel (toolboxes).

Parameters:model – the process tree to select
selectionChanged_slot(item, col=0)[source]

Called when selected item has changed in current process tree. This method emits a signal that must be caught by parent widget.

setCurrentTree(item, previous=None)[source]

Changes the visible widget in the stack.

setModel(processTrees)[source]

The widget is initialized with the given list of process tree. For each process tree, an item is added in treeIndex. A widget is created to represent each process tree and added to treeStack.

Parameters:processTrees – the list of process trees which this widget represents
updateContent(action=None, items=None, position=None)[source]

Called on model change (list of process trees). The widget must update itself to reflect the change.

updateSelectedTree(newSelection)[source]

Called when the selected tree changes.

class brainvisa.processing.qt4gui.neuroProcessesGUI.RadioItem(text, group, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

An custom item to replace a QTreeWidgetItem for the representation of a SelectionExecutionNode item with a radio button. QTreeWidgetItem enables only check box items.

class brainvisa.processing.qt4gui.neuroProcessesGUI.RemoteContextGUI(parent, name='Remote Hosts:')[source]

Bases: PyQt5.QtWidgets.QTreeWidgetItem

Specific GUI to display messages returned by processes executed remotely.

The specific GUI is a QListView. It is composed of an arborescence of QListViewItems that sorts the messages according to the process and the host they belong to:

Remote Hosts: | –host


--process

–message –message

--process

–message

Parameters:
  • parent – the QListView.
  • name – name
class brainvisa.processing.qt4gui.neuroProcessesGUI.SectionTitle(section_title, section_widgets=[], collapsed=False)[source]

Bases: PyQt5.QtWidgets.QLabel

This widget is used to create a virtual signature separation, called implicitly by “section” argument. All parameters will be grouped by section in signature with this label text as title.

Examples

‘bool_field’, Boolean(section=’Section title’), or ‘image’, WriteDiskItem( ‘4D Volume’, ‘NIFTI-1 image’, section=’Output images’ ),

brainvisa.processing.qt4gui.neuroProcessesGUI.reloadToolboxesGUI()[source]

Calls brainvisa.processes.reloadToolboxes() and updates the main window (list of toolboxes or processes may have changed). If some databases should be updated, the user is warned.

brainvisa.processing.qt4gui.neuroProcessesGUI.runCsvViewer(source, existingWidget=None)[source]

run the CSV viewer defined in BV config. If it is a builtin viewer, use an existing widget, or instantiate and return a new one.

brainvisa.processing.qt4gui.neuroProcessesGUI.runHtmlBrowser(source, existingWidget=None)[source]

run the HTML browser defined in BV config. If it is a builtin browser, use an existing widget, or instantiate and return a new one.

brainvisa.processing.qt4gui.neuroProcessesGUI.showProcess(process_id, *args, **kwargs)[source]

Opens a process window and set the corresponding arguments

brainvisa.processing.qt4gui.neuroLogGUI

class brainvisa.processing.qt4gui.neuroLogGUI.LogItemsViewer(logitems=[], parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget to visualize a list of neuroLog.LogFile.Item. It is compound of a splitter with the list of items displayed as a QTreeWidget at the left and the text of the content of the selected item at the right side. A contextual menu is available on the content panel to search a string in the text.

findItem(name)[source]

Find items that contain the string given in parameters in their name. Each found item is selected and yield (and replace previous selection). Wide search. @type name: string @param name: string searched in items names.

@rtype: generator @return: a generator

class brainvisa.processing.qt4gui.neuroLogGUI.LogViewer(fileName, parent=None, name=None)[source]

Bases: PyQt5.QtWidgets.QWidget

A viewer for a log file. The file is read and its items are displayed in a LogItemsViewer. Buttons are available at the bottom of the window to refresh the display, close the window or open a new log file.

brainvisa.processing.qt4gui.neuroExceptionGUI

brainvisa.processing.qt4gui.command

brainvisa.configuration.qt4gui.neuroConfigGUI

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.