Package: napari-cellseg3d
napari-cellseg3D: a napari plug-in for direct 3D cell segmentation with deep learningA napari plugin for 3D cell segmentation: training, inference, and data review. In particular, this project was developed for analysis of mesoSPIM-acquired (cleared tissue + lightsheet) datasets.Help us make the code better by reporting issues and adding your feature requests!NewsNew version : v0.1.1Added :Improved training interfaceUnsupervised model : WNetGenerate labels directly from raw data !Can be trained in napari directly or in ColabPretrained weights for mesoSPIM whole-brain cell segmentationWandB support (install wandb and login to use automatically when training)Remade and improved documentationMoved to Jupyter BookDedicated installation page, and working ARM64 install for macOS Silicon usersNew utilitiesMany small improvements and many bug fixesDemoInstallationNote: we recommend using conda to create a new environment for the plugin.M1 Mac users, please see theM1 install sectionconda create --name napari-cellseg3d python=3.8
conda activate napari-cellseg3dYou can installnapari-cellseg3dviapip:pip install napari-cellseg3d[all]OR directly vianapari-hub:Install napari from pip withpip install "napari[all]",
then from the “Plugins” menu within the napari application, select “Install/Uninstall Package(s)...”Copynapari-cellseg3dand paste it where it says “Install by name/url…”Click “Install”Restart napariM1 Mac usersTo avoid issues when installing on the ARM64 architecture, please follow these steps.Create a new conda env using the provided conda/napari_cellseg3d_m1.yml file :git clone https://github.com/AdaptiveMotorControlLab/CellSeg3d.git
 cd CellSeg3d
 conda env create -f conda/napari_cellseg3d_m1.yml
 conda activate napari_cellseg3d_m1Install the plugin.
From repository root folder, run :pip install -e .OR directly via PyPi :pip install napari-cellseg3dOR directly vianapari-hub(see Installation section above)DocumentationAvailable athttps://AdaptiveMotorControlLab.github.io/CellSeg3dYou can also generate docs by runningmake htmlin the docs/ folder.UsageTo use the plugin, please run:napariThen go into Plugins > napari-cellseg3d, and choose which tool to use.Review: This module allows you to review your labels, from predictions or manual labeling, and correct them if needed. It then saves the status of each file in a csv, for easier monitoring.Inference: This module allows you to use pre-trained segmentation algorithms on volumes to automatically label cells and compute statistics.Train:  This module allows you to train segmentation algorithms from labeled volumes.Utilities: This module allows you to perform several actions like cropping your volumes and labels dynamically, by selecting a fixed size volume and moving it around the image; computing prediction scores from ground truth and predicition labels; or converting labels from instance to segmentation and the opposite.RequirementsPython 3.8 or 3.9 required.Requiresnapari,PyTorchandMONAI.For PyTorch, please seethe PyTorch website for installation instructions.A CUDA-capable GPU is not needed but very strongly recommended, especially for training.If you get errors from MONAI regarding missing readers, please seeMONAI's optional dependenciespage for instructions on getting the readers required by your images.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.TestingTo run tests locally:Locally : runpytestin the plugin folderLocally with coverage : In the plugin folder, runcoverage run --source=napari_cellseg3d -m pytestthencoverage xmlto generate a .xml coverage file.With tox : runtoxin the plugin folder (will simulate tests with several python and OS configs, requires substantial storage space)ContributingContributions are very welcome.Please ensure the coverage at least stays the same before you submit a pull request.For local installation from Github cloning, please run:pip install -e .LicenseDistributed under the terms of theMITlicense."napari-cellseg3d" is free and open source software.AcknowledgementsThis plugin was developed by Cyril Achard, Maxime Vidal, Mackenzie Mathis.
This work was funded, in part, from the Wyss Center to theMathis Laboratory of Adaptive Motor Control.
Please refer to the documentation for full acknowledgements.Plugin baseThisnapariplugin was generated withCookiecutterusing@napari'scookiecutter-napari-plugintemplate.