Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/user_docs/0_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If a raw image has two segmentations of the same cellular structure produced by

## 2. Training

:::{figure} images/training.png
:::{figure} images/Training-2.png
:::

This module allows users to train an ML 2D or 3D segmentation model **from scratch** or **fine-tune (iteratively)** an existing 2D or 3D segmentation model**--whether their own or a {ref}`pre-trained model provided by us<Pre-trained models>`--using their own data.
Expand All @@ -59,7 +59,7 @@ This module allows users to train an ML 2D or 3D segmentation model **from scrat

## 3. Prediction

:::{figure} images/prediction.png
:::{figure} images/Prediction.png
:::

This module allows users to apply the trained ML model from the previous step, or a pre-trained model, to generate segmentation predictions on raw images that the model has not previously seen.
Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/1_Get-started/3_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ A popup window will appear and you can select which model you would like to down

## 4. Select a model option to start

:::{figure} images/select-options.png
:::{figure} images/select-options-2.png
:width: 500px

Model options to select
Expand Down
8 changes: 3 additions & 5 deletions docs/user_docs/3_How-do-i/2-2_train-iterative.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ You can start training as soon as you have a {ref}`curation progress CSV saved<c

4. `Patch size`: input the approximated dimension of your structure of interest

- The input values must be multiples of 4 -- the fields will auto-correct to the closest value
- The input values must be multiples of 16 -- the fields will auto-correct to the closest value

5. `Model size`: this reflects the complexity of the model -- smaller model train faster while larger models train slower but may learn complex relationships better

6. `Number of epoch`: can start with a small value such as 10 to evaluate how quickly your computer can process each epoch

7. `Time out` (OPTIONAL): set up the model to stop training by a certain amount of time

8. Click `Start training`
7. Click `Start training`
- A progress dialog will pop up to display the current progress and the current loss value
- If a high value of epoch was entered, training may automatically stopped before it reaches the last epoch if the model can no long be improved

9. The plugin will notify you when the training is finished, together with the final loss value
8. The plugin will notify you when the training is finished, together with the final loss value
86 changes: 53 additions & 33 deletions docs/user_docs/3_How-do-i/3_use-prediction-thresholding.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ This module will generate both a {term}`probability map<Probability map image>`

## A. Run prediction

This action generates a probablity map of the predicted segmentation from a raw image.

:::{figure} images/Tab_prediction_1.png
{bdg-danger}`need updated version`
:::

This action generates a probablity map of the predicted segmentation from the raw image.

### a. Using on-screen image
### a. If using on-screen image

1. Load your raw image(s) by drag and drop them into the napari viewer
2. Select the correct channel of the raw image(s)
3. Select an output directory to store the probability map output
4. Run prediction
5. The probability map output will be automatically saved as it's generated and displayed on-screen
1. Select the option "On-screen image(s)"
2. Load your raw images by drag and drop them into the *napari* viewer
3. Select valid raw images which has been populated under the "On-screen image(s)" label
4. Select a channel of the raw images
5. Select an output directory to store the probability map output
6. Click {bdg-primary}`Run` to run prediction
7. The probability map output will be automatically saved as it's generated and displayed on-screen

### b. Using an image directory
### b. If using an image directory

1. Select a directory
2. Select the correct channel of the raw images within the selected directory
3. Run prediction - a popup modal will display a progress bar as prediction runs through the directory
4. The probability map outputs will be saved in the background as they're generated
1. Select the option "Image directory"
2. Click {bdg-primary}`Browse` to select a directory
3. Select a channel of the raw images within the selected directory
4. Click {bdg-primary}`Run` to run prediction - a popup modal will display a progress bar as the plugin works through the directory
5. The probability map outputs will be saved in the background as they're generated

:::{caution}
Cancelling a prediction run might take several minutes
:::
______________________________________________________________________

## B. Thresholding
Expand All @@ -42,29 +41,50 @@ This is because model prediction can be seen as a probability map where each pix

However, we encourage users to explore different threshold values using the threshold functionality of the plugin as for some applications it will be more appropriate to only segment the bright – higher probability regions. While in some cases a lower threshold will be much more meaningful to include the dim regions also at the cost of maybe over segmenting bright regions.

### a. Using on-screen image

1. Switch to the `Thresholding` tab
2. Select the probability map images generated from the previous step (Prediction)
3. Select a thresholding option and select appropriate value available within each option - the result will be generated live as you make adjustment
4. Once you're satisfied with a thresholding option/value, click to save your binary segmentation image

### b. Using an image directory

1. Switch to the `Thresholding` tab
2. Select the directory of the probability map images generated from the previous step (Prediction)
3. Click to run thresholding on the entire directory - a popup modal will display a progress bar as prediction runs through the directory
4. The binary segmentation outputs will be saved in the background as they're generated
:::{figure} images/Tab_thresholding.png
:alt: view of thresholding tab of Segmenter ML plugin in napari
:::

:::{warning}
If the signal-to-noise ratio in a segmentation result is low, the thresholding output might be empty.
### a. If using on-screen image

1. The plugin will auto-switch to the {bdg-secondary}`Thresholding` tab after the prediction is completed
:::{caution}
Switching back to {bdg-secondary}`Prediction` will clear out current on-screen images, please finish your interactions on this module before switching.
:::
2. Select the option "On-screen image(s)"
3. Select the newly generated probability map images populated under the "On-screen image(s)" label
4. Select an output directory to store the thresholded output
5. Select a thresholding option and select appropriate value available within each option - the thresholded result images will be updated in real time as you're making adjustments
6. Once you're satisfied with a thresholding option/value, click {bdg-primary}`Apply and Save` to save your thresholded images

### b. If using an image directory

1. The plugin will auto-switch to the {bdg-secondary}`Thresholding` tab after the prediction is completed
2. Select the option "Image directory"
3. Select the **subdirectory** `Seg` created by the plugin within the probability map output directory you've selected in the previous step
4. Select an output directory to store the thresholded output
5. Select a thresholding option and select appropriate value available within each option
6. Click {bdg-primary}`Apply and Save` to run thresholding - a popup modal will display a progress bar as the plugin works through the directory
7. The thresholded binary images will be saved in the background as they're generated
8. To review the generated thresholded images, drag and drop them into the *napari* viewer
- In *napari*'s Layer Control panel, adjust the "Contrast limits" range from 0-255 to 0-1 by sliding the right handle all the way to the left to correctly view the image
:::{figure} images/Thresholded-images_contrast-limits.png
:alt: adjust contrast limits of the thresholded result image to correctly view the image
:::

:::{tip}
Right-click on the slider bar to show the detailed view of the slider
:::

:::{caution}
- If the signal-to-noise ratio in a segmentation result is low, the thresholding output might be empty.
:::

______________________________________________________________________

## C. Next steps

If using the model you trained and you're satisfied with the model's performance, congratulations! You've successfully built a segmentation model tailored to your dataset. From now on, you can load this model throught the {ref}`"Select an existing model" workflow` and use it in your image analysis process.
If you're satisfied with the performance of a model you've trained, congratulations! You've successfully built a segmentation model tailored to your dataset. From now on, you can load this model throught the {ref}`"Select an existing model" workflow` and use it in your image analysis process.

If you are not satisfied with the model's performance, there multiple ways for the next steps:

Expand Down
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/user_docs/images/Training-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 removed docs/user_docs/images/Training.png
Binary file not shown.