counting cells in confocal images

counting cells in confocal images

Hi all,

Sorry, i already posted this once, but it did not get accepted by the mailinglist due to my own stupidity. one more try:

I’m pretty new to ImageJ, but I guess I already need some professional results out of the program. I hope there’s somebody who can help me with it. I am analyzing images (TIFF RGB, 787x787 pixels) I obtained doing confocal microscopy, resulting in fluorescent slide images in three colors (red, green, blue). In these slides, there are stained cell nuclei, in different gradations of signal strength for each channel. What I need to do is RGB split the channels, then for the blue channel simply count the amount of cells in it, and for the other two channels count the low, medium and high positive cells. I already tried to make a schematic overview of how the workflow is about to take place:

- Split channel RGB
- Set threshold so that histogram is fully maxed out from 0 to 255 for each channel
- Divide red and green image in three sub images (leave blue channel as it is)
o Image A including all grayscales from 1 to 85
o Image B including all grayscales from 86 to 190
o Image C including all grayscales from 191 to 255
- For all 7 images (3x red, 3x green, 1x blue), set threshold again from 0 to 255
- Count the number of positive cells in each image. Cells are not necessarily round, but are normally 10-20 pixels in diameter. I’m also not entirely sure how to threshold this. There is low background in the images, but there’s always some. Cell nuclei are always more positive, and we need to count them all. I know this isnt a very analytical view, but any advise is welcome!
- Give a total area result of all positive cells

I’m not entirely sure if this is the best way to tackle the subject, any opinions are welcome. Is there anybody who can help me write this as a macro? Is everything I wish to do actually do-able with a macro? All the help you can give me is much appreciated, thanks in advance!

I think the ITCN plugin (nuclei counter) works fairly well for counting cells.

The problem you might run into is measuring the area for the positive cells. In theory, you should be able to follow steps 1-3 and then 5-6 to achieve that goal. I would say try that first, and, if it doesn't work, post a new post.

By the way, are you a programmer? If you have little or no programming experience, I suggest you learn the imageJ macro language. If you have experience programming, I suggest you learn how to create a plugin.

Good luck!

leonliev wrote

Hi all,

Sorry, i already posted this once, but it did not get accepted by the mailinglist due to my own stupidity. one more try:

I’m pretty new to ImageJ, but I guess I already need some professional results out of the program. I hope there’s somebody who can help me with it. I am analyzing images (TIFF RGB, 787x787 pixels) I obtained doing confocal microscopy, resulting in fluorescent slide images in three colors (red, green, blue). In these slides, there are stained cell nuclei, in different gradations of signal strength for each channel. What I need to do is RGB split the channels, then for the blue channel simply count the amount of cells in it, and for the other two channels count the low, medium and high positive cells. I already tried to make a schematic overview of how the workflow is about to take place:

- Split channel RGB
- Set threshold so that histogram is fully maxed out from 0 to 255 for each channel
- Divide red and green image in three sub images (leave blue channel as it is)
o Image A including all grayscales from 1 to 85
o Image B including all grayscales from 86 to 190
o Image C including all grayscales from 191 to 255
- For all 7 images (3x red, 3x green, 1x blue), set threshold again from 0 to 255
- Count the number of positive cells in each image. Cells are not necessarily round, but are normally 10-20 pixels in diameter. I’m also not entirely sure how to threshold this. There is low background in the images, but there’s always some. Cell nuclei are always more positive, and we need to count them all. I know this isnt a very analytical view, but any advise is welcome!
- Give a total area result of all positive cells

I’m not entirely sure if this is the best way to tackle the subject, any opinions are welcome. Is there anybody who can help me write this as a macro? Is everything I wish to do actually do-able with a macro? All the help you can give me is much appreciated, thanks in advance!

Re: counting cells in confocal images

Dear Leon van Gurp,
This is very doable in a macro. I just ran through this with confocals that
we wanted to score % apoptotic with DAPI or Hoechst marking all nuclei and
Annexin-Alexa488 or PI marking dying cells. So for us, it was just two
channels. It seems as if you also want some intensity info in addition to
counts. All of this is possible.

My recommendations:
1. First, play around with a couple of images and make sure that you can get
the numbers you want by executing existing tools or plugins. You might want
to try Analyze Particles- that works for us. Also check out the ShapeLogic
plugins- they handle multicolored cells very well also.
2. Then it can all be automated and a great way to start with macros is to
record exactly what you did with the macro recorder and you¹ll end up with
macro language that you can then tweak.
3. Also look at existing macros for ideas and I can send you our recent
macro which should be modifiable for your puproses.

What kind of confocal are you collecting these with?
We use Olympus Fluoview and the latest LOCI plugins enable ImageJ to open
the .oib files directly and they cover the realm of microscopy formats.

In terms of your work flow:
- Split channel RGB
This should be accomplishable by the settings for the LOCI plugin- we have
ours set for standard ImageJ and split RGB

- Set threshold so that histogram is fully maxed out from 0 to 255 for each
Channel
//Auto adjust contrast from 0-255 allowing 0.35% of pixels to saturate
run("Enhance Contrast", "saturated=0.35 normalized");

- Divide red and green image in three sub images (leave blue channel as it
is)
o Image A including all grayscales from 1 to 85
o Image B including all grayscales from 86 to 190
o Image C including all grayscales from 191 to 255
This might be accomplished by intensity values you¹ll get during particle
counting

- For all 7 images (3x red, 3x green, 1x blue), set threshold again from 0
to 255
//Set threshold to 128 (may need to have previously set to dark background)
setThreshold(128,255);
You will likely need different threshold values

- Count the number of positive cells in each image. Cells are not
necessarily round, but are normally 10-20 pixels in diameter. I¹m also not
entirely sure how to threshold this. There is low background in the images,
but there¹s always some. Cell nuclei are always more positive, and we need
to count them all. I know this isnt a very analytical view, but any advise
is welcome!
//Count positive cells in range 70-400 and 0.8-1.0 circularity
run("Analyze Particles...", "size=70-400 circularity=0.80-1.00 show=Nothing
display exclude clear summarize");

- Give a total area result of all positive cells
The particle analysis will actually provide all of the areas and
intensities. You¹ll end up with a Summary window which can be pasted into
excel. I also have a macro for excel that takes the alternating rows of
Hoechst followed by PI counts and results in an Excel table that has all of
the data side by side. Let me know what you need.

Today we had fun counting a set of images with 20 different slides, 10
confocal images per slide with each confocal image containing the nuclear
and apoptotic staining channels. You¹ll be able to let it rip, adjust some
parameters and repeat until you get the parameters the way you¹d like.
-Bruce

Re: counting cells in confocal images

Bruce, thanks a lot, this is great help! I should be able to play around with this and tweak some settings into a functional macro. most optimal situation would be to make one macro that would analyse everything, but if that isnt possible, at least i can get most work automated this way.

we use a leica sp5 confocal multiphoton setup. It spits out files in its own las format, which is a pain in the *** to work with, but we can retrieve tiff files from it, so thats fine. we can easily split for rgb as well. i honestly have no idea if there are better export options from las af software, ill check this out.

I hope I get it correctly that you suggest not splitting the channels for threshold (low\mid\high pos cells), but let particle analysis measure intensity and sort it out in excell? for particle analysis, is the range 70-400 and 0.8-1.0 circularity
a standard setting you use? is this a setting that accepts like 95-99% of all normal cells? range is (i guess) dependant of the size of your image as well, right?

and last, does anybody have experience with nuclei counter in comparison to particle analyser? pros and cons?

Re: counting cells in confocal images

Leon-
> I hope I get it correctly that you suggest not splitting the channels for
> threshold (low\mid\high pos cells), but let particle analysis measure
> intensity and sort it out in excell?
 Yes

> for particle analysis, is the range
> 70-400 and 0.8-1.0 circularity a standard setting you use?is this a setting
> that accepts like 95-99% of all normal cells? range is (i guess) dependant
> of the size of your image as well, right?
 You just have to play with it and the area range may be square pixels, so
be careful. For that and circularity, just analyze some of your images with
some of the smallest, largest, and most out of round cells that you would
count and make sure the range counts them and not other things.
-Bruce