Here are some helpful cellprofiler plugins used by the Laboratory for Bio-Micro Devices at Brigham & Women's Hospital.
Download CellProfiler. Only CellProfiler 3 is supported for now.
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.
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.
Each custom module has to subclass cellprofiler.module.Module
. Three class attributes are required:
module_name: str
, the module namecategory: Union[str, List[str]]
, the category or categories the module can be classified intovariable_revision_number: int
, the version number
Each module contains one or more cellprofiler.setting.Setting
s, which are essentially key-value pairs. Settings can be stored anywhere within the module
, as long as the following API holds:
create_settings -> None
initializes settings and hooks up behavior with button.settings -> List[Setting]
specifies the order in which settings are serialized to and from the.cpproj
file.visible_settings -> List[Setting]
specifies the list of visible settings.help_settings -> List[Setting]
specifies the list of help buttons for the settings.
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).
Each module makes one or more measurements, which are instances of HDF5Dict
. The following API exists:
get_measurement_columns -> List[Tuple[str, str, str]]
specifies the measurements that will be made at the end of the module