Skip to content

Commit 80feb8f

Browse files
authored
Feedback fixes (#58)
* Update plugin_convert.py * Update plugin_convert.py * Update plugin_convert.py * Update napari_cellseg3d_m1.yml * Fix memory allocation issue * Add debug info to stats * Add mini-stats test * TEMP Comment out image stats * Revert "TEMP Comment out image stats" This reverts commit fc73e5b. * Disable image deletion * Disable sphericity * Add sphericity * Add *.tiff as valid path everywhere * Fix tests and tif+tiff loading * Fix several test issues and inconsistencies * Update .gitignore * Move pydensecrf back to main repo * Update worker_inference.py * Update worker_inference.py * Update worker_inference.py * Reduce warning spam in stats * Update instance_segmentation.py * Update utils.py * Update instance_segmentation.py * Fix attr error in inference * Add artifact removal (#60) * WIP add artifact removal * Add utils and inference worker artifact removal * Fix issue with layer type in utils * Add better pbar and windowed artifact rem * Refactor results name to be more explicit * Add working pbar to Inference log * Reduce requirements * Fix spheric. test and import checking * Update worker_training.py * Update worker_training.py * macOS Silicon install (#59) * Remove itk temp * Update napari_cellseg3d_m1.yml * Update napari_cellseg3d_m1.yml * Remove duplicate imagecodecs * Update napari_cellseg3d_m1.yml * Remove imagecodecs TEMP * Fixing tests on M1 * Remove erroneous path in test * Update test_utils.py * Update test_utils.py * Changed python to 3.9 for ITK * Docs update * Minor docs tweaks * Update README.md * Update README.md * Update README.md * Update README.md * README and docs update * Labels stats notebook update * mv full plot to better name * Fix attr error in inference
1 parent dfefe03 commit 80feb8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2748
-460
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: |
5353
python -m pip install --upgrade pip
5454
python -m pip install setuptools tox tox-gh-actions
55-
# pip install git+https://github.com/kodalli/pydensecrf.git@master#egg=pydensecrf
55+
# pip install git+https://github.com/lucasb-eyer/pydensecrf.git@master#egg=pydensecrf
5656

5757
# this runs the platform-specific tests declared in tox.ini
5858
- name: Test with tox

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ notebooks/instance_test.ipynb
115115
*.prof
116116
/docs/_build/
117117
/docs/source/code/_autosummary/*.rst
118+
cov.syspath.txt
119+
napari_cellseg3d/dev_scripts/wandb
118120

119121
#include test data
120122
!napari_cellseg3d/_tests/res/test.tif
@@ -123,9 +125,7 @@ notebooks/instance_test.ipynb
123125
!napari_cellseg3d/_tests/res/wnet_test/*.tif
124126
!napari_cellseg3d/_tests/res/wnet_test/lab/*.tif
125127
!napari_cellseg3d/_tests/res/wnet_test/vol/*.tif
126-
cov.syspath.txt
127128

128129
#include docs images
129130
!docs/source/logo/*
130131
!docs/source/images/*
131-
napari_cellseg3d/dev_scripts/wandb

README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# napari-cellseg3D: a napari plug-in for direct 3D cell segmentation with deep learning
22

3-
43
<img src="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/838605d0-9723-4e43-83cd-6dbfe4adf36b/cellseg-logo.png?format=1500w" title="cellseg3d" alt="cellseg3d logo" width="350" align="right" vspace = "80"/>
54

65
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
@@ -10,23 +9,34 @@
109
[![codecov](https://codecov.io/gh/AdaptiveMotorControlLab/CellSeg3d/branch/main/graph/badge.svg?token=hzUcn3XN8F)](https://codecov.io/gh/AdaptiveMotorControlLab/CellSeg3d)
1110
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-cellseg3d)](https://www.napari-hub.org/plugins/napari-cellseg3d)
1211

13-
1412
A 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.
1513

14+
**Help us make the code better by reporting issues and adding your feature requests!**
15+
1616
----------------------------------
1717

1818
## News
1919

20-
*April 2023: New version with interface overhaul published ! New model and utilities coming soon*
20+
**New version : v1.0**
2121

22+
Added :
2223

23-
**This is an alpha version, please expect bugs and issues, and help us make the code better by reporting them as an issue!**
24+
- Improved training interface
25+
- Unsupervised model : WNet
26+
- Generate labels directly from raw data !
27+
- Can be trained in napari directly or in Colab
28+
- Pretrained weights for mesoSPIM whole-brain cell segmentation
29+
- WandB support (install wandb and login to use automatically when training)
30+
- Remade and improved documentation
31+
- Moved to Jupyter Book
32+
- Dedicated installation page, and working ARM64 install for macOS Silicon users
33+
- New utilities
34+
- Many small improvements and many bug fixes
2435

2536
## Demo
2637

2738
![demo](https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/0d16a71b-3ff2-477a-9d83-18d96cb1ce28/full_demo.gif?format=500w)
2839

29-
3040
## Installation
3141

3242
**Note** : we recommend using conda to create a new environment for the plugin.
@@ -58,14 +68,15 @@ To avoid issues when installing on the ARM64 architecture, please follow these s
5868
conda env create -f conda/napari_cellseg3d_m1.yml
5969
conda activate napari_cellseg3d_m1
6070

61-
2) Then install PyQt5 from conda separately :
71+
2) Install the plugin.
72+
From repository root folder, run :
6273

63-
conda install -c anaconda pyqt
64-
65-
3) And install the plugin :
74+
pip install -e .
75+
OR directly via PyPi :
6676

6777
pip install napari-cellseg3d
6878

79+
OR directly via [napari-hub] (see Installation section above)
6980

7081
## Documentation
7182

@@ -86,21 +97,21 @@ Then go into Plugins > napari-cellseg3d, and choose which tool to use.
8697
- **Train**: This module allows you to train segmentation algorithms from labeled volumes.
8798
- **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.
8899

89-
90100
## Requirements
91-
**Python >= 3.8 required**
92101

93-
Requires **pytorch** and **MONAI**.
94-
For PyTorch, please see [PyTorch's website for installation instructions].
102+
**Python 3.8 or 3.9 required.**
103+
Requires **[napari]**, **[PyTorch]** and **[MONAI]**.
104+
105+
For PyTorch, please see [the PyTorch website for installation instructions].
106+
95107
A CUDA-capable GPU is not needed but very strongly recommended, especially for training.
96-
If you get errors from MONAI regarding missing readers, please see [MONAI's optional dependencies] page for instructions on getting the readers required by your images.
97108

109+
If you get errors from MONAI regarding missing readers, please see [MONAI's optional dependencies] page for instructions on getting the readers required by your images.
98110

99111
## Issues
100112

101113
If you encounter any problems, please [file an issue] along with a detailed description.
102114

103-
104115
## Testing
105116

106117
To run tests locally:
@@ -134,20 +145,15 @@ Distributed under the terms of the [MIT] license.
134145
[Cookiecutter]: https://github.com/audreyr/cookiecutter
135146
[@napari]: https://github.com/napari
136147
[MIT]: http://opensource.org/licenses/MIT
137-
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
138-
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
139-
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
140-
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
141-
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
142148
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
143-
144-
[napari]: https://github.com/napari/napari
145149
[tox]: https://tox.readthedocs.io/en/latest/
146150
[pip]: https://pypi.org/project/pip/
147151
[PyPI]: https://pypi.org/
148152

149-
[PyTorch's website for installation instructions]: https://pytorch.org/get-started/locally/
153+
[the PyTorch website for installation instructions]: https://pytorch.org/get-started/locally/
154+
[PyTorch]: https://pytorch.org/get-started/locally/
150155
[MONAI's optional dependencies]: https://docs.monai.io/en/stable/installation.html#installing-the-recommended-dependencies
156+
[MONAI]: https://docs.monai.io/en/stable/installation.html#installing-the-recommended-dependencies
151157

152158
## Acknowledgements
153159

@@ -156,12 +162,5 @@ This work was funded, in part, from the Wyss Center to the [Mathis Laboratory of
156162
Please refer to the documentation for full acknowledgements.
157163

158164
## Plugin base
159-
This [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.
160165

161-
<!--
162-
Don't miss the full getting started guide to set up your new package:
163-
https://github.com/napari/cookiecutter-napari-plugin#getting-started
164-
165-
and review the napari docs for plugin developers:
166-
https://napari.org/plugins/stable/index.html
167-
-->
166+
This [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.

conda/napari_cellseg3d_m1.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ channels:
44
- conda-forge
55
- defaults
66
dependencies:
7-
- python=3.8
7+
- python=3.9
88
- pip
9+
- pyqt
10+
- imagecodecs
911
- pip:
1012
- numpy
1113
- napari>=0.4.14
12-
- QtPy
1314
- opencv-python>=4.5.5
1415
- scikit-image>=0.19.2
1516
- matplotlib>=3.4.1
1617
- tifffile>=2022.2.9
1718
- imageio-ffmpeg>=0.4.5
1819
- torch>=1.11
19-
- monai>=0.9.0
20+
- monai[nibabel, einops]>=0.9.0
2021
- tqdm
2122
- nibabel
2223
- scikit-image
2324
- pillow
25+
- pyclesperanto-prototype
2426
- tqdm
2527
- matplotlib
2628
- vispy>=0.9.6

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ logo: source/logo/logo_alpha.png
88
# Force re-execution of notebooks on each build.
99
# See https://jupyterbook.org/content/execute.html
1010
execute:
11-
execute_notebooks: force
11+
execute_notebooks: 'off'
1212

1313
# Define the name of the latex output file for PDF builds
1414
latex:

docs/source/guides/installation_guide.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ In the terminal, navigate to the CellSeg3D folder:
9090

9191
.. code-block::
9292
93+
cd CellSeg3D
9394
conda env create -f conda/napari_cellseg3d_m1.yml
9495
9596
3. **Activate the environment** :
@@ -98,14 +99,14 @@ In the terminal, navigate to the CellSeg3D folder:
9899
99100
conda activate napari_cellseg3d_m1
100101
101-
4. **Install PyQt5 via conda** :
102+
4. **Install the plugin** :
102103

103104
.. code-block::
104105
105-
conda install -c anaconda pyqt
106+
pip install napari-cellseg3d
106107
107-
5. **Install the plugin** :
108+
OR to install from source:
108109

109110
.. code-block::
110111
111-
pip install napari-cellseg3d
112+
pip install -e .

docs/welcome.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ Use CellSeg3D to:
1111
* Review labeled cell volumes from whole-brain samples of mice imaged by mesoSPIM microscopy [1]_
1212
* Train and use segmentation models from the MONAI project [2]_ or implement your own custom 3D segmentation models using PyTorch.
1313

14-
No labeled data? Try our unsupervised model to automate your data labelling.
14+
No labeled data? Try our unsupervised model, based on the `WNet`_ model, to automate your data labelling.
1515

1616
The models provided should be adaptable to other tasks related to detection of 3D objects,
1717
outside of whole-brain light-sheet microscopy.
18+
This applies to the unsupervised model as well, feel free to try to generate labels for your own data!
1819

1920
.. figure:: https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/0d16a71b-3ff2-477a-9d83-18d96cb1ce28/full_demo.gif?format=500w
2021
:alt: CellSeg3D demo
@@ -52,6 +53,7 @@ you need further assistance, please see below.
5253
Installation
5354
--------------------------------------------
5455
CellSeg3D can be run on Windows, Linux, or MacOS.
56+
5557
For detailed installation instructions, including installing pre-requisites,
5658
please see :ref:`source/guides/installation_guide:Installation guide ⚙`
5759

@@ -72,8 +74,6 @@ For local installation after cloning from GitHub, please run the following in th
7274
7375
If the installation was successful, you will find the napari-cellseg3D plugin in the Plugins section of napari.
7476

75-
76-
7777
Usage
7878
--------------------------------------------
7979

@@ -160,7 +160,7 @@ This plugin mainly uses the following libraries and software:
160160

161161
* `pyclEsperanto`_ (for the Voronoi Otsu labeling) by Robert Haase
162162

163-
* A custom re-implementation of the `WNet model`_ by Xia and Kulis [3]_
163+
* A custom re-implementation of the `WNet`_ by Xia and Kulis [3]_
164164

165165
.. _Mathis Laboratory of Adaptive Motor Control: http://www.mackenziemathislab.org/
166166
.. _Wyss Center: https://wysscenter.ch/
@@ -170,7 +170,7 @@ This plugin mainly uses the following libraries and software:
170170
.. _MONAI project: https://monai.io/
171171
.. _on their website: https://docs.monai.io/en/stable/networks.html#nets
172172
.. _pyclEsperanto: https://github.com/clEsperanto/pyclesperanto_prototype
173-
.. _WNet model: https://arxiv.org/abs/1711.08506
173+
.. _WNet: https://arxiv.org/abs/1711.08506
174174

175175
.. rubric:: References
176176

587 Bytes
Binary file not shown.
-2.01 MB
Binary file not shown.
-2.01 MB
Binary file not shown.

0 commit comments

Comments
 (0)