//Yb-bodies analysis in Fiji

//identifies and counts the number of Yb-bodies in OSCs
//single-plane image stained with anti-Yb (C2)


run("Duplicate...", "duplicate");
img=getTitle()

run("Split Channels");

selectWindow("C3-"+img);
close();

selectWindow("C1-"+img);
close();

selectWindow("C2-"+img);

run("Invert LUT");
run("8-bit");
setMinAndMax(25, 100);
run("Apply LUT");

run("Duplicate...", " ");

run("Gaussian Blur...", "sigma=1");

//transform in binary image and analyse particles

waitForUser("Untick dark background, make sure Yb-bodies are in black; Select Threshold; Hit Apply")

//threshold: Default
//threshold: 0-90

run("Make Binary");


run("Analyze Particles...", "size=0.001-Infinity circularity=0.00-1 show=Outlines display clear");


saveAs("Results", "/path/"+img+"results_yb_particles.txt");

waitForUser("All done? Hit OK")

run("Clear Results");

close();
close();
close();
