Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs improvements #112

Merged
merged 26 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
689f7fc
Include jupyter notebooks in docs
ilan-theodoro Apr 17, 2024
e4b5d96
Added FIJI plugin submodule
ilan-theodoro Apr 17, 2024
1042778
Added benchmarks and parameters section
ilan-theodoro Apr 17, 2024
4f0b8f3
added missing docs dependency
JoOkuma Apr 22, 2024
e6c5bdc
Remove old symlink creation
ilan-theodoro Apr 22, 2024
df80791
Merge branch 'main' into docs-improvements
JoOkuma Apr 30, 2024
0076a1e
Reduce size of api_example.ipynb file
ilan-theodoro May 15, 2024
d452edb
Merge branch 'main' into docs-improvements
JoOkuma May 17, 2024
6551942
updates to `docs-improvement` PR (#57)
JoOkuma May 17, 2024
8b479f8
Merge branch 'main' into docs-improvements
JoOkuma Jun 11, 2024
26573be
added readme to docs
JoOkuma Jun 11, 2024
1f39210
minor style and ordering changes
JoOkuma Jun 11, 2024
c2a068a
improved ultrack docs intro
JoOkuma Jun 12, 2024
7629c2e
add citation
JoOkuma Jun 12, 2024
59d669a
added getting start docs
JoOkuma Jun 21, 2024
acf5083
updated workflow to test docs
JoOkuma Jun 21, 2024
fcdbfb0
including pandoc install
JoOkuma Jun 21, 2024
58bc233
fixing pandoc version
JoOkuma Jun 21, 2024
3b32252
added configuration documentation & others
JoOkuma Jun 21, 2024
6915e72
adding registration helper function
JoOkuma Jun 24, 2024
152691b
WIP optimizing docs section
JoOkuma Jun 24, 2024
dab22c9
ultrack tuning docs
JoOkuma Jun 25, 2024
ea5c6d5
removed docs testing branch setup
JoOkuma Jun 25, 2024
547a7be
fixing faq links
JoOkuma Jun 25, 2024
5c60e9b
Merge branch 'public/main' into docs-improvements
JoOkuma Jun 25, 2024
b12e9e6
fixing docs typo
JoOkuma Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'

- name: Pandoc install
uses: pandoc/actions/[email protected]
with:
version: 2.19

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ cython_debug/
examples/*/*
!examples/*/*.ipynb
!examples/*/*.yml
docs/source/examples

# ultrack files
metadata.toml
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "plugin-imagej"]
path = plugin-imagej
url = https://github.com/royerlab/ultrack-imagej
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The official documentation is available [here](https://royerlab.github.io/ultrac

These additional developer documentation are available:

- Parameter [configuration schema](ultrack/config/README.md).
- Parameter [configuration schema](docs/source/configuration.rst).
- Intermediate segmentation and tracking SQL database are [here](ultrack/core/README.md).

## Gurobi setup
Expand Down Expand Up @@ -92,8 +92,10 @@ Depending on the operating system, the gurobi library might be missing and you n

## Citing

If you use ultrack in your research, please cite the following paper:

```
@misc{bragantini2023ultrack,
@misc{bragantini2023ucmtracking,
title={Large-Scale Multi-Hypotheses Cell Tracking Using Ultrametric Contours Maps},
author={Jordão Bragantini and Merlin Lange and Loïc Royer},
year={2023},
Expand All @@ -102,3 +104,5 @@ Depending on the operating system, the gurobi library might be missing and you n
primaryClass={cs.CV}
}
```

And the respective auxiliary methods (e.g. Cellpose, napari, etc) depending on your usage.
29 changes: 29 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Building docs instructions

This assumes you have already cloned the repository and are in the root directory of the repository.

Go to the docs directory and install the requirements

```bash
cd docs
pip install '..[docs]'
```

Clean and build the docs with

```bash
make clean
make html
```

In Linux, open the generated html file with

```bash
xdg-open build/html/index.html
```

or in macOS

```bash
open build/html/index.html
```
27 changes: 27 additions & 0 deletions docs/source/_static/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
p {
line-height: 1.5; /* Adjust this value as needed */
margin-top: 5px; /* Space above each paragraph */
margin-bottom: 0px; /* Space below each paragraph */
}

li {
margin-top: 0px; /* Adjust this value as needed */
margin-bottom: 0px; /* Adjust this value as needed */
}

ul, ol {
margin-top: 0px; /* Margin around the list */
}

h1 {
margin-top: 40px;
}

h2 {
margin-top: 30px;
}

h3 {
margin-top: 20px;
font-size: 1.0em;
}
33 changes: 20 additions & 13 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
API
---
===

First, we provide a summary of the main functionalities of the package.
Then we provide detailed documentation of every public function of ultrack.

Object Oriented API
^^^^^^^^^^^^^^^^^^^

.. autosummary::

ultrack.Tracker

Core functionalities
^^^^^^^^^^^^^^^^^^^^

.. autosummary::

Expand All @@ -21,15 +26,23 @@ Core functionalities
.. 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
ultrack.imgproc.PlantSeg
ultrack.imgproc.detect_foreground
ultrack.imgproc.inverted_edt
ultrack.imgproc.normalize
ultrack.imgproc.robust_invert
ultrack.imgproc.tracks_properties
ultrack.imgproc.Cellpose
ultrack.imgproc.sam.MicroSAM
ultrack.imgproc.register_timelapse
ultrack.imgproc.flow.timelapse_flow

Exporting
^^^^^^^^^

.. autosummary::

Expand Down Expand Up @@ -57,15 +70,9 @@ Array utilities
Image processing utilities
==========================

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

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

.. autoclass:: ultrack.imgproc.plantseg.PlantSeg
.. automodule:: ultrack.imgproc
:members:
:imported-members:

.. automodule:: ultrack.imgproc.sam
:members:
Expand Down
34 changes: 24 additions & 10 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
CLI
---

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

.. click:: ultrack.cli.check_gurobi:check_gurobi_cli
:prog: ultrack check_gurobi

.. click:: ultrack.cli.clear_database:clear_database_cli
:prog: ultrack clear_database

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

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

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

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

.. click:: ultrack.cli.labels_to_edges:labels_to_contours_cli
:prog: ultrack labels_to_contours

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

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

.. 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
.. click:: ultrack.cli.server:server_cli
:prog: ultrack server
50 changes: 45 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@

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

if not os.path.exists("examples"):
os.symlink("../../examples", "examples", target_is_directory=True)

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

project = "ultrack"
copyright = "2023, Jordão Bragantini"
author = "Jordão Bragantini"
copyright = "2024, Jordão Bragantini"
author = "Jordão Bragantini, Ilan Theodoro & contributors"

# The title of the HTML documentation (appears in the sidebar)
html_title = "ultrack"

# The short title for the HTML documentation (appears in the navigation bar)
html_short_title = "ultrack"

# The full version, including alpha/beta/rc tags
release = libversion("ultrack")
Expand All @@ -30,7 +39,22 @@
# 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"]
extensions = [
"sphinx.ext.autodoc",
"sphinx_click.ext",
"sphinx_copybutton",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"nbsphinx",
"myst_parser",
"sphinx_gallery.load_style",
"sphinxcontrib.autodoc_pydantic",
]

source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand All @@ -45,18 +69,34 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme = "furo"

# 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"]

html_css_files = [
"css/style.css",
]

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

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

# Don't show class signature with the class' name.
# autodoc_class_signature = "separated"

# Pydantic auto-doc settings
autodoc_pydantic_model_show_json = False
autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_validator_summary = False
autodoc_pydantic_model_show_validator_members = False
autodoc_pydantic_model_show_field_summary = False
autodoc_pydantic_model_signature_prefix = "class"
autodoc_pydantic_field_list_validators = False
autodoc_pydantic_model_undoc_members = False
autodoc_pydantic_model_summary_list_order = "bysource"
autodoc_pydantic_model_member_order = "bysource"
35 changes: 35 additions & 0 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Configuration
-------------

The configuration is at the heart of ultrack, it is used to define the parameters for each step of the pipeline and where to store the intermediate results.
The `MainConfig` is the main configuration that contains the other configurations of the individual steps plus the data configuration.

The configurations are documented below, the parameters are ordered by importance, most important parameters are at the top of the list. Parameters that should not be changed in most of the cases are at the bottom of the list and contain a ``SPECIAL`` tag.

.. autosummary::

ultrack.config.MainConfig
ultrack.config.DataConfig
ultrack.config.SegmentationConfig
ultrack.config.LinkingConfig
ultrack.config.TrackingConfig

---------------

.. autopydantic_model:: ultrack.config.MainConfig

---------------

.. autopydantic_model:: ultrack.config.DataConfig

---------------

.. autopydantic_model:: ultrack.config.SegmentationConfig

---------------

.. autopydantic_model:: ultrack.config.LinkingConfig

---------------

.. autopydantic_model:: ultrack.config.TrackingConfig
15 changes: 15 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Examples
--------

.. include:: examples/README.rst
:start-line: 2
:end-line: 25

Notebooks
---------

.. nbgallery::
:maxdepth: 2
:glob:

examples/**/*
Loading
Loading