-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
After selecting your image stack, you need to extract the *features*. Later, these image features will be used as inputs for training a Random Forest model, | ||
and predicting annotation masks. | ||
|
||
!!! info | ||
In deep learning, the output of an Encoder model is called <i>embeddings</i> or <i>features</i>. | ||
|
||
You can bring up the *Feature Extractor widget* from the napari **Plugins** menu: | ||
|
||
![plugins menu](assets/plugins_menu.png){width="360"} | ||
|
||
## Widget Tools Description | ||
![Feature Extractor](assets/extractor_widget/extractor.png){width="360"} | ||
|
||
1. **Image Layer**: To select your current image stack. | ||
2. **Encode Model**: Sets which model you want to use for feature extraction. | ||
The **FF** plugins, by default, comes with `MobileSAM`, `SAM (huge)`, `DINOv2`, `SAM2 (large)`, and `SAM2 (base)` models. It is also possible to introduce a new model by adding the [*model adapter*](link here) class. | ||
3. **Features Storage File**: Where you want to save the features as an `HDF5` file. | ||
4. **Extract Features** button: Will run the feature extraction process. | ||
5. **Stop** button: To stop the extraction process! | ||
|
||
The extraction process might take some time based on number of image slices and the image resolution. This is due to the fact that in **FF** we turn an image into overlapping patches, then pass those patches to the encoder model to get the features. Why we do this? We need to aquire a feature vector per each pixel and not for the whole image. | ||
|
||
## Model Selection | ||
Our experiments tell us usually the `SAM2 (large)` model works the best. However, for less complicated images, using `MobileSAM` or `DINOv2` might also result in a good segmentation as they are lighter and faster. | ||
|
||
!!! note | ||
When you use a model for the first time, the model's weight will be downloaded from their repository. So, you might hit a little delay at the first use of model. | ||
|
||
Once you have your image features extracted, you can use the [**Segmentation**](./segmentation.md) widget to generate your image masks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Hurray! Now you have your features extracted and ready for the main action! 😊 | ||
The Segmentation widget is a long widget with several panels, but don't worry we'll go through all of them, from top to bottom! | ||
|
||
## Inputs and Labels' statistics | ||
![Inputs](assets/segmentation_widget/seg_1.png){width="360" align=right} | ||
### Inputs | ||
1. **Input Layer**: To set which napari layer is your input image layer | ||
2. **Feature Storage**: Select your previously extracted features `HDF5` file here. | ||
***Note***: You need to select the storage file for this particular input image, obviously! | ||
3. **Ground Truth Layer**: To select your *Labels* layer | ||
4. **Add Layer** button: To add a new GT layer to napari layers | ||
|
||
### Labeling Statistics | ||
5. **Analyze** button: To get info about number of classes and labels you've added so far. | ||
|
||
!!! note | ||
- You can have as many *Labels* layer as you want. But **only the selected** one will be used for training the RF model. | ||
- You can also drag & drop your previously saved labels into the napari and select that layer. | ||
|
||
## Train Model | ||
![Inputs](assets/segmentation_widget/seg_2.png){width="360" align=left} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters