|
61 | 61 | You can run this module using Cellpose installed to the same Python environment as CellProfiler. |
62 | 62 | See our documentation at https://plugins.cellprofiler.org/runcellpose.html for more information on installation. |
63 | 63 |
|
64 | | -Alternatively, you can run this module using Cellpose in a Docker that the module will automatically download for you so you do not have to perform any installation yourself. |
| 64 | +Alternatively, you can run this module using Cellpose in a Docker or Podman container that the module will automatically download for you so you do not have to perform any installation yourself. |
65 | 65 |
|
66 | 66 | On the first time loading into CellProfiler, Cellpose will need to download some model files from the internet. This |
67 | 67 | may take some time. If you want to use a GPU to run the model, you'll need a compatible version of PyTorch and a |
68 | 68 | supported GPU. Instructions are avaiable at this link: {CUDA_LINK} |
69 | 69 |
|
70 | | -Note that RunCellpose supports the Cellpose 3 functionality of using image restoration models to improve the input images before segmentation for both Docker and Python methods. |
| 70 | +Note that RunCellpose supports the Cellpose 3 functionality of using image restoration models to improve the input images before segmentation for both container and Python methods. |
71 | 71 | However, it only supports saving out or visualizing the intermediate restored images when using the Python method. |
72 | 72 |
|
73 | 73 | Stringer, C., Wang, T., Michaelos, M. et al. Cellpose: a generalist algorithm for cellular segmentation. Nat Methods 18, 100–106 (2021). {Cellpose_link} |
@@ -137,19 +137,20 @@ def create_settings(self): |
137 | 137 | text="Rescale images before running Cellpose", |
138 | 138 | value=True, |
139 | 139 | doc="""\ |
140 | | -Reminds the user that the normalization step will be performed to ensure suimilar segmentation behaviour in the RunCellpose |
| 140 | +Reminds the user that the normalization step will be performed to ensure similar segmentation behaviour in the RunCellpose |
141 | 141 | module and the Cellpose app. |
142 | 142 | """ |
143 | 143 | ) |
144 | 144 |
|
145 | 145 |
|
146 | 146 | self.docker_or_python = Choice( |
147 | | - text="Run CellPose in docker or local python environment", |
148 | | - choices=["Docker", "Python"], |
| 147 | + text="Run CellPose in a Docker/Podman container or local python environment", |
| 148 | + choices=["Docker", "Podman", "Python"], |
149 | 149 | value="Docker", |
150 | 150 | doc="""\ |
151 | 151 | If Docker is selected, ensure that Docker Desktop is open and running on your |
152 | | -computer. On first run of the RunCellpose plugin, the Docker container will be |
| 152 | +computer; likewise for Podman, ensure Podman Desktop is running. On first run |
| 153 | +of the RunCellpose plugin, the Docker container will be |
153 | 154 | downloaded. However, this slow downloading process will only have to happen |
154 | 155 | once. |
155 | 156 |
|
@@ -539,7 +540,7 @@ def visible_settings(self): |
539 | 540 | if self.cellpose_version.value == 'omnipose': |
540 | 541 | vis_settings += [self.omni] |
541 | 542 |
|
542 | | - if self.docker_or_python.value == "Docker": |
| 543 | + if self.docker_or_python.value in ["Docker","Podman"]: |
543 | 544 | if self.cellpose_version.value == 'omnipose': |
544 | 545 | vis_settings += [self.docker_image_omnipose] |
545 | 546 | elif self.cellpose_version.value == 'v2': |
@@ -936,9 +937,12 @@ def run(self, workspace): |
936 | 937 | if self.remove_edge_masks: |
937 | 938 | y_data = utils.remove_edge_masks(y_data) |
938 | 939 |
|
939 | | - elif self.docker_or_python.value == "Docker": |
940 | | - # Define how to call docker |
941 | | - docker_path = "docker" if sys.platform.lower().startswith("win") else "/usr/local/bin/docker" |
| 940 | + else: |
| 941 | + if self.docker_or_python.value == "Docker": |
| 942 | + # Define how to call docker |
| 943 | + docker_path = "docker" if sys.platform.lower().startswith("win") else "/usr/local/bin/docker" |
| 944 | + else: |
| 945 | + docker_path = "podman" if sys.platform.lower().startswith("win") else "/opt/podman/bin/podman" |
942 | 946 | # Create a UUID for this run |
943 | 947 | unique_name = str(uuid.uuid4()) |
944 | 948 | # Directory that will be used to pass images to the docker container |
@@ -1021,7 +1025,7 @@ def run(self, workspace): |
1021 | 1025 | workspace.display_data.denoised_image = denoised_image |
1022 | 1026 |
|
1023 | 1027 | if self.save_probabilities.value: |
1024 | | - if self.docker_or_python.value == "Docker": |
| 1028 | + if self.docker_or_python.value in ["Docker", "Podman"]: |
1025 | 1029 | # get rid of extra dimension |
1026 | 1030 | prob_map = numpy.squeeze(flows[1], axis=0) # ranges 0-255 |
1027 | 1031 | else: |
|
0 commit comments