Skip to content

Commit

Permalink
added more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mese79 committed Dec 2, 2024
1 parent 56ac690 commit de885f8
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 16 deletions.
Binary file added docs/assets/extractor_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/extractor_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/segmentation_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/segmentation_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/howto.md
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 11 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
11 changes: 6 additions & 5 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
11 changes: 10 additions & 1 deletion docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -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;
}
33 changes: 25 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
- pymdownx.superfences
- pymdownx.details
- pymdownx.blocks.caption
- def_list
- pymdownx.tasklist:
custom_checkbox: true

0 comments on commit de885f8

Please sign in to comment.