Skip to main content

PAR Segmentation

CC BY 4.0 TensorFlow Black pre-commit Tests PyPi version Documentation Status Binder codecov

Tools for segmenting, straightening and quantifying the cortex of cells. Works by combining spline-based segmentation with a custom quantification model, using a gradient descent optimisation procedure. Designed primarily for membrane-bound PAR proteins in C. elegans zygotes.

Advantages:

  • Combine segmentation and membrane quantification in a single step
  • No ground truth training data required
  • Works for single snapshots or timelapse movies

Disadvantages:

  • Requires a small amount of manual annotation for every image
  • A little slow compared to some other segmentation methods

Instructions

As a first step, I would recommend checking out the tutorial notebook. This can be run in the cloud using Binder (please note that it may take several minutes to open the notebook):

Binder

To run locally, download the code and install the relevant requirements (requirements.txt) in a virtual environment.

Installation

To explore further and incorporate into your own analysis pipelines, you can install the package from PyPI using pip:

pip install par-segmentation

Depending on the underlying model you chose to use, you may have to install additional dependencies:

pip install par-segmentation[tensorflow,jax]

If you want to make changes to the code, you can download/clone this repository, navigate to it, and run:

pip install -e .[all]

Methods

Starting with an initial rough manual ROI of the cell edge, the cortex of the image is straightened (Step 1). The program then attempts to mimic this straightened image by differentiable simulation (Step 2). In doing so, it learns the position of the cortex, which enables the ROI to be adjusted (Step 3) and the cortex re-straightened.

Cortex positions are modelled as a spline with a user-specified number of evenly spaced knots which are optimised by gradient descent:

In the default model, cross-cortex intensity profiles at each position around the cortex are modelled as the sum of distinct cytoplasmic and membrane signal components: an error function and Gaussian function respectively, representing the expected shape of a step and a point convolved by a Gaussian point spread function (PSF) in one dimension:

The program learns the amplitude of these two components at each position around the cortex, so can serve as a quantification tool as well as a segmentation tool:

An additional model is included that can relax these assumptions if higher accuracy is required, see here

Publications

This package has been used in the following publications:

To add your paper to this list, please use the issues form, or create a pull request

License

This work is licensed under a Creative Commons Attribution 4.0 International License.

CC BY 4.0

Metadata

Release files for par-segmentation 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for par-segmentation 0.1.16
File Size Uploaded
par_segmentation-0.1.16.tar.gz 47.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for par-segmentation 0.1.16
File Interpreter ABI Platform
par_segmentation-0.1.16-py3-none-any.whl Python 3 none any Details

Total release size: 94.5 kB

Release files / par_segmentation-0.1.16.tar.gz

Download URL par_segmentation-0.1.16.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ee979f281e45dd23b5039edb2411d41ee51b7552b8718f284fbc93b4983a4dcf
BLAKE2b-256 checksum
How to use checksums
f630e2631ede830458fb25b9dcf19d5ffe57a0abdbdcde7f89e32794322ab831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / par_segmentation-0.1.16-py3-none-any.whl

Download URL par_segmentation-0.1.16-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95c8091c41bf9233bc630f85af8cf9c6dd5df2277dd61d90d9b14e942761c6e3
BLAKE2b-256 checksum
How to use checksums
c6ff6422dc057df1b3d2027229c28a11887373f7977ca02a896d14e064d2e19a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.16 This release

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page