Package: napari-steinpose
napari-steinposeThis napari plugin allows to segment and extract information from Imaging Mass Cytometry data by combining thecellposeandsteinbocktools.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 steinpose python=3.8.5 napari -c conda-forgeThen activate it and install the plugin:conda activate steinpose
pip install napari-steinposePotential 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 steinpose
pip install git+https://github.com/guiwitz/napari-steinpose.git -UUsageHere is a short summary on how to proceed to use the plugin. For more detailed information, please visitthis page.Load dataUsing the "Select data folder" button, select a folder containing your .mcd files. The contents of the folder will appear in the List of images box. When you select one of the files it is loaded in the viewer. Using the ROI spinpox, you can change the roi (or acquisition) to be visualized.SegmentationIn the channels tab, choose the combination of channels to use to define images to segment. You can choose what type of projection (mean, min etc.) is used to combine channels. You can either select channels defining both cells and nuclei or just a single channel.Note that if you want to just segment nuclei, you need to select them as "cell channel".To save the output, select a folder using the "Select output folder" button.In the segmentation tab, pick a cellpose model to use. If you use one of the built-in models, you can specify the average diameter of objects to detect.In the Options tab, you can set a few more options:cellpose options: you can adjust the flow threshold and cell probabilities. If cells are missing try to use higher values of flow threshold (close to 1) and lower values for the cell probabilities (around -6)segmentation options: you can decide to remove segmentation touching the image border, and you can also decide to expand the segmented objects by a fixed number of pixels. If a segmentation is displayed in the viewer, adjusting this parameter will live-adjust the mask.You can first test the segmentation using the "Run on current image" button. Once segmentation is done, the corresponding mask is displayed. You can then run the segmentation over all ROIs ofall .mcd filespresent in the folder by using the "Run on folder" button.Post-processingIn the Segmentation tab, if you tick the box "Run steinbock post-processing", information will directly be extracted from images and masks at the end of segmentation. Processing is done via steinbock and generates files compatible with further downstream processing.In the Export tab, you can select what type of information to export: object intensities, geometric properties and object neighbourhood. Note that if you have performed a segmentation without post-processing, you can still run post-processing using the "Run steinbock postproc" button.Saving settingsTo avoid having to re-type the same settings repeatedly, you can export a give configuration using the "Export config" button in the Options tab. This generates a human readable .yml file with:segmentation optionschannels selected for projectionsThe file is saved in the output folder. You can just copy the file in a new empty output folder to use it for an other analysis run. Once you select that folder containing a configuration file, you can import it with the "Import config" button.Note that you need to have an image opened so that channels can be selected properly.ContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of theBSD-3license,
"napari-steinpose" is free and open source softwareAuthorsThe author of this plugin is Guillaume Witz, Data Science Lab and Microscopy Imaging Center, University of Bern. This plugin is the result of a collaboration with the Imaging Mass Cytometry and Mass Cytometry Platform, University of Bern.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.