Segment circles

Dear Community,

How would I proceed to segment the following image by assigning circles of the same size to each “circle”?

YZ 256.tif (74.8 KB)

I have another topic open, which is a more complex question, and this here would be one of the steps I need for my quantification. Solving this would already be a good approximation for what I need.

Thanks!

Hi @NML,

I tried Fiji. Please find the attached screenshot.
These are the steps I followed,

  1. subtract background (20)
  2. Threshold
  3. Convert to Mask (binary)![Screenshot from 2020-05-25 21-54-03|389x500]
  4. Watershed


Hope this helps to start!!!

Regards,
Lakshmi
www.wakoautomation.com

It seems you hit the Reply button too early, before your images finished uploading. Would you mind editing your post and trying again? While editing, you can use in the preview to see how your post will look when posted.

1 Like

Hi @imagejan,

Thanks for pointing it out. I have uploaded the image.

Regards,
Lakshmi
www.wakoautomation.com

Hi both,

Thanks for your input. As I want to segment by fitting circles, this still does not do it. Also, by subtracting 20 to the background I lose a lot of relevant pixels - @lakshmi why would you want to do that?

Hi @NML,

Ok. I thought that you need to segment the circle objects in the image. That is why suggested a thresholding method. I am not sure which pixels are you missing by applying a subtracting background. Even without subtract background one can do the thresholding. Segmentation was better in your case (with subtract background).
Just to be clear, you mean to say that you have a circles separately (as a image/ ROI) & you want to use them in raw image and segment within the circles. Is this is what you mean by fitting circles? If so,
you can either use the circles as mask on the thresholded image.

Regards,
Lakshmi
www.wakoautomation.com

Hi @lakshmi

When I removed the background (by 20), my thresholded “circles” become smaller in area - as expected.

What I was after is for a way to roughly estimate the center of each circle and then adjust a circle with a forced diameter to that place. I would then force the diameter to be the same for all circle. Ideally, I could do this through an entire cross-section and reconstruct a 3D tube, but that’s a little more ambitious.

I wrote something, which kind of answers my own question, that looks into existing objects (already binary) and applies a circle with defined diameter to each:

d = 8; //diameter of circle in pixels
			run("Analyze Particles...", "add");
			particles = roiManager("count");
				for (i=0; i < particles; i++) {
				roiManager("Select", i);
				List.setMeasurements;
				x = List.getValue("X");
				y = List.getValue("Y");
				run("Specify...", "width=[d] height=[d] x=[x] y=[y] oval centered");
				setColor(255);
				fill();
  				}
			roiManager("Show None");
			//run("Flatten");
			run("8-bit");
			run("Watershed);
			roiManager("reset");
			saveAs("tiff", output_dir + title);

This can more or less do it. The idea is to combine with a solution that could take into account two channels (the circles and another structure that goes around them), - but that’s the subject which I had introduced on another topic.

Either way, thanks for your input.
All the best,
Nuno