diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/.dockstore.yml b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/.dockstore.yml new file mode 100644 index 0000000000..e51c75ebe2 --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/.dockstore.yml @@ -0,0 +1,12 @@ +version: 1.2 +workflows: +- name: main + subclass: Galaxy + publish: true + primaryDescriptorPath: /segmentation-and-counting.ga + testParameterFiles: + - /segmentation-and-counting-tests.yml + authors: + - name: Leonid Kostrykin + orcid: 0000-0003-1323-3762 + url: https://github.com/kostrykin/ diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/CHANGELOG.md b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/CHANGELOG.md new file mode 100644 index 0000000000..2169bdc88b --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## [0.1] - 2024-02-29 + +- Creation of workflow for segmentation and counting of cell nuclei in fluorescence microscopy images. diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/README.md b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/README.md new file mode 100644 index 0000000000..60d0a12344 --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/README.md @@ -0,0 +1,17 @@ +# Segmentation and counting of cell nuclei in fluorescence microscopy images + +This workflow performs segmentation and counting of cell nuclei using fluorescence microscopy images. The segmentation step is performed using Otsu thresholding (Otsu, 1979). The workflow is based on the tutorial: https://training.galaxyproject.org/training-material/topics/imaging/tutorials/imaging-introduction/tutorial.html + +![](test-data/overlay_image.png) + +## Inputs + +**`input_image`:** The fluorescence microscopy images to be segmented. Must be the single image channel, which contains the cell nuclei. + +## Outputs + +**`overlay_image`:** An overlay of the original image and the outlines of the segmentated objects, each also annotated with a unique number. + +**`objects_count`:** Table with a single column `objects` and a single row (the actual number of objects). + +**`label_image`:** The segmentation result (label map, which contains a unique label for each segmented object). diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting-tests.yml b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting-tests.yml new file mode 100644 index 0000000000..35facddc5d --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting-tests.yml @@ -0,0 +1,19 @@ +- doc: Test outline for segmentation-and-counting.ga + job: + input_image: + class: File + path: test-data/input_image.tiff + filetype: tiff + outputs: + overlay_image: + path: test-data/overlay_image.png + compare: sim_size + delta: 100 + objects_count: + path: test-data/objects_count.tabular + compare: diff + lines_diff: 0 + label_image: + path: test-data/label_image.tiff + compare: sim_size + delta: 100 diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting.ga b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting.ga new file mode 100644 index 0000000000..962daf4de0 --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/segmentation-and-counting.ga @@ -0,0 +1,343 @@ +{ + "a_galaxy_workflow": "true", + "annotation": "This workflow performs segmentation and counting of cell nuclei using fluorescence microscopy images. The segmentation step is performed using Otsu thresholding (Otsu, 1979). The workflow is based on the tutorial: https://training.galaxyproject.org/training-material/topics/imaging/tutorials/imaging-introduction/tutorial.html", + "creator": [ + { + "class": "Person", + "identifier": "https://orcid.org/0000-0003-1323-3762", + "name": "Leonid Kostrykin", + "url": "https://github.com/kostrykin/" + } + ], + "format-version": "0.1", + "license": "MIT", + "release": "0.1", + "name": "Segmentation and counting of cell nuclei in fluorescence microscopy images", + "steps": { + "0": { + "annotation": "The fluorescence microscopy images to be segmented. Must be the single image channel, which contains the cell nuclei.", + "content_id": null, + "errors": null, + "id": 0, + "input_connections": {}, + "inputs": [ + { + "description": "The fluorescence microscopy images to be segmented. Must be the single image channel, which contains the cell nuclei.", + "name": "input_image" + } + ], + "label": "input_image", + "name": "Input dataset", + "outputs": [], + "position": { + "left": 0, + "top": 123.6936084329719 + }, + "tool_id": null, + "tool_state": "{\"optional\": false, \"tag\": null}", + "tool_version": null, + "type": "data_input", + "uuid": "5dd476ec-c0d7-45af-a522-ba6b2ce43880", + "when": null, + "workflow_outputs": [] + }, + "1": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/0.0.3-3", + "errors": null, + "id": 1, + "input_connections": { + "input": { + "id": 0, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Filter 2D image", + "outputs": [ + { + "name": "output", + "type": "tiff" + } + ], + "position": { + "left": 320.6808544907898, + "top": 244.80388558482915 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/0.0.3-3", + "tool_shed_repository": { + "changeset_revision": "f70b215d155c", + "name": "2d_simple_filter", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"tiff\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"filter_type\": \"gaussian\", \"input\": {\"__class__\": \"ConnectedValue\"}, \"radius\": \"3\", \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.0.3-3", + "type": "tool", + "uuid": "e9384fa1-1948-4b67-95cd-987bb108f4d6", + "when": null, + "workflow_outputs": [] + }, + "2": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_histogram_equalization/ip_histogram_equalization/0.0.1-2", + "errors": null, + "id": 2, + "input_connections": { + "input": { + "id": 0, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Perform histogram equalization", + "outputs": [ + { + "name": "output", + "type": "tiff" + } + ], + "position": { + "left": 438.81238880324617, + "top": 9.67052833486391 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_histogram_equalization/ip_histogram_equalization/0.0.1-2", + "tool_shed_repository": { + "changeset_revision": "77f7159d775a", + "name": "2d_histogram_equalization", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"tiff\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"h_type\": \"clahe\", \"input\": {\"__class__\": \"ConnectedValue\"}, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.0.1-2", + "type": "tool", + "uuid": "06f11435-5172-4a40-8002-762d3d60ae46", + "when": null, + "workflow_outputs": [] + }, + "3": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.0.5-2", + "errors": null, + "id": 3, + "input_connections": { + "input": { + "id": 1, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Threshold image", + "outputs": [ + { + "name": "output", + "type": "tiff" + } + ], + "position": { + "left": 565.4531507696091, + "top": 243.376959571321 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.0.5-2", + "tool_shed_repository": { + "changeset_revision": "3df9f0a4bf34", + "name": "2d_auto_threshold", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"input\", \"block_size\": \"5\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"dark_bg\": true, \"input\": {\"__class__\": \"ConnectedValue\"}, \"th_method\": \"otsu\", \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.0.5-2", + "type": "tool", + "uuid": "88c61ddf-7751-41e3-b4a1-f0829969b5b2", + "when": null, + "workflow_outputs": [] + }, + "4": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/bfconvert/ip_convertimage/6.7.0+galaxy2", + "errors": null, + "id": 4, + "input_connections": { + "input_file": { + "id": 2, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Convert image format", + "outputs": [ + { + "name": "output", + "type": "tiff" + } + ], + "position": { + "left": 689.7987516288889, + "top": 0 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/bfconvert/ip_convertimage/6.7.0+galaxy2", + "tool_shed_repository": { + "changeset_revision": "85edbb7a436b", + "name": "bfconvert", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"tiff\", \"bigtiff\": false, \"channel_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"compression\": \"False\", \"crop_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"input_file\": {\"__class__\": \"ConnectedValue\"}, \"noflat\": true, \"out_format\": \"png\", \"pyramid_options\": {\"generate\": \"False\", \"__current_case__\": 1}, \"range_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"series_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"tile_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"timepoint_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"z_options\": {\"extract\": \"False\", \"__current_case__\": 0}, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "6.7.0+galaxy2", + "type": "tool", + "uuid": "8cc184c2-5e9d-42b2-9af1-3ba71030eda4", + "when": null, + "workflow_outputs": [] + }, + "5": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/binary2labelimage/ip_binary_to_labelimage/0.5+galaxy0", + "errors": null, + "id": 5, + "input_connections": { + "input": { + "id": 3, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Convert binary image to label map", + "outputs": [ + { + "name": "output", + "type": "tiff" + } + ], + "position": { + "left": 812.10278473575, + "top": 245.5611328413049 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/binary2labelimage/ip_binary_to_labelimage/0.5+galaxy0", + "tool_shed_repository": { + "changeset_revision": "984358e43242", + "name": "binary2labelimage", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"tiff\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"input\": {\"__class__\": \"ConnectedValue\"}, \"mode\": {\"mode_selector\": \"cca\", \"__current_case__\": 0}, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.5+galaxy0", + "type": "tool", + "uuid": "8e9ab2d1-f119-4cbd-8afc-175a2b99a1b9", + "when": null, + "workflow_outputs": [ + { + "label": "label_image", + "output_name": "output", + "uuid": "8296aad6-d5d9-427c-8a83-662b7ea47358" + } + ] + }, + "6": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/overlay_images/ip_overlay_images/0.0.4+galaxy0", + "errors": null, + "id": 6, + "input_connections": { + "method_option|im1": { + "id": 4, + "output_name": "output" + }, + "method_option|im2": { + "id": 5, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Overlay images", + "outputs": [ + { + "name": "out_png", + "type": "png" + } + ], + "position": { + "left": 1085.3470167429655, + "top": 104.58436042741572 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/overlay_images/ip_overlay_images/0.0.4+galaxy0", + "tool_shed_repository": { + "changeset_revision": "37662cbf44b8", + "name": "overlay_images", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"input\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"method_option\": {\"method\": \"seg_contour\", \"__current_case__\": 2, \"im1\": {\"__class__\": \"ConnectedValue\"}, \"im2\": {\"__class__\": \"ConnectedValue\"}, \"thickness\": \"2\", \"color\": \"#ff0000\", \"show_label\": true, \"label_color\": \"#ffff00\"}, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.0.4+galaxy0", + "type": "tool", + "uuid": "1f96ef1a-d94c-4a95-9148-106789d12355", + "when": null, + "workflow_outputs": [ + { + "label": "overlay_image", + "output_name": "out_png", + "uuid": "dd94858e-ce8c-4f89-9e31-5e4666887f2b" + } + ] + }, + "7": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/imgteam/count_objects/ip_count_objects/0.0.5-2", + "errors": null, + "id": 7, + "input_connections": { + "input": { + "id": 5, + "output_name": "output" + } + }, + "inputs": [], + "label": null, + "name": "Count objects in label map", + "outputs": [ + { + "name": "output", + "type": "tabular" + } + ], + "position": { + "left": 1086.8749834881503, + "top": 370.25000974083935 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/count_objects/ip_count_objects/0.0.5-2", + "tool_shed_repository": { + "changeset_revision": "b58447a2eed2", + "name": "count_objects", + "owner": "imgteam", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"tiff\", \"chromInfo\": \"/opt/galaxy/tool-data/shared/ucsc/chrom/?.len\", \"input\": {\"__class__\": \"ConnectedValue\"}, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_version": "0.0.5-2", + "type": "tool", + "uuid": "9bda49f1-24ec-42f8-bceb-ab54c56b6624", + "when": null, + "workflow_outputs": [ + { + "label": "objects_count", + "output_name": "output", + "uuid": "fd812c33-336d-4958-9877-b5b5b337f1d1" + } + ] + } + }, + "tags": [], + "uuid": "8c2d765b-2764-4b66-8542-adc2109c24f2", + "version": 10 +} diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/input_image.tiff b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/input_image.tiff new file mode 100644 index 0000000000..0321addb28 Binary files /dev/null and b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/input_image.tiff differ diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/label_image.tiff b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/label_image.tiff new file mode 100644 index 0000000000..bce30bc663 Binary files /dev/null and b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/label_image.tiff differ diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/objects_count.tabular b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/objects_count.tabular new file mode 100644 index 0000000000..1d8cebc77d --- /dev/null +++ b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/objects_count.tabular @@ -0,0 +1,2 @@ +objects +20 \ No newline at end of file diff --git a/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/overlay_image.png b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/overlay_image.png new file mode 100644 index 0000000000..1d8d5b3270 Binary files /dev/null and b/workflows/imaging/fluorescence-nuclei-segmentation-and-counting/test-data/overlay_image.png differ