diff --git a/docs/assets/extractor_1.png b/docs/assets/extractor_1.png new file mode 100644 index 0000000..291c343 Binary files /dev/null and b/docs/assets/extractor_1.png differ diff --git a/docs/assets/extractor_2.png b/docs/assets/extractor_2.png new file mode 100644 index 0000000..b170836 Binary files /dev/null and b/docs/assets/extractor_2.png differ diff --git a/docs/assets/segmentation_1.png b/docs/assets/segmentation_1.png new file mode 100644 index 0000000..b63c1e8 Binary files /dev/null and b/docs/assets/segmentation_1.png differ diff --git a/docs/assets/segmentation_2.png b/docs/assets/segmentation_2.png new file mode 100644 index 0000000..8e28b9d Binary files /dev/null and b/docs/assets/segmentation_2.png differ diff --git a/docs/howto.md b/docs/howto.md new file mode 100644 index 0000000..57aaf86 --- /dev/null +++ b/docs/howto.md @@ -0,0 +1,20 @@ + + +Microscopic images usually come with a large stack: many high-resolution slices! + +There are two ways to utilize this plugin over a large stack: + +- **One Model for All**: Training an RF model on a small sub-stack, then predicting over the entire stack. +- **Divide And Conquer**: Dividing the large stack into several sub-stacks, then train an RF model for each. + +## One Model For All +As for the first step, we recommend making a small sub-stack to train a Random Forest (RF) model using our plugin. This sub-stack can have about 20 slices selected across the whole stack (not just the beginning or last few slices). This way, when you extract and save the sub-stack's features, the storage file won't occupy too much space on the hard drive. + +!!! tip + If the image resolution is high, it's better to down-scale the images into a resolution of below 1200 pixels for the largest dimension. + +After the training, you can save the RF model, and later apply it on the entire stack. + +## Divide And Conquer +Extracted features saved as an `HDF5` file can take a very large space on disk. In this method, to prevent the disk space overflow, you can divide your large stack into several sub-stacks. Then use the plugin for each, separately. +Although, you can try one trained model over another sub-stack, Random Forest model can not be fine-tuned. By using this method, you can achieve better annotations with the expense of spending more time on training several models. diff --git a/docs/index.md b/docs/index.md index 69ac18e..b01e44b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,12 +4,21 @@ title: Welcome # Welcome to Feature Forest Documentation -Feature Forest (**FF**) is a *[napari]* plugin for creating image annotations with less manual work, utilizing image embeddings (*features*) of vision transformer models like *[SAM2]* and training a *Random Forest* model using a little scribble labels provided by the user. +Feature Forest (**FF**) is a [napari] plugin for creating image annotations with less manual work, utilizing image embeddings (*features*) of vision transformer models like [SAM2], and training a *Random Forest* model using a little scribble labels provided by the user. ### Overview -![figure 1](assets/fig1.png) +FF plugin includes two widgets: **Feature Extractor** and **Segmentation** widgets. +![Feature Extractor](assets/extractor_1.png){width="300"} +/// caption +Feature Extractor Widget +/// +![Feature Extractor](assets/segmentation_1.png){width="300" align=left} +![Feature Extractor](assets/segmentation_2.png){width="300" align=right} +/// caption +Segmentation Widget +/// [napari]: https://napari.org/ diff --git a/docs/install.md b/docs/install.md index 6adace5..fe27d73 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,7 +1,3 @@ ---- -title: Installation ---- - ## Easy Way! To install this plugin you need to use [mamba] or [conda] to create a environment and install the requirements. Use the commands below to create the environment and install the plugin: ```bash @@ -50,6 +46,11 @@ cd ./featureforest pip install . ``` -[PyPI]: https://pypi.org/ +There is also a [pypi package](https://pypi.org/project/featureforest/) available that you can install using `pip`: +```bash +pip install featureforest +``` + + [conda]: https://conda.io/projects/conda/en/latest/index.html [mamba]: https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html \ No newline at end of file diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 38e9256..3a28825 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,4 +1,13 @@ .md-typeset code { - font-size: 90%; + font-size: 91%; font-weight: 600; +} + +/* Maximum space for text block */ +.md-grid { + max-width: 71rem; +} + +.admonition>:last-child, html .md-typeset details>:last-child { + font-size: 0.72rem; } \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ee9bb97..aebd72c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,15 +1,9 @@ -site_name: Feature Forest Documents +site_name: Feature Forest Documentation site_url: https://juglab.github.io/featureforest extra_css: - stylesheets/extra.css theme: name: material - features: - - navigation.footer - - navigation.sections - - navigation.instant - - navigation.instant.progress - - content.code.copy # logo: assets/logo.png # favicon: images/favicon.png icon: @@ -34,6 +28,21 @@ theme: icon: material/brightness-7 name: Switch to dark mode + features: + - navigation.footer + - navigation.indexes + - navigation.sections + - navigation.instant + - navigation.instant.progress + - navigation.path + - navigation.top + - content.code.copy + +nav: + - Welcome: index.md + - Installation: install.md + - How to use the plugin: howto.md + extra: version: provider: mike @@ -49,6 +58,14 @@ markdown_extensions: anchor_linenums: true line_spans: __span pygments_lang_class: true + - admonition + - attr_list + - md_in_html - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences \ No newline at end of file + - pymdownx.superfences + - pymdownx.details + - pymdownx.blocks.caption + - def_list + - pymdownx.tasklist: + custom_checkbox: true \ No newline at end of file