Developer Documentation - jeanollion/bacmman GitHub Wiki

This page is under construction

BACMMAN allows to integrate custom modules that can be used in pre-processing and processing pipeline. This page intends to describe the different module types, how they can be implemented and how to plug them into BACMMAN Additionally we provide an example of implementation and the associated tutorial.

General remarks on module system

Basic requirements

Modules are written in Java. To be recognized by BACMMAN, a module needs to meet the specifications of ImageJ 1.x plugins and implement a sub-interface of BACMMAN Plugin interface. They will be automatically available in the configuration tree.

Parameters

BACMMAN has its own parameter system. The parameters needed by a module are returned through the method getParameters. Here is a short description of the main parameters types:

  • NumberParameter: constant number, with defined number of decimal places and bounds (for BoundedNumberParameter)
  • TextParameter: prompts a string
  • ChoiceParameter: choice a string within a predefined list
  • BooleanParameter: choice between two options
  • PluginParameter: allows to select a module of a given category (ex allows to choose a thresholder as parameter instead of imposing a constant threshold)
  • ConditionalParameter: allows to add parameters depending on a user choice

Note that in order to help configuration:

  • a tooltip can be added to each parameter through the method setToolTipText.
  • key parameters can be emphasized through the method setEmphasized, they will appear in bold in the configuration tree. In the test configuration tab, only emphasized parameters will be shown in simple mode.

Image processing pipeline

In order to describe the different type of modules that can be plugged into BACMMAN, we describe here shorlty the processing pipeline. Input data are 2D/3D timelapse with multiple channels and multiple positions. Each position is processed independently.

Pre-processing

First step is pre-processing, applied on raw input images, and the resulting images will be saved to hard drive.

Elements of the pre-processing pipeline implement the Transformation interface.

If a transformation implements ConfigurableTransformation interface, it has access to all frames of all channels and all threads to be configured. After configuration it will be applied to images through the method applyTransformation. This method has only access to one single thread as it is run in parallel on all frames.

A transformation that implements Multichannel Transformation can be applied to several channel. For instance a crop transformation needs to be applied to all channels, so it needs to implement Multichannel Transformation and return ALL as OUTPUT_SELECTION_MODE.

Processing

Secondly each object type (eg microchannel, bacteria, spots) will be processed by applying its processing pipeline on the images of the parent track (for instance microchannel has no parent structure, parent track is the whole pre-processed image track, also called root track, bacteria are segmented in microchannels thus parent track is a microchannel track)

 Processing pipeline is composed of

  • a list of PreFilters: filters applied on each image of each frame independently.
  • a list of TrackPreFilters: filters applied on the whole image series of the parent track.
  • the segmentation and tracking step: several pipelines are available
    • SegmentThenTrack: first a segmentation algorithm (that implements the Segmenter interface) is applied at each frame on pre-filtered images, then all segmented objects are tracked by a Tracker
    • SegmentAndTrack: segmentation and tracking are performed jointly, and is managed by the tracking algorithm that implements TrackerSegmenter interface
  • a list of postFilters: filters applied on segmented objects, frame by frame, after segmentation and before tracking
  • a list trackPostFilters: filters applied on segmented objects tracks after tracking

Thresholders

An important type of module that can be used as parameters of other processing modules, they all compute a double value, input argument vary:

  • Thresholder: used in processing pipeline, needs the parent as input (not suitable for pre-processing steps)
  • SimpleThresholder only needs an image and a mask (suitable for pre-processing steps)
  • ThresholderHisto compute a threshold from an histogram (suitable for pre-processing steps)

Multi-threading

Convention: whether a module has access to multiple threads depends on its type: some will only have access to one single thread, other all the available threads multi-thread and a third category depending whether they implement the MultiThreaded interface

Single-threaded module types:

  • Segmenter
  • Thresholder
  • PreFilter
  • PostFilter
  • Transformation (method applyTransformation)
  • ...

Multithreaded plugin types:

  • Transformation (method computeConfigurationData)
  • Tracker
  • TrackPreFilter
  • TrackPostFilter
  • ...

Others

  • Measurements (only for thoses performed only on TrackHeads)
  • ...