Background
Hi all, here are some image of coral juveniles settle on 6-well plate, I am trying to develop a macro on imageJ to identify coral and calculate their surface area. My lab had created a macro for it. It works pretty well in identifying coral if I manually select the coral and clear the background. The macro could measure the coral surface area and count the number of coral. However, I would like to bring this further to allow the macro to automatically identify the coral out of the well plate. Here is my work so far:
Sample image and/or code
Here is the sample photo: Coral juveniles in 6-well plate. The TIF file is too big so I have to attach a link to drive.
Here is the image J macro that my lab developed to identify coral juveniles and calculate the surface area of them.
//store file name in nameSTore variable for later use
nameStore = getTitle();
roiManager("reset");
//calibrate file based on data i was orignally given that had a 4000um scale bar in it. Assumes all images were created the same
run("Properties...", "channels=1 slices=1 frames=1 unit=µm pixel_width=18.1818 pixel_height=18.1818 voxel_depth=18.1818");
//create a cpy of the orginal aimage called "For Prcoessing" to perfrom various processing to extract objects
run("Duplicate...", "title=["+nameStore+"]");
//flatten background and convert to 8 bit for even thresholding
run("Subtract Background...", "rolling=150");
run("8-bit");
//threshold and convert to binary mask
setAutoThreshold("Default dark");
setOption("BlackBackground", true);
run("Convert to Mask");
//analyse the obejects, filter on size and add to the ROI manager
run("Analyze Particles...", "size=900000-100000000 circularity=0.10-1.00 display summarize add");
//count the number of ROIs in the manager
numROIs= roiManager("count");
//Then do an if to run only when that number is greater than 1
if (numROIs>=1){
//copy the measured ROIs over to the orignal image and burn them into it
selectWindow(nameStore);
run("From ROI Manager");
run("Flatten");
Here is the result, you can see the corals were successfully identified, but there are lots of miss judge as well due to light refraction.
Analysis goals
To avoid the macro miss judge the reflection as coral. My idea is to remove the content outside the well before I use the above macro. I have noticed there is always a circle reflection of the well, I think it will be useful for developing the script to find the well after the image become binary.
- What information are you interested in getting from this image?
Challenges
I have looked at others work on identifying well in well plate.
https://biii.eu/find-draw-and-measure-wells-multi-well-plate-picture
I have tried to modify their script to my work but got no luck on it. It would be great if someone could point me a direction on how I should approach the situation. Thank you in advance.