Package: napari-serialcellpose
napari-serialcellposeThis napari plugin allows you to segment single images or series of images using built-in or custom Cellpose models as well as to analyze the properties of these segmented regions ("region properties"). Properties can be visualized for a single image or a complete experiment in the form of histograms that can also be filtered (e.g. based on area size, mean intensity etc.) Thanks to thenapari-skimage-regionpropsplugin, properties of segmented objects can be interactively explored at a single object level.Main goalThe main goal of this plugin is to simplify the classical image processing pipeline of image segmentation followed by region analysis via Cellpose. It allows to quickly get a quantification of a set of images without the need for any scripting.InstallationIn order to use this plugin, whe highly recommend to create a specific environment and to install the required software in it. You can create a conda environment using:conda create -n serialcellpose python=3.8.5 napari -c conda-forgeThen activate it and install the plugin:conda activate serialcellpose
pip install napari-serialcellposePotential issue with PyTorchCellpose and therefore the plugin and napari can crash without warning in some cases withtorch==1.12.0. This can be fixed by reverting to an earlier version using:pip install torch==1.11.0GPUIn order to use a GPU:Uninstall the PyTorch version that gets installed by default with Cellpose:pip uninstall torchMake sure your have up-to-date drivers for your NVIDIA card installed.Re-install a GPU version of PyTorch via conda using a command that you can findhere(this takes care of the cuda toolkit, cudnn etc. sono need to install manually anything more than the driver). The command will look like this:conda install pytorch torchvision cudatoolkit=11.3 -c pytorchPlugin UpdatesTo update the plugin, you only need to activate the existing environment and install the new version:conda activate serialcellpose
pip install napari-serialcellpose -UUsage: segmentationThe main interface is shown below. The sequence of events should be the following:Select a folder containing images. The list of files within that folder will appear in the area above. You can also just drag and drop a folder or an image in that area. When selecting an image, it gets displayed in the viewer. Images are opened viaaicsimageio. You can use grayscale images, RGB images or multi-channel images. In the latter case,make sure each channel opens as a separate layer when you open them using the napari-aicsimagio importer.If you want to save the segmentation and tables with properties, select a folder that will contain the output.Select the type of cellpose model.If you use a custom model, select its location.Run the analysis on the currently selected image or on all files in the folder.OptionsSelect if you want to use a GPU or not.If you are using multi-channel images, you can specify which channel to segment and optionally which to use as "nuclei" channel to help cell segmentation.In case you are using one of the built-in models, you can set the estimated diameter of your objects.In the Options tab you will find a few more options for segmentation, including the two thresholdsflow_thresholdandcellprob_threshold. You can also decide to discard objects touching the border. Using theSelect options yml fileyou can select a.ymlfile which contains a list of additional options to pass to theevalmethod of the Cellpose model.Note that options specified in the yml file will override options set in the GUI. The filemy_options.ymlis an example of such a file where for example thediameter(also available in the GUI) andresample(not available in the GUI) options are set.PropertiesAfter segmentation, properties of the objects can automatically be computed. You can select which properties should be computed in the Options tab. As defined innapari-skimage-regionpropsproperties are grouped by types. If you want to measure intensity properties such as mean intensity, you have to specify which channel (Analysis channel) you want to perform the measurement on.OutputThe results of the analysis are saved in the folder chosen in #2. The segmentation mask is saved with the same name as the original image with the suffix_mask.tif. A table with properties is saved in the subfoldertablesalso with the same name as the image with the suffixprops.csv. If you run the plugin on multiple files in a folder, asummary.csvfile is also generated which compiles all the data.Usage: post-processingAfter the analysis is done, when you select an image, the corresponding segmentation mask is shown on top of the image as shown below. This also works for saved segmentations: in that case you just select a folder with data and the corresponding output folder.PropertiesIf you head to thePropertiestab, you will find there two histograms showing the distribution of two properties that you can choose from a list at the top of the window. Below the plot you find the table containing information for each cell (each line is a cell).As shown below, if you select the boxshow selected, you can select items in the properties table and it will highlight the corresponding cell in the viewer. If you select the pipet tool, you can also select a cell and see the corresponding line in the table highlighted.SummaryFinally if you select theSummarytab, and click onLoad summary, it will load all data of the current output folder and create histograms of two properties that can be selected. An additional property can be used for filtering the data. Using the sliders, one can set a minimum and maximum threshold on the "filtering property", which will create a sub-selection of the data.DataSample data were acquired by Fabian Blank at the DBMR, University of Bern.LicenseDistributed under the terms of theBSD-3license,
"napari-serialcellpose" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.