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:
link_rois_viewers
post_roi_register
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
- Example
- Modules
BaseModule
BaseModule.context_manager
BaseModule.manager
BaseModule.parent
BaseModule.verbose_name
BaseModule.direction
BaseModule.main_viewer
BaseModule.viewers
BaseModule.rois
BaseModule.rois_loaded
BaseModule.analysed
BaseModule.input_count
BaseModule.output_count
BaseModule.viewer_count
BaseModule.roi_count
BaseModule.is_setup
BaseModule.set_parent()
BaseModule.set_manager()
BaseModule.setup()
BaseModule.get_context()
BaseModule.load_commands()
BaseModule.register_command()
BaseModule.draw_rois()
BaseModule.analyse()
BaseModule.on_image_load()
BaseModule.on_tab_select()
BaseModule.create_rois()
BaseModule.run_analysis()
BaseModule.create_and_run()
BaseModule.setup_window()
BaseModule.run()
PhantomModule
- Module Inputs and Outputs
- simple
- groups
- viewer_ios
- roi_ios
- Contents
- Simple Inputs and Outputs
- IO Groups
- Viewer Inputs and Outputs
- Region of Interest Inputs and Outputs
- Collections
OutputFrame
WindowGroup
BaseCollection
BaseCollection.manager
BaseCollection.direction
BaseCollection.main_viewer
BaseCollection.viewers
BaseCollection.viewer_count
BaseCollection.modules
BaseCollection.output_frame_count
BaseCollection.load_outputs()
BaseCollection.load_commands()
BaseCollection.register_command()
BaseCollection.on_image_load()
BaseCollection.on_main_tab_select()
BaseCollection.create_rois()
BaseCollection.run_analysis()
BaseCollection.create_and_run()
BaseCollection.run()
- Context
- The User Interface