Problem with creating mask for 96 well plate



Hi, I am trying to create a mask for a 96 well plate that I need to analyze but I am having trouble making a mask that does not detect background interference. I just want the mask to select the holes of the 96 well plate, not the scruffy background additions that it seems to be picking up on.

Analysis goals

I am trying to make a mask for further image analysis
I have already tried adjusting the threshold values and the erode/ dilate options


With this mask how I would do it quickly is to dilate. Then invert. Use the analyze particle to remove anything not circular enough and below a certain size and then create a new mask. Invert this mask and fill any left holes:

Using a binary version of your input

These operations:

run("Analyze Particles...", "size=10-Infinity circularity=0.80-1.00 show=Masks");
run("Fill Holes");

Yields this result:
Mask of binary-1

So you can clean up such masks with different combinations of binary operations and the filter of the particle analyzer.

BUT some things i would consider:
A) This mask is regular since it comes from a 96 well plate. Might be easier to generate a regular pattern since spacing and size is always the same? Depends how much variability is there in the alignment, initial location and sizing of the circles, but these are technical variables that could be small.
B) Alternatively you could find other ways to detect/segment the circles, but for this one needs to see how the input looks like.

1 Like

I’m not sure how to run this code you’ve provided,
could you simplify your response with buttons I could click on Image J fiji?

Thank you so very much,

You can copy the script here and paste it into a macro.
Plugins > New > Macro
Then press run.

You can search for each of the key words within the quotation marks to get to the command in Fiji. In any case here are the buttons:

Process > Binary > Dilate
Edit > Invert
Analyze > Analyze Particles…
Process > Binary > Fill Holes

1 Like

Thank you so very much for your help.

1 Like