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.

The context_manager class attribute can be defined for modules, it defaults to SimpleContextManagerGenerator. 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 title class attribute is shown in the window title, this defaults to Pumpia Module.

Fields

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

  • Simple fields handle data such as strings, options, numbers, booleans, and dates.

    These can be linked through FieldGroup in collections so that multiple fields always have the same value.

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

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

Fields can be grouped together in the user interface of both modules and collections by using FieldWindow.

Context

Context is used to pass information into the module for drawing ROIs, it is useful to reduce recalculating information between modules. In the user interface collections of widgets called context managers use the modules main_viewer to generate the context. The context manager is set using the context_manager class attribute, or it can be passed into the module like with collections. Alternatively a modules get_context method can be overwritten.

The following context managers 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 fields, field groups 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 class attribute can be defined for collections, it defaults to SimpleContextManagerGenerator. The title class attribute is shown in the window title, this defaults to Pumpia Collection.

Collections introduce two other useful classes:

  • 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