Counting cells automatically on a grid

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Counting cells automatically on a grid

Philip Keymer
Hi everyone,

I am new to ImageJ and it looks like a very powerful tool.  I am growing
algae and need to perform cell counts to determine the cell density
every day.  I would like to reduce the time it takes to do this as
currently I am doing it manually.  I understand that there are plugins
available which can help me count the cells but I have not had much
luck.  What can you recommend for automated cell counting, are there any
tutorials available?

One of the problems I have encountered is that the grid interferes with
the count.  

Here is an example of an image that I want to process:
http://dl.dropbox.com/u/419501/Count%201.JPG

Cheers

Phil
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

Gabriel Lapointe-2
Hi Phil,
Here is the output of the macro recorder on how I counted the algae in
your picture. Actually you don't need any extra plugins for it (using
1.43l). I hope it will gives you pointer on how to avoid manual
counting.

selectWindow("Count 1.JPG");
run("8-bit");
// Many option exist for automatic thresholding, make sure you always
//use the same to be able to compare between images.
setAutoThreshold("MaxEntropy");
setThreshold(0, 126);
// you could use the particle analyzer here but I always find that
// smoothing the edge with binary operation always give better results
run("Convert to Mask");
run("Invert LUT");
run("Invert");
run("Close-");
run("Open");
//separate touching cells
run("Watershed");
// The actual counting
run("Analyze Particles...", "size=35-219 circularity=0.80-1.00
show=Masks exclude include summarize");

Good luck
Gabriel


Gabriel Lapointe, M.Sc.
Laboratoire de Luc DesGroseillers, Ph.D.
Pavillon Roger-Gaudry Local A-538
Département de biochimie
Faculté de Médecine de l'Université de Montréal
2900 boul. Édouard-Montpetit,
Montréal, Qc, H3T 1J4




> Hi everyone,
>
> I am new to ImageJ and it looks like a very powerful tool.  I am growing
> algae and need to perform cell counts to determine the cell density
> every day.  I would like to reduce the time it takes to do this as
> currently I am doing it manually.  I understand that there are plugins
> available which can help me count the cells but I have not had much
> luck.  What can you recommend for automated cell counting, are there any
> tutorials available?
>
> One of the problems I have encountered is that the grid interferes with
> the count.  
>
> Here is an example of an image that I want to process:
> http://dl.dropbox.com/u/419501/Count%201.JPG
>
> Cheers
>
> Phil
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

Philip Keymer
Hi Gabriel,

Thanks for the Quick reply.  Thanks it looks like a good place to start.
Looking at the Macro I am having trouble finding the options for Convert
to Mask, Invert LUT and Watershed.  Where will I find them in the menu
structure?

Cheers

Phil

On Mon, 2009-11-30 at 20:23 -0500, Gabriel Lapointe wrote:

> Hi Phil,
> Here is the output of the macro recorder on how I counted the algae in
> your picture. Actually you don't need any extra plugins for it (using
> 1.43l). I hope it will gives you pointer on how to avoid manual
> counting.
>
> selectWindow("Count 1.JPG");
> run("8-bit");
> // Many option exist for automatic thresholding, make sure you always
> //use the same to be able to compare between images.
> setAutoThreshold("MaxEntropy");
> setThreshold(0, 126);
> // you could use the particle analyzer here but I always find that
> // smoothing the edge with binary operation always give better results
> run("Convert to Mask");
> run("Invert LUT");
> run("Invert");
> run("Close-");
> run("Open");
> //separate touching cells
> run("Watershed");
> // The actual counting
> run("Analyze Particles...", "size=35-219 circularity=0.80-1.00
> show=Masks exclude include summarize");
>
> Good luck
> Gabriel
>
>
> Gabriel Lapointe, M.Sc.
> Laboratoire de Luc DesGroseillers, Ph.D.
> Pavillon Roger-Gaudry Local A-538
> Département de biochimie
> Faculté de Médecine de l'Université de Montréal
> 2900 boul. Édouard-Montpetit,
> Montréal, Qc, H3T 1J4
>
>
>
>
> > Hi everyone,
> >
> > I am new to ImageJ and it looks like a very powerful tool.  I am growing
> > algae and need to perform cell counts to determine the cell density
> > every day.  I would like to reduce the time it takes to do this as
> > currently I am doing it manually.  I understand that there are plugins
> > available which can help me count the cells but I have not had much
> > luck.  What can you recommend for automated cell counting, are there any
> > tutorials available?
> >
> > One of the problems I have encountered is that the grid interferes with
> > the count.  
> >
> > Here is an example of an image that I want to process:
> > http://dl.dropbox.com/u/419501/Count%201.JPG
> >
> > Cheers
> >
> > Phil
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

BenTupper
Hi,

On Nov 30, 2009, at 9:19 PM, Philip Keymer wrote:

> Hi Gabriel,
>
> Thanks for the Quick reply.  Thanks it looks like a good place to  
> start.
> Looking at the Macro I am having trouble finding the options for  
> Convert
> to Mask, Invert LUT and Watershed.  Where will I find them in the menu
> structure?
>

Yet another amazing feature of ImageJ ... using the "Plugins >  
Utilities > Find Commands..." menu option you can find the location of  
the menu command as well as the source code location.  Set the "Show  
full information" option on for maximum wow.  Is that slick or what?

Cheers,
Ben





> Cheers
>
> Phil
>
> On Mon, 2009-11-30 at 20:23 -0500, Gabriel Lapointe wrote:
>> Hi Phil,
>> Here is the output of the macro recorder on how I counted the algae  
>> in
>> your picture. Actually you don't need any extra plugins for it (using
>> 1.43l). I hope it will gives you pointer on how to avoid manual
>> counting.
>>
>> selectWindow("Count 1.JPG");
>> run("8-bit");
>> // Many option exist for automatic thresholding, make sure you always
>> //use the same to be able to compare between images.
>> setAutoThreshold("MaxEntropy");
>> setThreshold(0, 126);
>> // you could use the particle analyzer here but I always find that
>> // smoothing the edge with binary operation always give better  
>> results
>> run("Convert to Mask");
>> run("Invert LUT");
>> run("Invert");
>> run("Close-");
>> run("Open");
>> //separate touching cells
>> run("Watershed");
>> // The actual counting
>> run("Analyze Particles...", "size=35-219 circularity=0.80-1.00
>> show=Masks exclude include summarize");
>>
>> Good luck
>> Gabriel
>>
>>
>> Gabriel Lapointe, M.Sc.
>> Laboratoire de Luc DesGroseillers, Ph.D.
>> Pavillon Roger-Gaudry Local A-538
>> Département de biochimie
>> Faculté de Médecine de l'Université de Montréal
>> 2900 boul. Édouard-Montpetit,
>> Montréal, Qc, H3T 1J4
>>
>>
>>
>>
>>> Hi everyone,
>>>
>>> I am new to ImageJ and it looks like a very powerful tool.  I am  
>>> growing
>>> algae and need to perform cell counts to determine the cell density
>>> every day.  I would like to reduce the time it takes to do this as
>>> currently I am doing it manually.  I understand that there are  
>>> plugins
>>> available which can help me count the cells but I have not had much
>>> luck.  What can you recommend for automated cell counting, are  
>>> there any
>>> tutorials available?
>>>
>>> One of the problems I have encountered is that the grid interferes  
>>> with
>>> the count.
>>>
>>> Here is an example of an image that I want to process:
>>> http://dl.dropbox.com/u/419501/Count%201.JPG
>>>
>>> Cheers
>>>
>>> Phil


Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

Wayne Rasband
In reply to this post by Philip Keymer
On Nov 30, 2009, at 9:19 PM, Philip Keymer wrote:

> Hi Gabriel,
>
> Thanks for the Quick reply.  Thanks it looks like a good place to  
> start.
> Looking at the Macro I am having trouble finding the options for
> Convert to Mask, Invert LUT and Watershed.  Where will I find
> them in the menu structure?

Use the command finder (Plugins>Utilities>Find Commands) to look up  
macro run() commands. For example, press "l" (lower case L), type  
"wat", click "Show full information", and you will see that the  
"Watershed" command is in the Process>Binary menu.

-wayne


> On Mon, 2009-11-30 at 20:23 -0500, Gabriel Lapointe wrote:
>> Hi Phil,
>> Here is the output of the macro recorder on how I counted the algae  
>> in
>> your picture. Actually you don't need any extra plugins for it (using
>> 1.43l). I hope it will gives you pointer on how to avoid manual
>> counting.
>>
>> selectWindow("Count 1.JPG");
>> run("8-bit");
>> // Many option exist for automatic thresholding, make sure you always
>> //use the same to be able to compare between images.
>> setAutoThreshold("MaxEntropy");
>> setThreshold(0, 126);
>> // you could use the particle analyzer here but I always find that
>> // smoothing the edge with binary operation always give better  
>> results
>> run("Convert to Mask");
>> run("Invert LUT");
>> run("Invert");
>> run("Close-");
>> run("Open");
>> //separate touching cells
>> run("Watershed");
>> // The actual counting
>> run("Analyze Particles...", "size=35-219 circularity=0.80-1.00
>> show=Masks exclude include summarize");
>>
>> Good luck
>> Gabriel
>>
>>
>> Gabriel Lapointe, M.Sc.
>> Laboratoire de Luc DesGroseillers, Ph.D.
>> Pavillon Roger-Gaudry Local A-538
>> Département de biochimie
>> Faculté de Médecine de l'Université de Montréal
>> 2900 boul. Édouard-Montpetit,
>> Montréal, Qc, H3T 1J4
>>
>>
>>
>>
>>> Hi everyone,
>>>
>>> I am new to ImageJ and it looks like a very powerful tool.  I am  
>>> growing
>>> algae and need to perform cell counts to determine the cell density
>>> every day.  I would like to reduce the time it takes to do this as
>>> currently I am doing it manually.  I understand that there are  
>>> plugins
>>> available which can help me count the cells but I have not had much
>>> luck.  What can you recommend for automated cell counting, are  
>>> there any
>>> tutorials available?
>>>
>>> One of the problems I have encountered is that the grid interferes  
>>> with
>>> the count.
>>>
>>> Here is an example of an image that I want to process:
>>> http://dl.dropbox.com/u/419501/Count%201.JPG
>>>
>>> Cheers
>>>
>>> Phil
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

Philip Keymer
In reply to this post by BenTupper
Hi Ben (and Wayne)

On Mon, 2009-11-30 at 21:37 -0500, Ben Tupper wrote:

> Hi,
>
> On Nov 30, 2009, at 9:19 PM, Philip Keymer wrote:
>
> > Hi Gabriel,
> >
> > Thanks for the Quick reply.  Thanks it looks like a good place to  
> > start.
> > Looking at the Macro I am having trouble finding the options for  
> > Convert
> > to Mask, Invert LUT and Watershed.  Where will I find them in the menu
> > structure?
> >
>
> Yet another amazing feature of ImageJ ... using the "Plugins >  
> Utilities > Find Commands..." menu option you can find the location of  
> the menu command as well as the source code location.  Set the "Show  
> full information" option on for maximum wow.  Is that slick or what?
>
> Cheers,
> Ben
>

Thanks for that Now I will be able to find all the tools which are
mention in the macro and play with the settings.  That is a brilliant
feature for such a complex software package.

>
> > Cheers
> >
> > Phil
> >
> > On Mon, 2009-11-30 at 20:23 -0500, Gabriel Lapointe wrote:
> >> Hi Phil,
> >> Here is the output of the macro recorder on how I counted the algae  
> >> in
> >> your picture. Actually you don't need any extra plugins for it (using
> >> 1.43l). I hope it will gives you pointer on how to avoid manual
> >> counting.
> >>
> >> selectWindow("Count 1.JPG");
> >> run("8-bit");
> >> // Many option exist for automatic thresholding, make sure you always
> >> //use the same to be able to compare between images.
> >> setAutoThreshold("MaxEntropy");
> >> setThreshold(0, 126);
> >> // you could use the particle analyzer here but I always find that
> >> // smoothing the edge with binary operation always give better  
> >> results
> >> run("Convert to Mask");
> >> run("Invert LUT");
> >> run("Invert");
> >> run("Close-");
> >> run("Open");
> >> //separate touching cells
> >> run("Watershed");
> >> // The actual counting
> >> run("Analyze Particles...", "size=35-219 circularity=0.80-1.00
> >> show=Masks exclude include summarize");
> >>
> >> Good luck
> >> Gabriel
> >>
> >>
> >> Gabriel Lapointe, M.Sc.
> >> Laboratoire de Luc DesGroseillers, Ph.D.
> >> Pavillon Roger-Gaudry Local A-538
> >> Département de biochimie
> >> Faculté de Médecine de l'Université de Montréal
> >> 2900 boul. Édouard-Montpetit,
> >> Montréal, Qc, H3T 1J4
> >>
> >>
> >>
> >>
> >>> Hi everyone,
> >>>
> >>> I am new to ImageJ and it looks like a very powerful tool.  I am  
> >>> growing
> >>> algae and need to perform cell counts to determine the cell density
> >>> every day.  I would like to reduce the time it takes to do this as
> >>> currently I am doing it manually.  I understand that there are  
> >>> plugins
> >>> available which can help me count the cells but I have not had much
> >>> luck.  What can you recommend for automated cell counting, are  
> >>> there any
> >>> tutorials available?
> >>>
> >>> One of the problems I have encountered is that the grid interferes  
> >>> with
> >>> the count.
> >>>
> >>> Here is an example of an image that I want to process:
> >>> http://dl.dropbox.com/u/419501/Count%201.JPG
> >>>
> >>> Cheers
> >>>
> >>> Phil
>
>
> Cheers,
> Ben

Cheers,

Phil
Reply | Threaded
Open this post in threaded view
|

Re: Counting cells automatically on a grid

Gabriel Landini
In reply to this post by Gabriel Lapointe-2
On Tuesday 01 Dec 2009  09:06:11 Gabriel Lapointe wrote:
> setAutoThreshold("MaxEntropy");
> setThreshold(0, 126);

If you use an auto threshold method, you should not set the threshold value
explicitly.

Cheers

G.