Skip to content

Commit

Permalink
Major refactor of files organization (#15)
Browse files Browse the repository at this point in the history
* add export to trackmate format

* add to_trackmate to __init__.py main

* made to_trackmate compatible with fiji trackmate reader

* added pytrackmate to tox testenv dependencies

* refactoring tracks aux function organization and function naming

* bumped version

* moved add flow field func

* fixed flow tests

* refactored overwriting and store utilities

* simplified labels to edges array creation

* created utils.array with array utilities that were spread

* added plantseg & microsam tests

* added cellpose tests

* removed from __init__ files that depend on torch

* torch is no longer optional

* fixing flow and cellpose tests

* updated zebrahub demo

* updated stardist demo

* updated neuromast and zebrahub examples

* added badges to reademe

* updated multi color example

* starting documentation

* updated cli and api docs

* added first faq, added template to quickstart and index

* updated code and example documentations

* added docs github workflow

* testing docs workflow pr

* added flow to 'track' main function

* fixed docs workflow install

* updated pyproject dependency

* added missings docs source and updatedependenceis

* added tracks length and update doc

* updated micro sam example

* fix widget import

* added link validation widget / function

* improved tribolium documentation

* updating segmentation engine connection frequency

* reducing test flow precision

* updating docs to only run on main

* added citation to quickstart guide

* making flow field tests looser

* uploaded multi-color-ensemble data
  • Loading branch information
JoOkuma authored Sep 28, 2023
1 parent 6cede25 commit aa47dae
Show file tree
Hide file tree
Showing 85 changed files with 4,072 additions and 3,714 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and deploy docs

on:
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[docs]"
- name: Set environment
run: |
REPO_OWNER="${GITHUB_REPOSITORY%%/*}"
REPO_NAME="${GITHUB_REPOSITORY#*/}"
echo "GITHUB_PAGES_URL=https://$REPO_OWNER.github.io/$REPO_NAME" >> $GITHUB_ENV
- name: Build the docs
working-directory: ./docs
run: |
echo $GITHUB_PAGES_URL
make html
touch build/html/.nojekyll
- name: Upload build artifacts
uses: actions/upload-pages-artifact@v1
with:
path: './docs/build/html'

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@

# ULTRACK

Cell tracking and segmentation software.
![tests](https://github.com/royerlab/ultrack/actions/workflows/test_pull_request.yml/badge.svg)
[![codecov](https://codecov.io/gh/royerlab/ultrack/branch/main/graph/badge.svg?token=9FFo4zNtYP)](https://codecov.io/gh/royerlab/ultrack)
[![PyPI version](https://badge.fury.io/py/ultrack.svg)](https://badge.fury.io/py/ultrack)
[![Downloads](https://pepy.tech/badge/ultrack)](https://pepy.tech/project/ultrack)
[![Downloads](https://pepy.tech/badge/ultrack/month)](https://pepy.tech/project/ultrack)
[![Python version](https://img.shields.io/pypi/pyversions/ultrack)](https://pypistats.org/packages/ultrack)
[![Licence: BSD-3](https://img.shields.io/github/license/royerlab/ultrack)](https://github.com/royerlab/ultrack/blob/main/LICENSE)
[![Contributors](https://img.shields.io/github/contributors-anon/royerlab/ultrack)](https://github.com/royerlab/ultrack/graphs/contributors)
[![GitHub stars](https://img.shields.io/github/stars/royerlab/ultrack?style=social)](https://github.com/royerlab/ultrack/)
[![GitHub forks](https://img.shields.io/github/forks/royerlab/ultrack?style=social)](https://git:hub.com/royerlab/ultrack/)

Large-scale cell tracking under segmentation uncertainty.

https://github.com/royerlab/ultrack/assets/21022743/10aace9c-0e0e-4310-a103-f846683cfc77

Expand Down Expand Up @@ -39,15 +49,15 @@ Usage examples can be found [here](examples), including their environment files

The `ultrack` library relies on a configuration schema, its description is [here](ultrack/config/README.md).

The segmentation and tracking data are stored in a SQL database, described [here](ultrack/core/README.md).
The segmentation and tracking data are stored in an SQL database, described [here](ultrack/core/README.md).

Helper functions to export to the cell tracking challenge and napari formats are available, [reference](ultrack/core/export).
Helper functions to export to the cell tracking challenge and napari formats are available [here](ultrack/core/export).

## Citing

```
@misc{bragantini2023ultrack,
title={Large-Scale Multi-Hypotheses Cell Tracking Using Ultrametric Contours Maps},
title={Large-Scale Multi-Hypotheses Cell Tracking Using Ultrametric Contours Maps},
author={Jordão Bragantini and Merlin Lange and Loïc Royer},
year={2023},
eprint={2308.04526},
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Empty file added docs/source/_static/.gitkeep
Empty file.
Empty file added docs/source/_templates/.gitkeep
Empty file.
88 changes: 88 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
API
---

Core functionalities

.. autosummary::

ultrack.track
ultrack.segment
ultrack.link
ultrack.solve
ultrack.add_flow
ultrack.load_config

.. could not make it work for ultrack.utils.array
Image processing utilities

.. autosummary::

ultrack.imgproc.segmentation.Cellpose
ultrack.imgproc.plantseg.PlantSeg
ultrack.imgproc.sam
ultrack.imgproc.flow

Exporting

.. autosummary::

ultrack.core.export.to_ctc
ultrack.core.export.to_trackmate
ultrack.core.export.to_tracks_layer
ultrack.core.export.tracks_to_zarr

====================
Core functionalities
====================

.. automodule:: ultrack
:members:
:imported-members:

===============
Array utilities
===============

.. automodule:: ultrack.utils.array
:members:

==========================
Image processing utilities
==========================

-------------------
DL models interface
-------------------

.. autoclass:: ultrack.imgproc.segmentation.Cellpose
:members:

.. autoclass:: ultrack.imgproc.plantseg.PlantSeg
:members:

.. automodule:: ultrack.imgproc.sam
:members:

----
Flow
----

.. automodule:: ultrack.imgproc.flow
:members:

================
Tracks utilities
================

.. automodule:: ultrack.tracks
:imported-members:
:members:

=========
Exporting
=========

.. automodule:: ultrack.core.export
:members:
:imported-members:
25 changes: 25 additions & 0 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CLI
---


.. click:: ultrack.cli.config:config_cli
:prog: ultrack create_config

.. click:: ultrack.cli.segment:segmentation_cli
:prog: ultrack segment

.. click:: ultrack.cli.flow:add_flow_cli
:prog: ultrack flow

.. click:: ultrack.cli.link:link_cli
:prog: ultrack link

.. click:: ultrack.cli.solve:solve_cli
:prog: ultrack solve

.. click:: ultrack.cli.export:export_cli
:prog: ultrack export
:nested: full

.. click:: ultrack.cli.clear_database:clear_database_cli
:prog: ultrack clear_database
62 changes: 62 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from importlib.metadata import version as libversion

sys.path.insert(0, os.path.abspath("../.."))

# -- Project information -----------------------------------------------------

project = "ultrack"
copyright = "2023, Jordão Bragantini"
author = "Jordão Bragantini"

# The full version, including alpha/beta/rc tags
release = libversion("ultrack")

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx_click.ext", "sphinx.ext.autosummary"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# -- AutoDoc configuration --------------------------------------------------

# Automatically extract typehints when specified and place them in
# descriptions of the relevant function/method.
autodoc_typehints = "description"

# Don't show class signature with the class' name.
# autodoc_class_signature = "separated"
5 changes: 5 additions & 0 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FAQ
---

**Q: What is each configuration parameters for?**
A: See the `configuration README <https://github.com/royerlab/ultrack/tree/main/ultrack/config>`_.
29 changes: 29 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. ultrack documentation main file
ultrack
=======

Large-scale cell tracking under segmentation uncertainty.

.. raw:: html

<video width="480" autoplay muted>
<source src="https://github.com/royerlab/ultrack/assets/21022743/10aace9c-0e0e-4310-a103-f846683cfc77" type="video/mp4">
Your browser does not support the video tag.
</video>

Zebrafish imaged using `DaXi <https://www.nature.com/articles/s41592-022-01417-2>`_ whole embryo tracking.

.. toctree::
:maxdepth: 2
:caption: Basics:

quickstart
theory
faq

.. toctree::
:caption: Reference:

api
cli
Loading

0 comments on commit aa47dae

Please sign in to comment.