Skip to content

Commit 6b7d315

Browse files
binliunlspre-commit-ci[bot]Bin Liu (SW-GPU)
authored
Cellprofiler app + plugin (#1724)
* first version of cellprofiler plugin Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add vista support Signed-off-by: binliu <[email protected]> * fix some issues Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update the plugin part Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix format Signed-off-by: binliu <[email protected]> * fix plugin doc Signed-off-by: binliu <[email protected]> * remove redundant imports Signed-off-by: binliu <[email protected]> * add the test case Signed-off-by: Bin Liu (SW-GPU) <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add mock test Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add unit test Signed-off-by: Bin Liu (SW-GPU) <[email protected]> * add readme for cellprofiler plugin Signed-off-by: binliu <[email protected]> * add the cellprofiler image Signed-off-by: binliu <[email protected]> * update readme file Signed-off-by: binliu <[email protected]> * remove the unnecessary file Signed-off-by: binliu <[email protected]> * fix import Signed-off-by: binliu <[email protected]> * add return Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update vista app readme Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * rename the vista app to vista2d app Signed-off-by: binliu <[email protected]> * fix vista to vista2d Signed-off-by: binliu <[email protected]> * fix the bundle name from cell_vista_segmentation to vista2d Signed-off-by: binliu <[email protected]> * add vista2d model Signed-off-by: binliu <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix readme issue Signed-off-by: binliu <[email protected]> --------- Signed-off-by: binliu <[email protected]> Signed-off-by: Bin Liu (SW-GPU) <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bin Liu (SW-GPU) <[email protected]>
1 parent 364c693 commit 6b7d315

File tree

17 files changed

+1335
-3
lines changed

17 files changed

+1335
-3
lines changed

docs/images/cellprofiler.jpg

330 KB
Loading
1020 KB
Loading

monailabel/tasks/infer/basic_infer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,10 @@ def _get_network(self, device, data):
467467
if path:
468468
checkpoint = torch.load(path, map_location=torch.device(device))
469469
model_state_dict = checkpoint.get(self.model_state_dict, checkpoint)
470-
471-
if set(self.network.state_dict().keys()) != set(checkpoint.keys()):
470+
if set(self.network.state_dict().keys()) != set(model_state_dict.keys()):
472471
logger.warning(
473472
f"Checkpoint keys don't match network.state_dict()! Items that exist in only one dict"
474-
f" but not in the other: {set(self.network.state_dict().keys()) ^ set(checkpoint.keys())}"
473+
f" but not in the other: {set(self.network.state_dict().keys()) ^ set(model_state_dict.keys())}"
475474
)
476475
logger.warning(
477476
"The run will now continue unless load_strict is set to True. "

monailabel/utils/others/modelzoo_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@
3232
"wholeBrainSeg_Large_UNEST_segmentation", # whole brain segmentation for T1 MRI brain images. Added Oct 2022
3333
"lung_nodule_ct_detection", # The first lung nodule detection task can be used for MONAI Label. Added Dec 2022
3434
"wholeBody_ct_segmentation", # The SegResNet trained TotalSegmentator dataset with 104 tissues. Added Feb 2023
35+
"vista2d", # The VISTA segmentation trained on a collection of 15K public microscopy images. Added Aug 2024
3536
]

plugins/cellprofiler/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!--
2+
Copyright (c) MONAI Consortium
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
-->
13+
14+
# MONAI Label Plugin for CellProfiler
15+
CellProfiler is a free open-source software designed to enable biologists without training in computer vision or programming to quantitatively measure phenotypes from thousands of images automatically.
16+
17+
CellProfiler is designed to serve biologists as well as bioimage analysts who want a flexible system that is easy to deploy to collaborators who lack computational skills. It is commonly used for small-scale experiments involving a few images but is also routinely run on millions of images using cluster or cloud computing resources at some of the largest pharmaceutical companies and academic screening centers in the world.
18+
19+
<img src="../../docs/images/cellprofiler.jpg" width=70% />
20+
21+
### Table of Contents
22+
- [Supported Applications](#supported-applications)
23+
- [Installing CellProfiler](#installing-cellprofiler)
24+
- [Install MONAI Label Extension](#install-monai-label-extension)
25+
- [Using the Plugin](#using-the-plugin)
26+
27+
### Supported Applications
28+
Users can find supported applications in the [sample-apps](../../sample-apps/vista2d/) folder and use the vista2d bundle. Currently, only this bundle can be used to create and refine labels for medical imaging tasks in CellProfiler.
29+
30+
### Installing CellProfiler
31+
32+
To use MONAILabel with CellProfiler, you first need to install CellProfiler from source code following the installation part of [CellProfiler WiKi](https://github.com/CellProfiler/CellProfiler/wiki). Once you have CellProfiler installed, you can install the MONAILabel plugin as shown in the `Install MONAI Label Extension` part.
33+
34+
Please note these tips when installing the software:
35+
1. After cloned the source code, you must switch to a specific version tag of the repo to start installation.
36+
1. For Macbooks with Apple Silicon, please note [this issue](https://github.com/CellProfiler/CellProfiler/issues/4932) before you start to install.
37+
1. Before actually running the command `pip install -e .`, you may need to install numpy if it doesn't exist in your environment.
38+
39+
### Install MONAI Label Extension
40+
1. Save the runvista2d.py file to a local path.
41+
1. Start CellProfiler from CLI, open the `File-->preferences` option and fill in the `CellProfiler plugin directory` parameter with your local path.
42+
43+
## Using the Plugin
44+
45+
1. Start the MONAI Label server with vista2d bundle.
46+
1. Add the `RunVISTA2D` module to your pipeline for object processing.
47+
1. Make sure the MONAILabel Server URL is correctly set in the plugin input.
48+
1. Click the `Analyse Images` or `Start Test Mode` button to execute the pipeline.
49+
1. Update masks and perform the sequential modules to get measurement results.
50+
51+
<img src="../../docs/images/cellprofiler_plugin.png" width=70% />
64.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)