Usage

See Example for an implementation of the below.

Modules

This is how most people will write analysis programs using PumpIA. Modules automatically handle the user interface aspect of the program. When subclassing one of the provided modules the following are designed to be replaced or extended:

The class method run is used to run the module as a stand alone.

If the class attribute show_draw_rois_button is set to True then a button to draw ROIs is shown. If the class attribute show_analyse_button is set to True then a button to analyse the image is shown. If both are set to True then a button to do both is also shown. The name class attribute is shown in the window title, this defaults to None.

Module Inputs and Outputs

These allow users to provide information to and get information out of the module. There are three categories of IOs:

  • Simple IOs handle IOs such as strings, options, numbers, and dates. These can be linked through IOGroup so that multiple IOs always have the same value.

  • Viewer IOs represent viewers. These become viewers on module setup as well.

  • ROI IOs handle ROIs created and used by the module.

Context

Context is used to pass information into the module for drawing ROIs. In the user interface collections of widgets called context managers use the modules main_viewer to generate the context. Each context manager requires a context manager generator which is used to create the context manager when running the module, this is set using the context_manager_generator class attribute. Alternatively a modules get_context method can be overwritten.

The following context managers and generators are provided:

When creating your own context manager you must provide the get_context method.

Collections

Collections are used to group modules together, with a main tab showing the context and any defined viewers. Only viewer IOs can be used with collections, any others will be ignored/wont function as expected.

Similar to modules they have context which is shared across all the modules in the collection. The context_manager_generator class attribute must be defined for collections, it defaults to SimpleContextManagerGenerator. The name class attribute is shown in the window title, this defaults to None.

Collections introduce two other useful classes:

  • OutputFrame which shows outputs from different modules in the main tab for ease of viewing.

  • WindowGroup which shows multiple modules in the same tab instead of showing them across multiple tabs.

When subclassing BaseCollection the following methods are designed to be overwritten:

Contents