Published October 24, 2021 | Version v2
Other Open

Protocol for extracting basic color metrics from Images in ImageJ/Fiji

Description

Protocol provided here is to help researchers with a need to extract basic summary statistics of component channels of RGB, Lab, and HSB colorspaces from image sets using ImageJ/Fiji. Using a macro helps to automate a job in ImageJ and ensures reproducibility of our work. This macro functions to 1) open an image from a directory folder, 2) threshold the image to segment out the object of interest from the background then "clear" the background so it is completely black, 3) separate the image into the component channels for each color space, 4) extract summary statistics for each channel in each colorspace, 5) add these summary statistics for each channel of each colorspace (RGB, Lab, and HSB) to a .csv file.

Before you start, a note on thresholding: The supplied macro (Whole Color Macro_All.components.ijm) is parameterized to use color thresholding to segment out the object of interest from the background. The thresholding parameters in the supplied macro will need to be adjusted for your specific image set (lines 37-75 in macro). Thresholding parameterization provided in the downloadable macro is based on the RGB colorspace, but thresholding based on other color spaces may be a better option for other image sets. Before running this macro, determine the best colorspace and parameters for thresholding the image set you are working with and replace the code in the macro with the correct parameters for your images at lines 35-75. Detailed information on how to determine the ideal thresholding method/ values for your image set, and how to edit the supplied macro with your parameters can be found in the supplied .pdf document (Protocol for extracting basic color metrics from Images in ImageJ/Fiji)

I also provide a protocol and R script (Reformat.row.to.column.R) that automates the reformatting of summary statistics from component channels of three colorspaces (RGB, Lab, and HSB) included in the output file “Whole_Color_Measurements.csv” from ImageJ macro “Whole Color Macro_All.components.ijm”. This script functions to reformat the “Whole_Color_Measurements.csv” so each colorspace channel is transposed into a separate column rather than a row for each image. The final .csv file produced by running this script should have each image listed as a row, with each summary statistic (mean, mode, min, max, etc.) for each channel in each colorspace presented in a separate column for that image (row).

Files

Protocol for extracting basic color metrics from Images in ImageJ.pdf

Files (1.7 MB)

Name Size Download all
md5:36024a3bb307982d056ee7841e2d4220
1.7 MB Preview Download
md5:eab001e188938bc2cbfa4abd4fe02001
38.5 kB Preview Download
md5:65f92acd8ac6aa51a7c53ad5706e901d
3.5 kB Download
md5:a4513c7b7b74a728491f7992ee1d56bf
7.1 kB Download