haesleinhuepf / git-bob-bioimage-analysis-example

BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

[Analysis Request]: Counting nuclei #53

Open haesleinhuepf opened 1 month ago

haesleinhuepf commented 1 month ago

Bio-Image Analysis Support Request

Image Upload

📎 Drag & drop your microscopy image here (JPG, PNG, GIF, 512x512 or 1024x1024, 2D only).

human_mitosis

Analysis Goal

Python Tools

Note: Your images and the text you enter here may be sent to OpenAI's online serivce where we use a large language model to answer your request. Do not upload any data you cannot share openly. Also do not enter any private or secret information. By submitting this github issue, you confirm that you understand these conditions.

Once submitted, @haesleinhuepf will review and consult git-bob, an AI-assistant for bio-image analysis suggestions.

haesleinhuepf commented 1 month ago

git-bob think about this

github-actions[bot] commented 1 month ago

This message was generated by git-bob (version: 0.5.5, model: gpt-4o-2024-08-06, Run details), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

To address the request for segmenting nuclei and counting them using Voronoi-Otsu-Labeling in pyclesperanto, here is a code suggestion:

import numpy as np
import pyclesperanto as cle
from skimage.io import imread
import stackview

# Load the image
image = imread("path_to_your_image.jpg")

# Segment nuclei using Voronoi-Otsu-Labeling
labels = cle.voronoi_otsu_labeling(image, spot_sigma=2, outline_sigma=2)

# Visualize the result
stackview.animate_curtain(image, labels)

# Count the number of segmented nuclei
number_of_nuclei = labels.max()

print(f"Number of nuclei: {number_of_nuclei}")

Make sure to replace "path_to_your_image.jpg" with the actual path of the image file. This script will perform the requested segmentation and count the number of nuclei.

haesleinhuepf commented 1 month ago

Ok, cool! Download my image provided above and save it as "human_mitosis2.png" in the "data" folder. Then create a new notebook in the "notebooks" folder. The notebook contains the code above (with explanations in between) to process the downloaded image; make sure to use the right relative path from the notebook to the image.

git-bob implement this!

haesleinhuepf commented 1 month ago

Ok, let's try the same thing with pyclesperanto_prototype instead of pyclesperanto.

git-bob implement this