Running a standard analysis
Contents
Running a standard analysis#
Here we present all the steps of a standard workflow including segmentation and analysis.
Complete sequence#
1. Load the plugin#
Go to the plugins menu and choose the Steinpose plugin. You should see the plugin on the right of the window:
2. Folder selection#
Using the Select data folder
button, select a folder containig your mcd file(s). Using the Select output folder
, select a folder where to store the output.
Once a data folder is selected, a list of mcd files appears in the List of images
. If you select one of these files, it will load the image in the viewer, one channel per layer. If your mcd file contains multiple acquisitions or ROIs you can browse through them using the ROI slider.
3. Select channels for segmentation#
For segmentation, you need to select as set of channels to merge in order to create an image showing the “main” objects to segment, usually cells. You can also define a second image with “helper” objects, usually nuclei. You can select those channels in the Channels
tab. To select multiple channels, just hold the Ctrl
button. As soon as you select channels for main and helper objects, new layers called merged_cell
and merged_nuclei
are added to the viewer, showing you the combination of those channels. How the combination is made, can be controlled via the Projection type
selector.
To better visualize the merged images, you can turn off all other channels clicking on Show only merged channels
.
4. Segmentation#
To perform segmentation with cellpose, you need to adjust a few parameters:
In the
cellpose
section of theSegmentation
tab, , choose the type of model that you want to use. If you select acustom
model, you need to select the model file using theSelect custom cellpose model file
. If you use one of the built-in models, you need to set an estimated diameter. Note:It’s not required to define a second image (
Channels for nuclei
), so the selection can remain emptyIf you want to segment only nuclei in an image, you need to select the channels to compose the merged nuclei image in the “main objects” list and the merged image is still going to be called
marged_cell
.
In the
Options
tab, you can set additional options for segmentation:Set cellpose flow and cell tthreshold: to recover more cells, use high flow threshold (around 1). To recover larger cells, use low cell probability threshold (around -6)
Select if you want to remove cells touching the image border
Select by how many pixels you want to expand the segmented objects
5. Running the segmentation#
Head back to the Segmentation tab
. Now you can finally run the segmentation. If GPU processing is setup, tick the Use GPU
box. You can test the segmentation on a single image, by clicking on Run on current image
. This will run the segmentation only on the current ROI of the current image. Once processing is done, the segmentation is added as a mask
layer in the viewer.
If you want to run the analysis on all ROIs of all images click on Run on folder
. This will generate two folders in the output folder that you previously selected:
masks
contains all the segmentation images, one per ROI in uint16 formatimgs_proj
contaisn the merged images used for segmentation
widget._on_click_run_on_current()
widget._on_click_run_on_folder()
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 0
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 1
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 2
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 3
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 4
Running cellpose on 220525_segmentationkit_testonNASHmice.mcd acquisition 5
6. Post-processing#
You can analyze the segmentation using the steinbock software. Three types of data extraction can be selected using tick boxes as visible in the Export
tab:
intensities: the intensity of each segmented objects is measured in all available channels and exported as a table. The statistic applied to summarize intensity (mean, max etc.) can be selected
region properties: geometric properties of all segmented objects is measured and exported as as a table
neighbourhood: the neighbours of each object are detected and stored in a table
Once options are set, you can click on Run Steinbock postproc
. This will generate:
an
img
folder containing a tiff version of the mcd files. Note that with theHot pixel filter
options and threshold, you can perform hot pixel fitlering when exporting the imagesan
intensities
folder containing intensity tables (if selected)a
regionprops
folder containing region properties tables (if selected)a
neighbors
folder containing neighborhood tables (if selected)a
panel.csv
filean
images.csv
file
Note that you can automatically perform this post-processing after segmentation by ticking the Run steinbock post-processing
box in the Segmentation
tab.
Notes#
Reloading data#
If you select a data folder and an output folder containing a previous segmentation, when you select an image, this will display the merged images as well as the masks automatically.
Exporting a config file#
To avoid having to setup the same options repeatedly, you can export a set of seleted options as a small config.yml
file in the output folder. This will typically contain the selected channels for merging, the type of model, diameter etc. First, set all options, then head to the Options
tab and click on Export config
.
In order to re-use this config file:
Copy the
config.yml
file in a new empty folderSelect the data folder and select an image to display
Select the new folder containing the copied
config.yml
file as output folder and then click onImport config
in theOptions tab
. This will update a series of options. The reason why an image needs to be loaded in the viewer, is that the channel names are needed to re-use the same combination of channels to merge. Hence, you cannot re-use the configuration file, if you use an image with a different set of channels.