Average particle color analysis

imagej
Tags: #<Tag:0x00007fa30aa1a978>

#1

Hi,

I have a bunch of images each one with over 100-500 particles. I have tresholded the image and analyzed the particles (shape, length, etc.) but I would like to extract an average color value of all the pixels contained in each particle (preferably in CIE Lab color space, or RGB if not possible).

If possible, I would like to create a result table with all shape descriptors I created for each particle with it’s average color value.

Is there any way of doing this in an easy manner?

Thanks!


#2

Could you please tell us how you define the “average color”?

Regards

Herbie


#3

The average of the CIE Lab parameters (L* a* b*) in each pixel contained in the particle. In any case, I am trying to quantify the color in each particle, although some are translucent and thus influenced by background color. Any idea?

Thanks,

Liam


#4

Sorry Liam,

but I don’t get it …

I would like to extract an average color value

A single value as you write or three values “L a b”?

In the latter case looping over the pixels of a ROI and getting the means of “L a b” is one way to go.

Regards

Herbie

PS:
For ROI #35 of your sample image I get roughly the values:
L: 19.5
a: -1.7
b: 1.4


#5

I think this link might be the answer


#6

Yes, as you said I am looking for three values “L a b”, I should have been more concise. How can I loop over the pixels of a ROI?

Thanks for your answers.

Liam


#7

Liam,

before I can provide a suitable method, please post the original image without the selections (ROIs), preferably in the original uncompressed format (TIFF as zip-file or PNG). Even better would be a TIFF-image (as zip-file) with all selections as overlay.

In any case the processing steps are

  1. “RGB -> Lab”-conversion that gives you a stack of three 32bit gray-value images.
  2. You have to apply the selections to this stack and
  3. measure the mean gray values of all selections in the stack which gives you three values per selection

If you provide the desired image, I’d try to post an ImageJ macro that does all of these processing steps.

Regards

Herbie


#8

That would be very helpful, thanks a lot. Here is a zip file containing the TIFF image and the ROIs as overlay.

Regards

Liam

ImageJ.zip (3.9 MB)


#9

Good day Liam,

thanks for the data!

Here is an ImageJ-macro that gives you the Lab-means for all ROIs in a results table:

run("Set Measurements...", "mean redirect=None decimal=3");
setBatchMode(true);
run("Duplicate...", " ");
run("Lab Stack");
roiManager("multi-measure measure_all one append");
setResult("Channel", 0, "L");
setResult("Channel", 1, "a");
setResult("Channel", 2, "b");
setBatchMode(false);
exit();

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it. (Of course, the original image and the corresponding ROI-Manager have to be open in ImageJ before you run the macro.)

HTH

Herbie


#10

That’s great!

Thanks a lot

Liam


#11

Just one last question, do you know any way of representing each “L a b” coordinate on a 2D or 3D graph? Just like 3D Color Inspector does it, but only with the average L a b values of each particle.

Regards

Liam


#12

It looks like Lab was added in v1.2

http://imagej.net/plugins/color-inspector.html


#13

I have successfully used the image>adjust> color threshold…give it a try.