Skip to content

biomicrodev/jonaslab-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jonaslab-cpp

Here are some helpful cellprofiler plugins used by the Laboratory for Bio-Micro Devices at Brigham & Women's Hospital.

Getting Started

Prerequisites

Download CellProfiler. Only CellProfiler 3 is supported for now.

Installing

Download the zip file and move the module files in plugins_py2 to your plugins folder (if it exists), or point your CellProfiler's plugin folder in the preferences dialog to your plugins folder.

Or, use git clone in an empty folder.

Development

Type hints

Type annotations aid the developer in enforcing variable and argument types. Modern IDEs are able to infer types, but this may not always be the intended types. They are contracts between developers to eliminate ambiguity.

Unfortunately, the version of python shipped with CellProfiler does not support type annotations (yet), so we use the strip-hints module to help us remove type annotations. These Modules can then be used directly in CellProfiler. Run remove_type_hints.py to do so.

Some notes on modules

Each custom module has to subclass cellprofiler.module.Module. Three class attributes are required:

  1. module_name: str, the module name
  2. category: Union[str, List[str]], the category or categories the module can be classified into
  3. variable_revision_number: int, the version number

Settings

Each module contains one or more cellprofiler.setting.Settings, which are essentially key-value pairs. Settings can be stored anywhere within the module, as long as the following API holds:

  1. create_settings -> None initializes settings and hooks up behavior with button.
  2. settings -> List[Setting] specifies the order in which settings are serialized to and from the .cpproj file.
  3. visible_settings -> List[Setting] specifies the list of visible settings.
  4. help_settings -> List[Setting] specifies the list of help buttons for the settings.

Measurements

Before

Each module may require measurements made by a module earlier in the pipeline. These can be accessed through workspace.measurements.get_measurement(object_name: str, feature_name: str, image_set_number: Union[int, None] = None).

Feature names are strings separated by underscores, but are accessed in the user interface like a tree (e.g. in the ExportMeasurements module).

After

Each module makes one or more measurements, which are instances of HDF5Dict. The following API exists:

  1. get_measurement_columns -> List[Tuple[str, str, str]] specifies the measurements that will be made at the end of the module

Releases

No releases published

Packages

No packages published

Languages