Login  Register

Re: Analysing water in oil droplets

Posted by Michael Schmid on Jan 08, 2015; 4:39pm
URL: http://imagej.273.s1.nabble.com/Analysing-water-in-oil-droplets-tp5011113p5011131.html

Hi Rikschuff,

sorry, I had pasted an old, non-functioning version of the macro. Here is the correct one (still with the restriction that it does not work correctly at the edges):

requires("1.49n");
run("8-bit");
input = getTitle();
run("Duplicate...", "title=binary");
run("Subtract Background...", "rolling=20 light sliding");
setThreshold(0, 238);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Options...", "iterations=2 count=1 pad edm=Overwrite do=Nothing");
run("Close-"); //remove highlights near the edges
setThreshold(0, 0);
run("Set Measurements...", "mean area centroid redirect=None decimal=5");
run("Analyze Particles...", "size=100-Infinity circularity=0.7-1.00 show=Masks");
imageCalculator("Add create", "Mask of binary", "binary");
run("Watershed");
run("Set Measurements...", "mean area centroid redirect=&input decimal=5");
run("Analyze Particles...", "size=100-Infinity circularity=0.80-1.00 show=Nothing exclude display clear summarize");
run("Set Measurements...", "mean area centroid redirect=None decimal=5");


Michael
________________________________________________________________
On Jan 8, 2015, at 12:11, Michael Schmid wrote:

> Hi Rikschuff,
>
> the problem is how to handle the bright centers of the bubbles. One possibility is detecting them based on their circularity with "Analyze Particles", but this does not work for bubbles at the edge. Apart from this problem, here is a rough idea how it could be done:
>
> requires("1.49n");
> run("8-bit");
> input = getTitle();
> run("Subtract Background...", "rolling=20 light sliding");
> setThreshold(0, 238);
> setOption("BlackBackground", false);
> run("Convert to Mask");
> run("Options...", "iterations=2 count=1 pad edm=Overwrite do=Nothing");
> run("Close-"); //remove highlights near the edges
> setThreshold(0, 0);
> run("Analyze Particles...", "size=100-Infinity circularity=0.7-1.00 show=Masks");
> imageCalculator("Add create", "Mask of "+input, input);
> run("Watershed");
> run("Set Measurements...", "mean area centroid redirect=&input decimal=5");
> run("Analyze Particles...", "size=100-Infinity circularity=0.80-1.00 show=Nothing exclude display clear summarize");
> run("Set Measurements...", "mean area center redirect=&none decimal=5");
>
> You will need some software for post-processing the Results Lists, to track the particles. Maybe you can also convert the output to images with a single dot for the particles, e.g. like this:
>  http://imagejdocu.tudor.lu/doku.php?id=macro:Particle_Properties_to_Image
> and then use some particle tracker, e.g. this one:
>
> http://courses.washington.edu/me333afe/ImageJ_tutorial.html
>
>
> Michael
> ________________________________________________________________
> On Jan 7, 2015, at 17:26, rikschuff wrote:
>
>> Dear all,
>>
>> I'm trying to analyse a set (timelapse) of pictures taken from water-in-oil
>> droplets (see picture). I searched on the forum and tried for two hours now,
>> but nothing did work so far (i'm a beginner).
>>
>> First of all I would like to analyse the size of the droplets (over time),
>> secondly I would like to analyse the average greyvalue of the droplets (over
>> time), one or two of them is enough. At the same time I would like to
>> measure the greyvalue of the background.
>>
>> Big thanks for your help!
>>
>> Mm that's strange :) Thanks for noticing. Here is the image:
>> <http://imagej.1557.x6.nabble.com/file/n5011120/DSC_0758_-_Copy.jpg>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html