{"id":50701974,"url":"https://github.com/goehringlab/par-segmentation","last_synced_at":"2026-06-09T09:33:07.330Z","repository":{"id":156381145,"uuid":"536200468","full_name":"goehringlab/par-segmentation","owner":"goehringlab","description":"Cell cortex segmentation and quantification in C. elegans PAR protein images","archived":false,"fork":false,"pushed_at":"2024-07-09T18:52:08.000Z","size":113974,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T19:21:35.278Z","etag":null,"topics":["binder","docker","image-analysis","image-segmentation","machine-learning","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goehringlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T15:52:09.000Z","updated_at":"2024-07-09T18:51:10.000Z","dependencies_parsed_at":"2024-06-29T18:37:51.583Z","dependency_job_id":"dc2d9795-0797-4b31-b316-28d2e7974791","html_url":"https://github.com/goehringlab/par-segmentation","commit_stats":{"total_commits":207,"total_committers":3,"mean_commits":69.0,"dds":0.3429951690821256,"last_synced_commit":"9345982a24347578e684aa611d6880451df4ae36"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/goehringlab/par-segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goehringlab%2Fpar-segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goehringlab%2Fpar-segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goehringlab%2Fpar-segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goehringlab%2Fpar-segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goehringlab","download_url":"https://codeload.github.com/goehringlab/par-segmentation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goehringlab%2Fpar-segmentation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34101065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binder","docker","image-analysis","image-segmentation","machine-learning","python","tensorflow"],"created_at":"2026-06-09T09:33:06.497Z","updated_at":"2026-06-09T09:33:07.319Z","avatar_url":"https://github.com/goehringlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PAR Segmentation\n\n[![CC BY 4.0][cc-by-shield]][cc-by]\n![TensorFlow](https://img.shields.io/badge/TensorFlow-FF6F00?style=flat\u0026logo=tensorflow\u0026logoColor=white)\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![Tests](https://github.com/goehringlab/par-segmentation/actions/workflows/test.yaml/badge.svg)](https://github.com/goehringlab/par-segmentation/actions/workflows/test.yaml)\n[![PyPi version](https://badgen.net/pypi/v/par-segmentation/)](https://pypi.org/project/par-segmentation)\n[![Documentation Status](https://readthedocs.org/projects/par-segmentation/badge/?version=latest)](https://par-segmentation.readthedocs.io/en/latest/?badge=latest)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/goehringlab/par-segmentation/HEAD?filepath=%2Fscripts/Tutorial.ipynb)\n[![codecov](https://codecov.io/gh/goehringlab/par-segmentation/branch/master/graph/badge.svg?token=QCFC9AWK0R)](https://codecov.io/gh/goehringlab/par-segmentation)\n\n\nTools for segmenting, straightening and quantifying the cortex of cells.\nWorks by combining spline-based segmentation with a custom quantification model, using a gradient descent optimisation procedure.\nDesigned primarily for membrane-bound PAR proteins in C. elegans zygotes.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/goehringlab/par-segmentation/master/scripts/Figs/animation.gif\" width=\"100%\" height=\"100%\"/\u003e\n\u003c/p\u003e\n\nAdvantages:\n\n- Combine segmentation and membrane quantification in a single step\n- No ground truth training data required\n- Works for single snapshots or timelapse movies\n\nDisadvantages:\n\n- Requires a small amount of manual annotation for every image\n- A little slow compared to some other segmentation methods \n\n\n## Instructions\n\nAs a first step, I would recommend checking out the [tutorial notebook](https://nbviewer.org/github/goehringlab/par-segmentation/blob/master/scripts/Tutorial.ipynb). This can be run in the cloud using Binder (please note that it may take several minutes to open the notebook):\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/goehringlab/par-segmentation/HEAD?filepath=%2Fscripts/Tutorial.ipynb)\n\nTo run locally, download the code and install the relevant requirements (requirements.txt) in a virtual environment.\n\n\n## Installation\n\nTo explore further and incorporate into your own analysis pipelines, you can install the package from PyPI using pip:\n\n    pip install par-segmentation\n\nDepending on the underlying model you chose to use, you may have to install additional dependencies:\n\n    pip install par-segmentation[tensorflow,jax]\n\nIf you want to make changes to the code, you can download/clone this repository, navigate to it, and run:\n\n    pip install -e .[all]\n\n## Methods\n\nStarting with an initial rough manual ROI of the cell edge, the cortex of the image is straightened (Step 1).\nThe program then attempts to mimic this straightened image by differentiable simulation (Step 2).\nIn doing so, it learns the position of the cortex, which enables the ROI to be adjusted (Step 3) and the cortex re-straightened.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/goehringlab/par-segmentation/master/docs/model schematic.png\" width=\"100%\" height=\"100%\"/\u003e\n\u003c/p\u003e\n\nCortex positions are modelled as a spline with a user-specified number of evenly spaced knots which are optimised by gradient descent:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/goehringlab/par-segmentation/master/scripts/Figs/spline.png\" width=\"80%\" height=\"80%\"/\u003e\n\u003c/p\u003e\n\nIn 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:\nan 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:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/goehringlab/par-segmentation/master/scripts/Figs/profiles.png\" width=\"100%\" height=\"100%\"/\u003e\n\u003c/p\u003e\n\nThe 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:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/goehringlab/par-segmentation/master/scripts/Figs/animation2.gif\" width=\"100%\" height=\"100%\"/\u003e\n\u003c/p\u003e\n\nAn additional model is included that can relax these assumptions if higher accuracy is required, see [here](https://github.com/goehringlab/par-segmentation/tree/master/docs/model_flexi.md)\n\n\n## Publications\n\nThis package has been used in the following publications: \n\n- [Optimized dimerization of the PAR-2 RING domain drives cooperative and selective membrane recruitment for robust feedback-driven cell polarization.](https://www.biorxiv.org/content/10.1101/2023.08.10.552581v1) BioRxiv (2023).\n\n- [Design principles for selective polarization of PAR proteins by cortical flows.](https://rupress.org/jcb/article/222/8/e202209111/214138/Design-principles-for-selective-polarization-of) Journal of Cell Biology (2023).\n\n- [Cleavage furrow-directed cortical flows bias mechanochemical pathways for PAR polarization in the C . elegans germ lineage.](https://www.biorxiv.org/content/10.1101/2022.12.22.521633v1.abstract) BioRxiv (2022).\n\n- [An analog sensitive allele permits rapid and reversible chemical inhibition of PKC-3 activity in C. elegans.](https://www.micropublication.org/journals/biology/micropub-biology-000610) Micropublication Biology (2022).\n\n- [SAIBR : A simple, platform-independent method for spectral autofluorescence correction.](https://journals.biologists.com/dev/article/149/14/dev200545/276004/SAIBR-a-simple-platform-independent-method-for) Development (2022).\n\n_To add your paper to this list, please use the issues form, or create a pull request_\n\n\n## License\n\nThis work is licensed under a\n[Creative Commons Attribution 4.0 International License][cc-by].\n\n[![CC BY 4.0][cc-by-image]][cc-by]\n\n[cc-by]: http://creativecommons.org/licenses/by/4.0/\n[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png\n[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoehringlab%2Fpar-segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoehringlab%2Fpar-segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoehringlab%2Fpar-segmentation/lists"}