populse_mia.user_interface.data_viewer package

Blabla

Subpackages

Submodules

populse_mia.user_interface.data_viewer.data_viewer module

This module provides an abstract base class for data viewer implemenataions in populse-mia.

Data viewers are supposed to inherit DataViewer and implement (at least) its methods. A data viewer is given a project and documents list, and is thus allowed to access databasing features and documents attributes.

Coding a data viewer

A data viewer is identified after its module name, and is currently searched for as a submodule of populse_mia.user_interface.data_viewer. The data viewer module may be implemented as a “regular” module (.py file) or a package (directory) and should contain at least a class named MiaViewer which:

  • is a Qt QWidget (inherits QWidget as 1st inheritance as is required by Qt)

  • implements the DataViewer API (normally by inheriting it as second inheritance after QWidget but this is not technically required if the API is implemented)

class populse_mia.user_interface.data_viewer.data_viewer.DataViewer[source]

Bases: object

Populse-MIA data viewers abstract base class: it just gives an API to be overloaded by subclasses.

The API is made willingly very simple and limited. Viewers implementations are free to use Populse database features to implement fancy views. The base functions are to register a project and documents list, display or remove given files.

clear()[source]

Hide / unload all displayed documents

close()[source]

Blabla

display_files(files)[source]

Display the selected document files

displayed_files()[source]

Get the list of displayed files

remove_files(files)[source]

Remove documents from the displayed ones (hide, unload…)

set_documents(project, documents)[source]

Sets the project and list of possible documents

populse_mia.user_interface.data_viewer.data_viewer_tab module

Populse-MIA data viewer GUI interface, in the “Data Viewer” tab.

Contains:
Class:
  • DataViewerTab

class populse_mia.user_interface.data_viewer.data_viewer_tab.DataViewerTab(main_window)[source]

Bases: QWidget

DataViewerTab is the widget in the data viewer tab of Populse-MIA GUI.

A combobox containing the available viewers will always appear. If import of viewers fails, it won’t impact the work of Mia itself. Viewers are put in Qt.QStackedLayout in order to share a same project. A new viewer can be added simply by placing it in the data_viewer directory.

__init__(main_window)[source]

The constructor …

Parameters:

main_window – an instance of the MainWindow class

activate_viewer(viewer_name)[source]

Activates viewer viewer_name which was selected in the combobox.

Parameters:

viewer_name – a viewer name (a string)

change_viewer()[source]

Switches to viewer selected in the combobox pass the project from on viewer to the other.

clear()[source]

Clears all loaded viewers before closing Mia.

closeEvent(event)[source]

clears and closes all events before closing Mia.

current_viewer()[source]

Return current viewer (selected viewer in combobox) used when user changes from BrowserTab or PipelineManagerTab to DataViewerTab.

load_viewer(viewer_name)[source]

Available viewers in data_viewer folder are loaded as soon as Data Viewer tab is clicked.

Parameters:

viewer_name – string

set_documents(project, documents)[source]

Shares project with documents to all viewers.

Parameters:
  • project – whole project

  • documents – objects (images) contained in the project