Skip to content

Commit 98a600d

Browse files
Documentation updates (#562)
Documenation updates and final changes
1 parent ddbfcf7 commit 98a600d

13 files changed

+72
-94
lines changed

build_doc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import argparse
22
import glob
33
import os
4+
import warnings
5+
46
from subprocess import run
57

68

@@ -16,7 +18,7 @@ def check_docs_completeness():
1618
all_doc_files = markdown_doc_files + rst_doc_files
1719
missing_from_docs = [f for f in all_doc_files if os.path.basename(f) not in micro_sam.__doc__]
1820
if len(missing_from_docs) > 0:
19-
raise RuntimeError(
21+
warnings.warn(
2022
"Documentation files missing! Please add include statements "
2123
"to the docstring in micro_sam/__init__.py for every file, eg:"
2224
"'.. include:: ../doc/filename.md'. "

doc/annotation_tools.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,20 @@ of mitochondria in volume EM (middle) and interactive tracking of cells (right).
88
<img src="https://github.com/computational-cell-analytics/micro-sam/assets/4263537/dfca3d9b-dba5-440b-b0f9-72a0683ac410" width="256">
99
<img src="https://github.com/computational-cell-analytics/micro-sam/assets/4263537/aefbf99f-e73a-4125-bb49-2e6592367a64" width="256">
1010

11-
The annotation tools can be started from the `micro_sam` GUI, the command line or from python scripts. The `micro_sam` GUI can be started by
12-
```
13-
$ micro_sam.annotator
14-
```
11+
The annotation tools can be started from the napari plugin menu, the command line or from python scripts.
12+
They are built as napari plugin and make use of existing napari functionality wherever possible. If you are not familiar with napari yet, [start here](https://napari.org/stable/tutorials/fundamentals/quick_start.html).
13+
The `micro_sam` tools mainly use [the point layer](https://napari.org/stable/howtos/layers/points.html), [shape layer](https://napari.org/stable/howtos/layers/shapes.html) and [label layer](https://napari.org/stable/howtos/layers/labels.html).
1514

16-
They are built using [napari](https://napari.org/stable/) and [magicgui](https://pyapp-kit.github.io/magicgui/) to provide the viewer and user interface.
17-
If you are not familiar with napari yet, [start here](https://napari.org/stable/tutorials/fundamentals/quick_start.html).
18-
The `micro_sam` tools use [the point layer](https://napari.org/stable/howtos/layers/points.html), [shape layer](https://napari.org/stable/howtos/layers/shapes.html) and [label layer](https://napari.org/stable/howtos/layers/labels.html).
15+
The annotation tools are explained in detail below. We also provide [video tutorials](TODO).
1916

20-
The annotation tools are explained in detail below. In addition to the documentation here we also provide [video tutorials](https://www.youtube.com/watch?v=ket7bDUP9tI&list=PLwYZXQJ3f36GQPpKCrSbHjGiH39X4XjSO).
17+
The annotation tools can be started from the napari plugin menu:
18+
<img src="https://raw.githubusercontent.com/computational-cell-analytics/micro-sam/master/doc/images/napari-plugin.png">
2119

2220

23-
## Starting via GUI
24-
25-
The annotation toools can be started from a central GUI, which can be started with the command `$ micro_sam.annotator` or using the executable [from an installer](#from-installer).
26-
27-
In the GUI you can select with of the four annotation tools you want to use:
28-
<img src="https://raw.githubusercontent.com/computational-cell-analytics/micro-sam/master/doc/images/micro-sam-gui.png">
29-
30-
And after selecting them a new window will open where you can select the input file path and other optional parameter. Then click the top button to start the tool. **Note: If you are not starting the annotation tool with a path to pre-computed embeddings then it can take several minutes to open napari after pressing the button because the embeddings are being computed.**
31-
3221
## Annotator 2D
3322

3423
The 2d annotator can be started by
35-
- clicking `2d annotator` in the `micro_sam` GUI.
24+
- clicking `Annotator 2d` in the plugin menu.
3625
- running `$ micro_sam.annotator_2d` in the command line. Run `micro_sam.annotator_2d -h` for details.
3726
- calling `micro_sam.sam_annotator.annotator_2d` in a python script. Check out [examples/annotator_2d.py](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/annotator_2d.py) for details.
3827

@@ -56,14 +45,13 @@ It contains the following elements:
5645

5746
Note that point prompts and box prompts can be combined. When you're using point prompts you can only segment one object at a time. With box prompts you can segment several objects at once.
5847

59-
Check out [this video](https://youtu.be/ket7bDUP9tI) for a tutorial for the 2d annotation tool.
48+
Check out [this video](TODO) for a tutorial for the 2d annotation tool.
6049

61-
We also provide the `image series annotator`, which can be used for running the 2d annotator for several images in a folder. You can start by clicking `Image series annotator` in the GUI, running `micro_sam.image_series_annotator` in the command line or from a [python script](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/image_series_annotator.py).
6250

6351
## Annotator 3D
6452

6553
The 3d annotator can be started by
66-
- clicking `3d annotator` in the `micro_sam` GUI.
54+
- clicking `Annotator 3d` in the plugin menu.
6755
- running `$ micro_sam.annotator_3d` in the command line. Run `micro_sam.annotator_3d -h` for details.
6856
- calling `micro_sam.sam_annotator.annotator_3d` in a python script. Check out [examples/annotator_3d.py](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/annotator_3d.py) for details.
6957

@@ -81,12 +69,13 @@ Most elements are the same as in [the 2d annotator](#annotator-2d):
8169

8270
Note that you can only segment one object at a time with the 3d annotator.
8371

84-
Check out [this video](https://youtu.be/PEy9-rTCdS4) for a tutorial for the 3d annotation tool.
72+
Check out [this video](TODO) for a tutorial for the 3d annotation tool.
73+
8574

8675
## Annotator Tracking
8776

8877
The tracking annotator can be started by
89-
- clicking `Tracking annotator` in the `micro_sam` GUI.
78+
- clicking `Annotator Tracking` in the plugin menu.
9079
- running `$ micro_sam.annotator_tracking` in the command line. Run `micro_sam.annotator_tracking -h` for details.
9180
- calling `micro_sam.sam_annotator.annotator_tracking` in a python script. Check out [examples/annotator_tracking.py](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/annotator_tracking.py) for details.
9281

@@ -105,7 +94,20 @@ Most elements are the same as in [the 2d annotator](#annotator-2d):
10594

10695
Note that the tracking annotator only supports 2d image data, volumetric data is not supported.
10796

108-
Check out [this video](https://youtu.be/Xi5pRWMO6_w) for a tutorial for how to use the tracking annotation tool.
97+
Check out [this video](TODO) for a tutorial for how to use the tracking annotation tool.
98+
99+
100+
## Image Series Annotator
101+
102+
TODO
103+
104+
We also provide the `image series annotator`, which can be used for running the 2d annotator for several images in a folder. You can start by clicking `Image series annotator` in the GUI, running `micro_sam.image_series_annotator` in the command line or from a [python script](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/image_series_annotator.py).
105+
106+
107+
## Finetuning Tool
108+
109+
TODO
110+
109111

110112
## Tips & Tricks
111113

doc/images/2d-annotator-menu.png

-13.7 KB
Loading

doc/images/3d-annotator-menu.png

-468 KB
Loading

doc/images/finetuning-menu.png

104 KB
Loading

doc/images/micro-sam-gui.png

-15.7 KB
Binary file not shown.

doc/images/napari-plugin.png

116 KB
Loading

doc/images/series-menu.png

82.5 KB
Loading

doc/installation.md

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
There are three ways to install `micro_sam`:
44
- [From mamba](#from-mamba) is the recommended way if you want to use all functionality.
5-
- [From source](#from-source) for setting up a development environment to use the latest version and be able to change and contribute to our software.
6-
- [From installer](#from-installer) to install without having to use mamba (supported platforms: Windows and Linux, only for CPU users).
5+
- [From source](#from-source) for setting up a development environment to use the development version and to change and contribute to our software.
6+
- [From installer](#from-installer) to install it without having to use mamba (supported platforms: Windows and Linux, only for CPU users).
77

88
## From mamba
99

@@ -17,21 +17,15 @@ You can follow the instructions [here](https://mamba.readthedocs.io/en/latest/in
1717
```
1818
$ mamba install -c conda-forge micro_sam
1919
```
20-
or you should create a new environment (here called `micro-sam`) via:
20+
or you can create a new environment (here called `micro-sam`) with it via:
2121
```
2222
$ mamba create -c conda-forge -n micro-sam micro_sam
2323
```
2424
if you want to use the GPU you need to install PyTorch from the `pytorch` channel instead of `conda-forge`. For example:
2525
```
2626
$ mamba create -c pytorch -c nvidia -c conda-forge micro_sam pytorch pytorch-cuda=12.1
2727
```
28-
You may need to change this command to install the correct CUDA version for your computer, see [https://pytorch.org/](https://pytorch.org/) for details.
29-
30-
You also need to install napari to use the annotation tool:
31-
```
32-
$ mamba install -c conda-forge napari pyqt
33-
```
34-
(We don't include napari in the default installation dependencies to keep the choice of rendering backend flexible.)
28+
You may need to change this command to install the correct CUDA version for your system, see [https://pytorch.org/](https://pytorch.org/) for details.
3529

3630

3731
## From source
@@ -64,32 +58,16 @@ $ mamba activate sam
6458
$ pip install -e .
6559
```
6660

67-
**Troubleshooting:**
68-
69-
- Installation on MAC with a M1 or M2 processor:
70-
- The pytorch installation from `environment_cpu.yaml` does not work with a MAC that has an M1 or M2 processor. Instead you need to:
71-
- Create a new environment: `mamba create -c conda-forge python pip -n sam`
72-
- Activate it va `mamba activate sam`
73-
- Follow the instructions for how to install pytorch for MAC via conda from [pytorch.org](https://pytorch.org/).
74-
- Install additional dependencies: `mamba install -c conda-forge napari python-elf tqdm`
75-
- Install SegmentAnything: `pip install git+https://github.com/facebookresearch/segment-anything.git`
76-
- Install `micro_sam` by running `pip install -e .` in this folder.
77-
- **Note:** we have seen many issues with the pytorch installation on MAC. If a wrong pytorch version is installed for you (which will cause pytorch errors once you run the application) please try again with a clean `mambaforge` installation. Please install the `OS X, arm64` version from [here](https://github.com/conda-forge/miniforge#mambaforge).
78-
- Some MACs require a specific installation order of packages. If the steps layed out above don't work for you please check out the procedure described [in this github issue](https://github.com/computational-cell-analytics/micro-sam/issues/77).
79-
80-
8161
## From installer
8262

8363
We also provide installers for Linux and Windows:
84-
- [Linux](https://owncloud.gwdg.de/index.php/s/hM1bQ108YmcwyDn)
85-
- [Windows](https://owncloud.gwdg.de/index.php/s/T1weJclOiYUUULE)
64+
- [Linux](TODO)
65+
- [Windows](TODO)
8666
<!---
8767
- [Mac](https://owncloud.gwdg.de/index.php/s/7YupGgACw9SHy2P)
8868
-->
8969

90-
**The installers are still experimental and not fully tested.** Mac is not supported yet, but we are working on also providing an installer for it.
91-
92-
If you encounter problems with them then please consider installing `micro_sam` via [mamba](#from-mamba) instead.
70+
The installers will not enable you to use a GPU, so if you have one then please consider installing `micro_sam` via [mamba](#from-mamba) instead. They will also not enable using the python library.
9371

9472
**Linux Installer:**
9573

@@ -102,6 +80,15 @@ To use the installer:
10280
- After the installation you can start the annotator with the command `.../micro_sam/bin/micro_sam.annotator`.
10381
- To make it easier to run the annotation tool you can add `.../micro_sam/bin` to your `PATH` or set a softlink to `.../micro_sam/bin/micro_sam.annotator`.
10482

83+
**Windows Installer:**
84+
85+
- Unpack the zip file you have downloaded.
86+
- Run the installer by double clicking on it.
87+
- Choose installation type: `Just Me(recommended)` or `All Users(requires admin privileges)`.
88+
- Choose installation path. By default it will be installed in `C:\Users\<Username>\micro_sam` for `Just Me` installation or in `C:\ProgramData\micro_sam` for `All Users`.
89+
- The installer will unpack all micro_sam files to the installation directory.
90+
- After the installation you can start the annotator by double clicking on `.\micro_sam\Scripts\micro_sam.annotator.exe` or with the command `.\micro_sam\Scripts\micro_sam.annotator.exe` from the Command Prompt.
91+
10592
<!---
10693
**Mac Installer:**
10794
@@ -112,12 +99,3 @@ https://www.makeuseof.com/how-to-disable-gatekeeper-mac/
11299
113100
TODO detailed instruction
114101
-->
115-
116-
**Windows Installer:**
117-
118-
- Unpack the zip file you have downloaded.
119-
- Run the installer by double clicking on it.
120-
- Choose installation type: `Just Me(recommended)` or `All Users(requires admin privileges)`.
121-
- Choose installation path. By default it will be installed in `C:\Users\<Username>\micro_sam` for `Just Me` installation or in `C:\ProgramData\micro_sam` for `All Users`.
122-
- The installer will unpack all micro_sam files to the installation directory.
123-
- After the installation you can start the annotator by double clicking on `.\micro_sam\Scripts\micro_sam.annotator.exe` or with the command `.\micro_sam\Scripts\micro_sam.annotator.exe` from the Command Prompt.

doc/start_page.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,41 @@
22

33
Segment Anything for Microscopy implements automatic and interactive annotation for microscopy data. It is built on top of [Segment Anything](https://segment-anything.com/) by Meta AI and specializes it for microscopy and other bio-imaging data.
44
Its core components are:
5-
- The `micro_sam` tools for interactive data annotation with [napari](https://napari.org/stable/).
5+
- The `micro_sam` tools for interactive data annotation, built as [napari](https://napari.org/stable/) plugin.
66
- The `micro_sam` library to apply Segment Anything to 2d and 3d data or fine-tune it on your data.
7-
- The `micro_sam` models that are fine-tuned on publicly available microscopy data.
7+
- The `micro_sam` models that are fine-tuned on publicly available microscopy data and that are available on [BioImage.IO](https://bioimage.io/#/).
88

9-
Our goal is to build fast and interactive annotation tools for microscopy data, like interactive cell segmentation from bounding boxes:
9+
Based on these components `micro_sam` enables fast interactive and automatic annotation for microscopy data, like interactive cell segmentation from bounding boxes:
1010

1111
![box-prompts](https://github.com/computational-cell-analytics/micro-sam/assets/4263537/d04cb158-9f5b-4460-98cd-023c4f19cccd)
1212

13-
`micro_sam` is under active development, but our goal is to keep the changes to the user interface and the interface of the python library as small as possible.
14-
On our roadmap for more functionality are:
15-
- Providing an installer for running `micro_sam` as a standalone application.
16-
- Releasing more and better finetuned models as well as the code for fine-tuning.
17-
- Integration of the finetuned models with [bioimage.io](https://bioimage.io/#/)
18-
- Implementing a napari plugin for `micro_sam`.
13+
`micro_sam` is now available as stable version 1.0 and we will not change its user interface significantly in the foreseeable future.
14+
We are still working on improving and extending its functionality. The current roadmap includes:
15+
- Releasing more and better finetuned models.
16+
- Integrating parameter efficient training and compressed models for faster fine-tuning.
17+
- Improving the 3D segmentation and tracking functionality.
1918

20-
If you run into any problems or have questions please open an issue on Github or reach out via [image.sc](https://forum.image.sc/) using the tag `micro-sam` and tagging @constantinpape.
19+
If you run into any problems or have questions please [open an issue]() or reach out via [image.sc](https://forum.image.sc/) using the tag `micro-sam`.
2120

2221

2322
## Quickstart
2423

25-
You can install `micro_sam` via conda:
24+
You can install `micro_sam` via mamba:
2625
```
27-
$ conda install -c conda-forge micro_sam napari pyqt
26+
$ mamba install -c conda-forge micro_sam
2827
```
29-
We also provide experimental installers for all operating systems.
30-
For more details on the available installation options check out [the installation section](#installation).
28+
We also provide installers for Windows and Linux. For more details on the available installation options check out [the installation section](#installation).
3129

32-
After installing `micro_sam` you can run the annotation tool via `$ micro_sam.annotator`, which opens a menu for selecting the annotation tool and its inputs.
33-
See [the annotation tool section](#annotation-tools) for an overview and explanation of the annotation functionality.
30+
After installing `micro_sam` you can start napari and select the annotation tool you want to use from `Plugins->Segment Anything for Microscopy`. Check out the [quickstart tutorial video](TODO) for a short introduction and [the annotation tool section](#annotation-tools) for details.
3431

35-
The `micro_sam` python library can be used via
32+
The `micro_sam` python library can be imported via
3633
```python
3734
import micro_sam
3835
```
39-
It is explained in more detail [here](#how-to-use-the-python-library).
40-
41-
Our support for finetuned models is still experimental. We will soon release better finetuned models and host them on zenodo.
42-
For now, check out [the example script for the 2d annotator](https://github.com/computational-cell-analytics/micro-sam/blob/master/examples/sam_annotator_2d.py#L62) to see how the finetuned models can be used within `micro_sam`.
36+
It is explained in more detail [here](#using-the-python-library).
4337

38+
We provide different finetuned models for microscopy that can be used within our tools or any other tool that supports Segment Anything. See [finetuned models](#finetuned-models) for details on the available models.
39+
You can also train models on your own data, see [here for details](#training-your-own-model).
4440

4541
## Citation
4642

0 commit comments

Comments
 (0)