Skip to content

Commit

Permalink
Updated the documentation and the code (else statements)
Browse files Browse the repository at this point in the history
  • Loading branch information
sugan89 committed Feb 6, 2024
1 parent 0815ea5 commit e1925de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 8 additions & 8 deletions active_plugins/runilastik.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@
A note to the mac users - this module takes a longer time to run using the Docker.
The Docker that is used to run this module can be found here - https://hub.docker.com/layers/biocontainers/ilastik/1.4.0_cv2/images/sha256-0ccbca62d9efc63918d9de3b9b2bb5b1265a084f8b6410fd8c34e62869549791?context=explore
Links to the Docker containers,
biocontainers/ilastik:1.4.0_cv2 - https://hub.docker.com/layers/biocontainers/ilastik/1.4.0_cv2/images/sha256-0ccbca62d9efc63918d9de3b9b2bb5b1265a084f8b6410fd8c34e62869549791?context=explore
ilastik/ilastik-from-binary:1.4.0b13 - https://hub.docker.com/layers/ilastik/ilastik-from-binary/1.4.0b13/images/sha256-e3a4044a5ac6f2086f4bf006c8a95e2bd6a6fbfb68831bb4ba47baf2fafba988?context=explore
"""

#Link to the ilastik biocontainer. We should make changes in the module such that the user will be able to choose any ilastik docker they would like.
#ILASTIK_DOCKER is a dictionary where the keys are the names of the different docker containers and the values are the commands that are needed to run the respective docker container.
ILASTIK_DOCKER = {"biocontainers/ilastik:1.4.0_cv2":'/opt/ilastik-1.4.0-Linux/run_ilastik.sh','ilastik/ilastik-from-binary:1.4.0b13':'./run_ilastik.sh', "select your own":''}
#Another container that did not work - {'ilastik/ilastik-from-source:0.0.1a1':'. ~/.bashrc && python ilastik.py'}
#Docker container that did not work - {'ilastik/ilastik-from-source:0.0.1a1':'. ~/.bashrc && python ilastik.py'}


class Runilastik(ImageProcessing):
Expand Down Expand Up @@ -169,8 +170,7 @@ def visible_settings(self):

if self.docker_choice == "select your own":
vis_settings += [self.custom_docker_name, self.docker_executable]

if self.docker_or_local.value == "Local":
else:
vis_settings += [self.executable]

vis_settings += [self.x_name, self.y_name, self.project_file, self.project_type]
Expand All @@ -186,7 +186,7 @@ def validate_module_warnings(self, docker_or_local):
"Analysis mode will take a long time to run using Docker",
self.docker_or_local,
)
if self.docker_or_local.value == "Local":
else:
if self.executable.value[-4:] == ".exe":
raise ValidationError(
"Sorry, analysis will not run on Windows with the local installation of the ilastik. Please try Docker instead.",
Expand Down Expand Up @@ -240,15 +240,15 @@ def run(self, workspace):
ILASTIK_DOCKER_choice = self.custom_docker_name.value
ILASTIK_command = self.docker_executable.value

if not self.docker_choice.value == "select your own":
else:
ILASTIK_DOCKER_choice = self.docker_choice.value
ILASTIK_command = ILASTIK_DOCKER[ILASTIK_DOCKER_choice]

cmd = [f"{docker_path}", "run", "--rm", "-v", f"{temp_dir}:/data",
"-v", f"{model_directory}:/model",
f"{ILASTIK_DOCKER_choice}", f"{ILASTIK_command}", "--headless",
"--project", f"/model/{os.path.basename(model_file)}"
] # '"/opt/ilastik-1.4.0-Linux/run_ilastik.sh"' this command is specific to the ilastik biocontainer
]

if self.docker_or_local.value == "Local":

Expand Down
3 changes: 1 addition & 2 deletions documentation/CP-plugins-documentation/supported_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ Those plugins that do have extra documentation contain links below.
| HistogramEqualization | HistogramEqualization increases the global contrast of a low-contrast image or volume. Histogram equalization redistributes intensities to utilize the full range of intensities, such that the most common frequencies are more distinct. This module can perform either global or local histogram equalization. | No | | N/A |
| HistogramMatching | HistogramMatching manipulates the pixel intensity values an input image and matches them to the histogram of a reference image. It can be used as a way to normalize intensities across different 2D or 3D images or different frames of the same 3D image. It allows you to choose which frame to use as the reference. | No | | N/A |
| PixelShuffle | PixelShuffle takes the intensity of each pixel in an image and randomly shuffles its position. | No | | N/A |
| Predict | Predict allows you to use an ilastik pixel classifier to generate a probability image. CellProfiler supports two types of ilastik projects: Pixel Classification and Autocontext (2-stage). | No | | N/A |
| [RunCellpose](RunCellPose.md) | RunCellpose allows you to run Cellpose within CellProfiler. Cellpose is a generalist machine-learning algorithm for cellular segmentation and is a great starting point for segmenting non-round cells. You can use pre-trained Cellpose models or your custom model with this plugin. You can use a GPU with this module to dramatically increase your speed/efficiency. | Yes | `cellpose` | Yes |
| Runilastik | Runilasitk allows to run ilastik within CellProfiler. You can use pre-trained ilastik projects/models to predict the probability of your input images.| Yes | | Yes |
| Runilastik | Runilasitk allows to run ilastik within CellProfiler. You can use pre-trained ilastik projects/models to predict the probability of your input images. The plugin supports two types of ilastik projects: Pixel Classification and Autocontext (2-stage).| Yes | | Yes |
| RunImageJScript | RunImageJScript allows you to run any supported ImageJ script directly within CellProfiler. It is significantly more performant than RunImageJMacro, and is also less likely to leave behind temporary files. | Yes | `imagejscript` , though note that conda installation may be preferred, see [this link](https://py.imagej.net/en/latest/Install.html#installing-via-pip) for more information | No |
| RunOmnipose | RunOmnipose allows you to run Omnipose within CellProfiler. Omnipose is a general image segmentation tool that builds on Cellpose. | Yes | `omnipose` | No |
| RunStarDist | RunStarDist allows you to run StarDist within CellProfiler. StarDist is a machine-learning algorithm for object detection with star-convex shapes making it best suited for nuclei or round-ish cells. You can use pre-trained StarDist models or your custom model with this plugin. You can use a GPU with this module to dramatically increase your speed/efficiency. RunStarDist is generally faster than RunCellpose. | Yes | `stardist` | No |
Expand Down

0 comments on commit e1925de

Please sign in to comment.