IJ2 is out
 Sec. 29: Process Up Part V: Menu Commands Sec. 31: Plugins


This menu contains commands related to statistical measurements on image data, profile and histogram plotting and plugins related to image analysis.

30.1Measure… [m]

Based on the selection type, calculates and displays on the Results Table↑ either area statistics, line lengths and angles, or point coordinates. Performed measurements can be specified in the Set Measurements… dialog box.
Area statistics are calculated for the complete image if there is no selection or for a selected subregion defined by one of the Area Selection Tools↑. For linear selections (Straight, Segmented and Freehand lines, see Line Selection Tools↑) length and angle (straight lines only) are also calculated. For Point selections (see Point Tool↑ and Multi-point Tool↑), the X and Y coordinates are recorded. Note that Measure… [m] will paint (invasively) a mark over the measured point in foreground color unless Mark Width in the Point Tool↑ options dialog box is set to zero.
With RGB images, results are calculated using brightness values. RGB pixels are converted to brightness values using the formula value = (red + green + blue) ⁄ 3 or value = 0.299 ×  red + 0.587 ×  green + 0.114 ×  blue if Weighted RGB Conversions is checked in EditOptionsConversions…↑.
Intensity statistics (Mean, Modal, Median, Min. & Max. Gray Value, Standard Deviation and Integrated Density) can be performed on area, line and multi-point selections. With lines, these parameters are calculated from the values of the pixels along the line (see Plot Profile [k]).
With area selections, the following parameters can measured: Area, Center of Mass, Centroid, Perimeter, Bounding Rectangle, Shape Descriptors, Fitted Ellipse, Feret’s Diameter, Skewness, Kurtosis and Area Fraction.

30.2Analyze Particles…

figure images/AnalyzeParticles.png
This command counts and measures objects in binary or thresholded images (ImageAdjustThreshold… [T] or Color Threshold…↑). Analysis is performed on the existing area selection or on the entire image if no selection is present.
It works by scanning the image or selection until it finds the edge of an object. It then outlines the object using the Wand Tool↑, measures it using the Measure… [m] command, fills it to make it invisible, then resumes scanning until it reaches the end of the image or selection. Press Esc to abort this process.
Original (thresholded)
Exclude on Edges
Include Holes
Size: 0--50 Circ.: 0.5--1.0
figure images/AnalyzeParticlesDemo-1.png
Size: 0-- Circ.: 0.0--0.5
Size: 0-- Circ.: 0.3--0.5
Size: 0-- Circ.: 0.0--0.3
Size: 50-- Circ.: 0.5--1.0
figure images/AnalyzeParticlesDemo-2.png
Figure 36 Particle Analyzer (AnalyzeAnalyze Particles…↑). Features of thresholded images can be extracted by specifying suitable Size and Circularity ranges and/or by choosing if particles should be traced by their outer edge or by flood filling (Include Holes checkbox).
Size Particles with size (area) outside the range specified in this field are ignored. Values may range between 0 and ‘Infinity’. For spatial scaled images (cf. Set Scale…↓) values are expressed in physical size square units or in pixels if Pixel Units is checked. Enter a single value and particles smaller than that value will be ignored.
Circularity Particles with size circularity values outside the range specified in this field are also ignored. Circularity (4π × ([Area])/([Perimeter]2), see Set Measurements…) ranges from 0 (infinitely elongated polygon) to 1 (perfect circle).
Show This drop-down menu specifies which image (or overlay) should ImageJ display after the analysis (see Display options of ParticleAnalyzer↓). Size, color and background of text labels can be adjusted in the ImageOverlayLabels… prompt. Non-overlay outputs can be adjusted in a macro by using:
call("ij.plugin.filter.ParticleAnalyzer.setFontSize", size);
call("ij.plugin.filter.ParticleAnalyzer.setLineWidth", width);
or, in a script or plugin:
Original (thresholded)
Bare Outlines
figure images/AnalyzeParticlesShowOptions-1.png
Count Masks
 Overlay Outlines
 Overlay Masks
figure images/AnalyzeParticlesShowOptions-2.png
Figure 37 Display options of ParticleAnalyzer (AnalyzeAnalyze Particles…↑), IJ 1.44l. When displaying Overlays↑, size, color and background of text labels can be adjusted using ImageOverlayLabels…
Display Results If checked, the measurements for each particle will be displayed in the Results Table↑.
Clear Results If checked, any previous measurements listed in the Results Table↑ will be cleared.
SummarizeIf checked, the particle count, total particle area, average particle size, area fraction and the mean of all parameters listed in the Set Measurements… dialog box will be displayed in a separate Summary table. Note that while single images ‘Summaries’ are output to the same Summary table, stack Summaries are printed in dedicated tables (named Summary of [stack title]). Also, note that descriptive statistics on Results measurements can be obtained at any time using the Summarize command.
Add to Manager If checked, the measured particles will be added to the ROI Manager…
Exclude on Edges If checked, particles touching the edge of the image (or selection) will be ignored.
Include Holes If checked, interior holes will be included. Disable this option to exclude interior holes and to measure particles enclosed by other particles. When this option is enabled, ImageJ finds the extent of each particle by tracing the outer edge. When it is disabled, ImageJ finds the extent by flood filling.
Record Starts This option allows plugins and macros to recreate particle outlines using the doWand(x,y) macro function. The CircularParticles macro demonstrates how to use this feature.
In situ Show If checked, the original image will be replaced by the binary mask specified in the Show drop-down menu. Note that this option does not apply to Overlay Outlines and Overlay Masks that are always displayed as non-destructive image Overlays↑ on the measured image.


For each column in the Results Table↑, calculates and displays the mean, standard deviation, minimum and maximum of the values in that column. This command is also available by right-clicking on the Results Table↑.
figure images/Summarize.png


figure images/Distribution.png
Produces a relative frequency histogram from the data of a chosen column of the Results table [40].
Use the List or Copy buttons to save the histogram data. Mouse over the histogram bars to read the counts for each bin on the window’s lower right corner. AnalyzeHistogram [h] describes in more detail ImageJ’s histogram window.
This command is also available by right-clicking on the Results Table↑.
Parameter Specifies the parameter in the Results Table↑ to be analyzed.
Data points The number of rows that will be analyzed (informative).
Automatic binning If checked, ImageJ will use the method described by David Scott to assess the optimal histogram bin width (see Scott DW, Optimal and data-based histograms. Biometrika, 66(3):605--610, Jan 1979). If unchecked, the number of bins can be set with Specify bins and the starting and ending limits of the histogram with range.
Distribution Plotter, a macro that plots relative and cumulative frequencies on a double Y-axis graph


This command labels the active selection with the current measurement counter value, i.e., the number of rows present in the Results Table↑. Selection outline and label (at the selection centroid) are drawn invasively using current foreground/background colors. As for EditDraw [d]↑, use the EditOptionsLine Width…↑ command, or double click on the line tool, to change the width of selection’s outline.
Selections can be labelled if they were previously analyzed (Analyze Particles…↑ or Measure… [m] commands) and the parameter Centroid (cf. Set Measurements…) extracted in the Results table.

30.6Clear Results

Erases the results table and resets the measurement counter. This command is also available by right-clicking on the Results Table↑.

30.7Set Measurements…

Use this dialog box to specify which measurements are recorded by AnalyzeMeasure… [m], ROI Manager↓’s Measure command and AnalyzeAnalyze Particles…↑ Measurements are performed on the current selection, the entire active image if no selection is present. For thresholded images (ImageAdjustThreshold… [T]), measurements can be restricted to highlighted pixels if Limit to Threshold is checked.
This command is also available by right-clicking on the Results Table↑.
The dialog contains two groups of checkboxes: The first group controls the type of measurements that are printed to the Results table. The second group controls measurement settings. The eighteen checkboxes of the first group are:
figure images/SetMeasurements.png
Area Area of selection in square pixels or in calibrated square units (e.g., mm2, μm2, etc.) if AnalyzeSet Scale…↓ was used to spatially calibrate the image.
Mean gray value Average gray value within the selection. This is the sum of the gray values of all the pixels in the selection divided by the number of pixels. Reported in calibrated units (e.g., optical density) if AnalyzeCalibrate… was used to calibrate the image. For RGB images, the mean is calculated by converting each pixel to grayscale using the formula gray = (red + green + blue) ⁄ 3 or gray = 0.299 ×  red + 0.587 ×  green + 0.114 ×  blue if Weighted RGB Conversions is checked in EditOptionsConversions…↑
Standard deviation Standard deviation of the gray values used to generate the mean gray value. Uses the Results Table↑ heading StdDev.
Modal gray value Most frequently occurring gray value within the selection. Corresponds to the highest peak in the histogram. Uses the heading Mode.
Min & max gray level Minimum and maximum gray values within the selection.
Centroid The center point of the selection. This is the average of the x and y coordinates of all of the pixels in the image or selection. Uses the X and Y headings.
Center of mass This is the brightness-weighted average of the x and y coordinates all pixels in the image or selection. Uses the XM and YM headings. These coordinates are the first order spatial moments.
Perimeter The length of the outside boundary of the selection. Uses the heading Perim.. With IJ 1.44f and later, the perimeter of a composite selection is calculated by decomposing it into individual selections. Note that the composite perimeter and the sum of the individual perimeters may be different due to use of different calculation methods.
Bounding rectangle The smallest rectangle enclosing the selection. Uses the headings BX, BY, Width and Height, where BX and BY are the coordinates of the upper left corner of the rectangle.
Fit ellipse Fits an ellipse to the selection. Uses the headings Major, Minor and Angle. Major and Minor are the primary and secondary axis of the best fitting ellipse. Angle is the angle between the primary axis and a line parallel to the X-axis of the image. The coordinates of the center of the ellipse are displayed as X and Y if Centroid is checked. Note that ImageJ cannot calculate the major and minor axis lengths if Pixel Aspect Ratio in the AnalyzeSet Scale…↓ dialog is not 1.0. There are several ways to view the fitted ellipse:
Shape descriptors Calculates and displays the following shape descriptors:
Feret’s diameter The longest distance between any two points along the selection boundary, also known as maximum caliper. Uses the heading Feret. The angle (0--180 degrees) of the Feret’s diameter is displayed as FeretAngle, as well as the minimum caliper diameter (MinFeret). The starting coordinates of the Feret diameter (FeretX and FeretY) are also displayed (see also Feret's Diameter macro and Chamfer distances and Geodesic diameters plugin).
Integrated density The sum of the values of the pixels in the image or selection. This is equivalent to the product of Area and Mean Gray Value. With IJ 1.44c and later, Raw integrated density (sum of pixel values) is displayed under the heading RawIntDen when Integrated density is enabled. The Dot Blot Analysis tutorial demonstrates how to use this option to analyze a dot blot assay.
Median The median value of the pixels in the image or selection.
Skewness The third order moment about the mean. The documentation for the Moment Calculator plugin explains how to interpret spatial moments. Uses the heading Skew.
Kurtosis The fourth order moment about the mean. Uses the heading Kurt.
Area fraction For thresholded images is the percentage of pixels in the image or selection that have been highlighted in red using ImageAdjustThreshold… [T]. For non-thresholded images is the percentage of non-zero pixels. Uses the heading %Area.
Stack position The position (slice, channel and frame) in the stack or hyperstack of the selection. Uses the headings Slice, Ch and Frame.
n.b.: For line selections the heading Length is created. For straight line selections, Angle is recorded even if Fit Ellipse is unchecked. Also, note that measurements that do not apply to certain selection types may be listed as NaN, Infinity or  − Infinity.
The second part of the dialog controls measurement settings:
Limit to threshold If checked, only thresholded pixels are included in measurement calculations. Use ImageAdjustThreshold… [T] to set the threshold limits. This setting affects only thresholded images (see Settings and Preferences↑).
Display label If checked, the image name and slice number (for stacks) are recorded in the first column of the Results Table↑, e.g., mri-stack.tif:9. For renamed selections (EditSelectionProperties… [y]) or selections measured via ROI Manager’s measure command (see ROI Manager…), the selection label is appended, e.g., blobs.gif:0339-0163 or blobs.gif:mySelection.
Invert Y coordinates If checked, the XY origin is assumed to be the lower left corner of the image window instead of the upper left corner (see also ImageProperties… [P]↑).
Scientific notation If checked, measurements are displayed in scientific notation, e.g., 1.48E2.
Add to Overlay If checked, measured ROIs are automatically added to the image overlay (see Overlays↑). Appearance of overlay selections can be adjusted using ImageOverlayOverlay Options…/Labels…
Redirect to The image selected from this popup menu will be used as the target for statistical calculations done by AnalyzeMeasure… [m] and AnalyzeAnalyze Particles…↑ commands. This feature allows you to outline a structure on one image and measure the intensity of the corresponding region in another image.
Decimal places This is the number of digits to the right of the decimal point in real numbers displayed in the Results Table↑ and in Histogram windows (AnalyzeHistogram [h]).

30.8Set Scale…

figure images/SetScale.png
Use this dialog to define the spatial scale of the active image so measurement results can be presented in calibrated units, such as mm or μm.
Before using this command, use the straight line selection tool to make a line selection that corresponds to a known distance. Then, bring up the Set Scale…↑ dialog, enter the Known Distance and unit of measurement, then click ‘OK’. The Distance in Pixels field will be automatically filled in based on the length of the line selection.
As described in ImageProperties… [P]↑, μ and Å symbols can be typed using AltM and AltShiftA, respectively. μm can also be defined as ‘um’, or ‘micron’.
Setting Pixel Aspect Ratio to a value other than 1.0 enables support for different horizontal and vertical spatial scales, e.g., 100 pixels/cm horizontally and 95 pixels/cm vertically. To set the Pixel Aspect Ratio:
  1. Measure the width and height (in pixels) of a digitized object with a known 1:1 aspect ratio.
  2. Enter the measured width (in pixels) in Distance in Pixels. Enter the known width in Known Distance.
  3. Calculate the aspect ratio by dividing the width by the height and enter it in Pixel Aspect Ratio
When Global is checked, the scale defined in this dialog is used for all opened images during the current session instead of just the active image, see 24: Global Calibrations↓.
Click to Remove Scale resets Distance in Pixels field and Known Distance to zero and the Unit of Length to ‘pixel’.


Use this dialog box to calibrate an image to a set of density standards, for example radioactive isotope standards or a calibrated optical density step tablet. Note that, in general, calibrations cannot be applied to 32-bit images (the pixel intensity unit of 32-bit images can still be changed, nevertheless).
The calibration procedure is done in three steps:
  1. Use AnalyzeClear Results↑ to reset the measurement counter, use one of the Area Selection Tools↑ and AnalyzeMeasure… [m] to record the mean gray value of each of the standards.
  2. When finished making the measurements, select AnalyzeCalibrate… to display the Calibrate… dialog box. To calibrate the image, enter the known standard values in the right column. The left column will be already populated with the measured mean gray values. Select a curve fitting method from the popup menu, enter the unit of measurement, and click ‘OK’. If Show plot is checked, ImageJ will then display the calibration function on a separate window. Note that both columns must contain the same number of values.
  3. If the calibration function is not satisfactory, bring up the Calibrate… dialog box again and select a different curve fitting method.
In addition to the functions that can be chosen from the drop-down menu (described in CurveFitter’s built-in functions↓) two other functions are available that do not require any measurement of OD standards:
Uncalibrated OD  As mentioned in GelsGel Analyzer Options…, causes ImageJ to convert gray values from 8-bit images to uncalibrated optical density values using the function  Unc.  OD = log10(255 Pixel value). This conversion can only be performed on 8-bit images.
Pixel InverterLinear function defined by  Inverted  pixel = Bit−depth − 1 −  Pixel value, with Bit-depth being 255 for 8-bit images or 65535 for 16-bit images.
figure images/Calibrate.png
24 Global Calibrations
 figure images/GlobalCalWarning.png
Calibration settings related to spatial (pixel width, height and voxel depth), temporal (frame interval) and luminance (brightness) information can be set globally, i.e., can be applied to all images opened during the current session instead of just the active image. The Global flag can be set in three dialog prompts:
  1. ImageProperties… [P]↑ (pixel width, height, voxel depth, frame interval)
  2. AnalyzeSet Scale…↑ (pixel width and height)
  3. AnalyzeCalibrate… (pixel intensity)
Once Global calibration is set, a ‘(G)’ is displayed in all image titles until ImageJ is closed. A warning message is displayed when a calibrated image with conflicting calibration is opened and the Global option is enabled.
Choose Disable Global Calibration to stop using global settings or Disable these Messages to keep respecting global settings, ignoring the calibration of the newly open image.

30.10Histogram [h] [J]  [J] This shortcut is shown on Windows and Linux but not on Mac OS X as it conflicts with the system wide ‘Hide’ shortcut. However, the H shortcut (without holding down Cmd ) does work on OS X.

Calculates and displays a histogram of the distribution of gray values in the active image or selection.
The X-axis represents the possible gray values and the Y-axis shows the number of pixels found for each gray value. The horizontal LUT bar below the X-axis is scaled to reflect the display range of the image [41]. The total pixel Count is also calculated and displayed, as well as the Mean, standard deviation (StdDev), minimum (Min), maximum (Max) and modal (Mode) gray value.
Use the List or Copy buttons to save the histogram data. Click on Log to display a log-scaled version of the histogram (overlaid in gray).
figure images/Histogram.png
Click on Live to monitor the histogram while browsing stacks or while moving a ROI. Value / Count pairs (i.e., grayscale value corresponding to the X-axis cursor position / the number of pixels that have that intensity) are displayed on the bottom right while mousing over the histogram window.
With RGB images, the default histogram is calculated by converting each pixel to grayscale using the formula gray = (red + green + blue) ⁄ 3 or gray = 0.299 ×  red + 0.587 ×  green + 0.114 ×  blue if Weighted RGB Conversions is checked in EditOptionsConversions…↑. However, single-channel RGB histograms can be obtained by repetitively clicking on the RGB button.
With 16-bit images, the range of gray values between the Min and Max values is divided into 256 bins. With 32-bit images, the number of bins is specified in the depicted dialog box.
figure images/HistogramDialog.png
With any image type, an options dialog can be called with Alt H or by holding Alt while clicking on AnalyzeHistogram [h].
Bins Specifies the number of bins.
Use min/max If checked, the X-axis range is determined by the minimum and maximum values in the image or selection. If unchecked, X Min and X Max values can be specified to fix the X-axis range.
Y Max Fixes the Y-axis range. Type Auto’ to have the range determined by the largest bin count.
The getHistogram() and Plot.getValues() macro functions can be used to get the ‘value’ and ‘Count’ data displayed when you click the List button (cf. Obtaining Histogram Lists↓).
Obtaining Histogram Lists
 // 1. Single images:
 run("Blobs (25K)");
 getHistogram(values, counts, 256);
 for (i=0; i<values.length; i++)
     print(values[i], counts[i]);
 // 2. Entire stacks:
 run("T1 Head (2.4M, 16-bits)");
 run("Histogram", "stack");
 Plot.getValues(values, counts);
 for (i=0; i<values.length; i++)
     print(values[i], counts[i]);

30.11Plot Profile [k]

figure images/PlotProfile.png
Displays a two-dimensional graph of the intensities of pixels along a line or rectangular selection. The X-axis represents distance along the line and the Y-axis is the pixel intensity. NaN values in 32-bit images (see Image Types and Formats↑) are ignored.
For rectangular selections or line selections wider than one pixel, displays a ‘column average plot’, where the X-axis represents the horizontal distance through the selection and the Y-axis the vertically averaged pixel intensity.
To average horizontally, hold AltK or check Vertical Profile in EditOptionsProfile Plot Options…. For real-time examinations, activate Live mode to continuously update the profile as the selection is moved or resized.
To obtain profiles of several selections in a single plot use the ROI Manager’s Multi Plot command (AnalyzeToolsROI Manager…). Other types of area selections such as oval or freehand ROIs can be profiled by first running EditSelectionArea to Line, which will convert these ROIs to line selections.
Use the List, Save... or Copy... buttons to view and save the profile data. Use EditOptionsProfile Plot Options… to adjust how plots are generated.

30.12Surface Plot…

Displays a three-dimensional graph of the intensities of pixels in a grayscale or pseudo color image (non-RGB images). The plot is based on the existing rectangular selection or on the entire image if no selection is present. A stack of plots can be produced when the source image is a stack or hyperstack. In this case, closing the plot stack window will abort the plotting process.
figure images/SurfacePlot.png
Polygon Multiplier Adjusts the number of profiles used to generate the plot.
Draw Wireframe If checked, the outline of each profile will be drawn in black.
Shade If checked, a shaded plot will be generated using the LUT of source image.
Draw AxisIf checked, the three axis will be drawn and labelled.
Source Background is Lighter If checked, lighter areas in the source image will represent lower elevations (valleys) while darker areas in the source image will represent higher elevations (peaks).
Fill Plot Background with Black If checked, the plot is drawn with a black background, otherwise white will be used.
One Polygon Per LineIf checked, all polygons will be drawn.
SmoothIf checked, sharp fluctuations will be smoothed. Note that some plots can be further improved by adjusting the contrast of the source image or smoothing it.
Plot Profile [k], Interactive 3D Surface Plot plugin (it works with all image types and viewing angle, perspective, scale, lighting and smoothing can be interactively adjusted), 3D Color Inspector/Color Histogram
25 Using Scanners in Densitometry
Electrophoretic gels such as Western blots need frequently to be quantified in order to translate biochemical results into statistical values (see Gels). Independently of the measurement method, you should be familiar with the Beer–Lambert law, so that you are aware that the optical density (absorbance) of the staining to be measured must be proportional to the concentration of the probed material. An obvious corollary of the Beer–Lambert law is that saturated stains (or overexposed films) cannot be quantified.
Generally speaking, office scanners are not suitable for densitometric analysis. That being said, and in the absence of better alternatives, they can be used to digitize gels and X-ray films if the following guidelines are respected:
Samples must be scanned in transmission mode Most flatbed scanners have the light source and detector located on the same side of the instrument (reflection mode). Under these conditions, light interacts with semi-transparent objects in a complex manner with reflected light re-passing through the object on its way to the detector. In addition, thick samples (such as Coomassie-stained gels) are imaged from the surface under reflection light.
Scanners can only serve as densitometers if the light source and detector are on opposite sides of the instrument (transmission mode). This is critical for quantitation of absorbances and requires an adapter for transparencies or negatives to be mounted or built-in on the scanner.
The scanner must offer a linear intensity response The response characteristics of most scanner detectors is unknown, therefore the film/gel should always be scanned next to a photographic gray scale image of known optical intensity (optical tablet or step wedge, see optical density calibration tutorial). Autogain must be disabled during digitization to ensure generally linear intensity responses.
In addition, images should also be scanned with sufficiently high spatial and dynamic (bit-depth) resolutions (the optical—not interpolated—resolution of a scanner can also be measured: e.g., high contrast patterns 84.6 μm (1300 inch) apart should be distinguishable on images scanned at 300 dpi). Note that, in general, a posteriori background corrections on scanned images should also be avoided.
All these issues have been discussed in detail in Gassmann M, Grenacher B, Rohde B and Vogel J. “Quantifying Western blots: pitfalls of densitometry”, Electrophoresis, 30(11):1845—55, 2009. doi: 10.1002/elps.200800720 (N.B.: The paper benchmarks a legacy version of ProcessSubtract Background…↓).


Use the commands in this submenu to analyze one-dimensional electrophoretic gels. Electrophoretic densitometry is discussed in more detail in 25: Using Scanners in Densitometry↑. These commands use a simple graphical method that involves generating lane profile plots, drawing lines to enclose peaks of interest, and then measuring peak areas (i.e., definite integrals) using the Wand Tool…↑. Note that this technique cannot be used to compare bands on different gels unless gels are calibrated to known standards.
figure images/GelAnalyzer.png
The commands listed in this submenu are:
Select First Lane  1 Requires a rectangular selection. Note that lanes are assumed to be vertical unless the width of the initial selection is at least twice its height.
Select Next Lane  2 To be used after the first rectangular ROI is moved over the adjacent lanes. Note that all selections must have the same dimensions.
Plot Lanes   3 Generates the lane profile plots. ImageJ assumes that only one plot is created per analysis. As a consequence, re-running this command more than once within the same analysis will cause an error message: “You must first use the ‘Select First Lane’ command”. To recreate plotted profiles use the Re-plot Lanes command.
Re-plot Lanes Recreates the lane profile plots. If Plot Lanes has not yet been run an error message is displayed: “The data needed to re-plot the lanes is not available”.
Reset Resets the analysis.
Label Peaks Uses the area measurements obtained with the Wand Tool↑ to label lane peaks (see Gel Analyzer Options…).
Gel Analyzer Options… Use this dialog to control the behavior of the gel analyzer.
For practice, refer to the video tutorial on the ImageJ wikipage and use the FileOpen SamplesGel sample image (1-D gel) to perform the following steps. Note that a copy of the gel image with the lane outlines can be created at any point using the ImageOverlayFlatten [F]↑ command.
  1. Use the rectangular selection tool to outline the first lane. This should be the left most lane if the lanes are vertical or the top lane if the lanes are horizontal.
  2. Select GelsSelect First Lane ( 1 ) and the lane will be outlined and ‘Lane 1 selected’ displayed in the status bar.
  3. Move the rectangular selection right to the next lane (or down if the lanes are horizontal) and select GelsSelect Next Lane ( 2 ). The selected lane is outlined and labelled, and ‘Lane n selected’ is displayed in the status bar.
  4. Repeat the previous step for each remaining lane.
  5. Select GelsPlot Lanes ( 3 ) to generate the lane profile plots.
  6. Use the Straight Line Selection Tool↑ to draw base lines and/or drop lines so that each peak of interest defines a closed area (ImageJ will automatically switch to the Straight Line tool). Note that you can hold Shift to constrain lines to be either horizontal or vertical. To access to all the lanes, it may be necessary to scroll the image vertically using the Scrolling Tool↑ (Hold down the space bar to temporarily switch to this tool).
  7. For each peak, measure the size by clicking inside the peak with the Wand Tool↑. If necessary, scroll the image vertically by holding down the space bar and dragging.
  8. Select GelsLabel Peaks to label each measured peak with its size as a percent of the total size of the measured peaks.


This submenu provides access to various image analysis plugins.

30.14.1Save XY Coordinates…

figure images/SaveXYcoordinates.png
Writes to a text file the XY coordinates and pixel value of all non-background pixels in the active image. Background is assumed to be the value of the pixel at the upper left corner of the image. For grayscale images, writes three values per line (x, y, and value), separated by spaces. For RGB images, writes five values per line (x, y, red, green and blue). The origin of the coordinate system is at the lower left corner of the image.
The number and percentage of non-background pixels is printed to the Log Window↑ if Suppress Log output is not checked.
EditSelectionProperties… [y]

30.14.2Fractal Box Count…

figure images/FractalBoxCount.png
Estimates the fractal dimension (D) of a binary image. D can be used as a measure of pattern complexity (cell shape, vascularization, textures, etc.) and is specially relevant in cases in which Euclidean measures such as diameter or length are not good descriptors of complexity.
The command counts the number of boxes of an increasing size needed to cover a one pixel binary object boundary and implements the method described in T. G. Smith, Jr., G. D. Lange and W. B. Marks, Fractal Methods and Results in Cellular Morphology, J Neurosci Methods, 69:1123--126, 1996.
A plot is generated with the log of size on the X-axis and the log of count on the Y-axis and the data is fitted with a straight line. The slope (S) of the line is the negative of the fractal dimension, i.e., D =  − slope. ‘Size’ (S) and ‘count’ (C) are printed to the Results Table↑. Refer to the source code for additional information.

30.14.3Analyze Line Graph

This command uses the Particle Analyzer↑ to extract sets of coordinate data from digitized line graphs. The following procedure describes how to use it:
  1. Open the image containing the graph. For practice, use the FileOpen SamplesLine Graph (21K) sample image. Make sure your graph is a grayscale image (ImageType8-bit). Analyze Line Graph will assume that the graph is displayed on a white background so images with darker backgrounds must be adjusted beforehand (see e.g., EditInvert [I]↑ and ProcessBinaryMake Binary↑).
  2. Set background color to white using the Color Picker Tool↑ or the Color Picker window↑. Use any of the Area Selection Tools↑ as an eraser (press Backspace to erase) in order to isolate the single graph curve to be measured. Alternatively, use one of the drawing tools (Pencil↑ or Brush↑) to paint directly in background color.
  3. Open the Threshold… [T] tool (Shift T) and adjust the threshold levels so that the curve is highlighted in red.
  4. Select the curve with the Wand Tool↑ and run EditClear Outside↑ to erase everything on the canvas but the curve.
  5. With the line still highlighted by the threshold widget, run AnalyzeToolsAnalyze Line Graph↑ to get the XY coordinates of the traced line (you can hold down Alt while selecting the command to reveal the actual image that is processed ).
  6. On the newly obtained plot, select List, Copy or Save (these commands are described in Plot Profile [k]) to export the curve coordinates into a spreadsheet application.
The exported values are tabulated in pixel coordinates, unless the digitzed graph has been spatially calibrated using AnalyzeSet Scale…↑ or ImageProperties… [P]↑.
Figure Calibration, a simple plugin to retrieve data from other types of graphs such as scatter plots and histograms

30.14.4Curve Fitting…

figure images/CurveFitter.png
Figure 43 ImageJ’s CurveFitter (AnalyzeToolsCurve Fitting…) — ImageJ 1.46g.
ImageJ’s CurveFitter provides a simple tool for fitting various functions to X- and Y-data, using an improved multithreaded simplex algorithm [42]. This strategy (an iterative method) is a kind of “trial and error” procedure in which the parameters of the fitting model are adjusted in a systematic way until the equation fits the data as close as required. It proceeds by: 1) Making first guesses of all the non-linear parameters; 2) Computing the model, comparing it to the data set and calculating a fitting error; 3) If the fitting error is large, the CurveFitter will systematically change parameters and return to step 2). The loop stops when the fitting accuracy is met, which in difficult cases never happen. In the latter case, the procedure terminates after an imposed number of iterations or restarts.
The typical usage of this command is listed below:
  1. Tabular data is entered or copied in the input window or alternatively, a two column text file is opened by clicking on the Open button. Values may be separated by spaces, tabs, commas or semicolons.
  2. The function to be fit is selected from the drop-down menu. Several built-in functions are available (see CurveFitter’s built-in functions↓). User defined functions with up to six parameters are also possible by choosing *User-defined*. Note that elimination of parameters by linear regression does not take place for user-defined functions. As a consequence, the performance of custom functions does not fully match that of built-in functions.
  3. Once the Fit button is pressed, ImageJ displays a graph of the data with the fitted curve as depicted in CurveFitter↑. If Show Settings is checked, detailed information about the fit (including measures of goodness of fit) is printed to the Log Window↑ and the user is prompted to re-adjust the simplex fitting options, namely:
    Maximum number of iterations The number of maximum iterations in which the CurveFitter will try to improve upon the parameter values to get the best fit. Usually the algorithm reaches optimal convergence before reaching the default value.
    Number of restarts To ensure that the result is trustworthy (i.e., that it did not get “stuck” or find a local minimum), CurveFitter tries at least twice to find the minimum, with different starting points. If the two results are not the same, Number of restarts determines how often the algorithm may start two additional runs, until the best two results agree within the error tolerance. There is no limit for the number of restarts, apart from the maximum number of iterations.
  4. Click Apply to create a 32-bit copy (see Image Types and Formats↑) of the current image transformed with the chosen function.
Table 7 CurveFitter’s built-in functions. A more detailed summary of the CurveFitter’s abilities is available online. The complete documentation can be accessed through the ImageJ API. Most functions use linear regression to determine the first two coefficients directly, which generally increases the quality of the result [42]. As explained in Curve Fitting…, simplex fitting options can be adjusted by selecting the Show settings checkbox. For polynomials, the proposed criteria are known to yield optimal convergence.
Function Formula Comments
Straight line y = a + bx cf. Pixel Inverter (AnalyzeCalibrate…)
2nd—8th degree polynomial y = a + bx + cx2 + … + ix8 The range of x values should not be too far from 0, especially for higher-order polynomials
4th degree should fulfill   |xMean| < 2 × (xMax − xMin)
5th degree should fulfill   |xMean| < (xMax − xMin) ⁄ 2
7th & 8th degree should fulfill   |xMean| ≪ xMax − xMin
Power y = a × xb Optionally, fit can be performed without linear regression during minimization. Most curve-fitting programs such as Microsoft® Excel® use regression. Fitting without regression assumes equal weight for all data points and is insensitive to zero or negative data
Exponential y = a × ebx
Exponential with offset y = a × e − (bx) + c
Exponential recovery y = a × (1 − e( − bx)) + c cf. FRAP_Profiler plugin
Log y = a × ln(bx)
y = a + b × ln(x − c)
Rodbard y = (d + (a − d))/(1 + ((x)/(c))b) [42], see DeLean A, Munson PJ, Rodbard D. Simultaneous analysis of families of sigmoidal curves: application to bioassay, radioligand assay, and physiological dose-response curves. Am J Physiol. 1978 Aug;235(2):E97–102 [PMID: 686171]
(NIH Image)
x = (d + (a − d))/(1 + ((y)/(c))b)
Inverse Rodbard y = c × ((x − a)/(d − x))1b
Gaussian y = a + (b − a) × e − ((x − c)2)/(2d2) [42]
Gamma variate y = b × (x − a)c × e − ((x − a)/(d))

30.14.5ROI Manager…

figure images/ROIManager.png
Figure 44 The ROI Manager (AnalyzeToolsROI Manager…) — ImageJ 1.46p.
The ROI (Region of Interest) Manager is a tool for working with multiple selections. Selections↑ can be from different locations on an image, from different slices of a stack or from different images. All selection types, including points, lines and text, are supported.
Add Click Add to add the current selection to the list, or press T, the keyboard shortcut for the EditSelectionAdd to Manager [t] command. The ROI manager creates a three part label. The first part (stacks only) is the slice number, the second is the Y-coordinate of the selection and the third is the X-coordinate. Click on a label to restore the associated selection to the current image. With stacks, the selection is restored to the slice it came from. Hold down Shift while clicking Add to ‘Add and Draw’. Hold down Alt while clicking Add to ‘Add and Rename’.
Install the ROIManagerMacros macro set and you will be able to add a selection by pressing  1, ‘add and rename’ by pressing  2, ‘add and draw’ by pressing  3 and ‘add and advance to the next slice’ by pressing  4.
Update Replaces the selected ROI on the list with the current selection, updating the z/t-position of the ROI in Stacks↑ and Hyperstacks↑.
Delete Deletes the selected ROIs from the list. Deletes all ROIs if none is selected.
Rename… Renames the selected ROI. The chosen string will be used as label (Labels checkbox) if Use ROI names as labels is checked in the MoreOptions… dialog. The selected ROI can also be renamed using the Properties… button. Note that while it is not possible to rename multiple ROIs simultaneous, you can use ROI Manager Tools to rename multiple ROIs.
Measure Measures the selected ROIs, or if none is selected, all ROIs on the list. Use AnalyzeSet Measurements… to specify the measuring parameters.
Deselect  Deselects all ROIs in the list. As mentioned in 26: Selecting ROIs in the ROI Manager↓, when items are deselected subsequent ROI Manager commands are applied to all ROIs.
Properties… Similarly to EditSelectionProperties… [y], opens a dialog box in which is possible to assign a contour color (Stroke color) of a certain Width or a Filling color. Set Stroke width to 0 to have selections drawn using a width of one pixel regardless of the image magnification (see 19: Working with Zoomed Canvases↑).
As previously mentioned, selections can be either filled or contoured, but not both. The nine default selection colors (black, blue, cyan, green, magenta, orange, red, white, yellow) can be typed textually. Any other color must be specified using hex notation (see 20: Hexadecimal Color Values↑).
With Text Tool↑ selections, it is also possible to specify the Font size and Justification.
If multiple ROIs have been selected from the ROI Manager↑’s list (see 26: Selecting ROIs in the ROI Manager↓), properties will be applied to the specified Range of selections.
Flatten [F] Alias for ImageOverlayFlatten [F]↑.
Show All Toggles the display of all ROI Manager Overlays↑. If Labels is active, ROIs will also be labelled. Once Show All is checked, ROIs can be re-activated by Alt-clicking, Control-clicking or long-pressing (14 second or longer). Re-activated selections that are moved or edited are automatically updated.
figure images/ROIManagerClosing.png
When Show All is active and the ROI Manager window is closed, a dialog box is displayed providing the option to save the displayed ROIs by moving them to the image overlay by running ImageOverlayFrom ROI Manager↑. When saving the image as tiff, Overlays↑ are stored in the TIFF header and can later be retrieved using ImageOverlayTo ROI Manager↑.
Labels Toggles overlay labels displayed by Show All. Labels are customized using MoreLabels…, a shortcut to ImageOverlayLabels…
figure images/ROIManagerMenu.png
MoreDisplays a drop-down menu with several additional commands (this menu is also available when right-clicking on the ROI Manager’s list area):
figure images/ROIoperators.png
Figure 45 Logical operations using the ROI Manager (AnalyzeToolsROI Manager…).
26 Selecting ROIs in the ROI Manager
For most ROI Manager↑ operations Deselect works as a Select All button, e.g., to measure all ROIs in manager one would press Deselect then Measure. In addition, it is possible to select contiguous ROIs in the ROI Manager list with a single Shift--click. Non-contiguous ROIs can be selected by Control--click (Command--click on Mac OS X).
When Show All is active, Overlays↑ that are not stored in the ROI Manager will not be re-activated by Alt-clicking, Control-clicking or long-pressing (14 second or longer). This is a reminder that those overlay selections (added to the image overlay via ImageOverlayAdd Selection… [b]) are not under the control of the ROI Manager. You will be able to activate them as soon as Show All is unchecked.

30.14.6Scale Bar…

figure images/ScaleBar.png
Draws a labelled spatial calibration bar.
Width Length of the bar in calibrated units.
Height Height of the bar in pixels.
Font Size Adjusts the font size of the scale bar label.
Color Adjusts the text color (see 18: Embedding Color Annotations in Grayscale Images↑).
Background Adjusts the filling color of the label text box.
Location Adjusts the position of the calibration bar. If there is a selection, the bar is initially drawn at the selection.
Bold Text / Serif Font Specify if label should be typeset in boldface/serif typeface.
Hide Text If checked the bar is drawn without label.
Overlay If checked the bar is created as a non-destructive image overlay (see Overlays↑ and ImageOverlay submenu). If unchecked, the scale bar is drawn invasively.

30.14.7Calibration Bar…

figure images/CalibrationBar.png
Creates an RGB copy of the current image and displays a labelled calibration bar on it (see AnalyzeCalibrate…).
Location Defines the position of the bar. If an area selection is active, the bar is initially drawn at that selection.
Fill Color Defines the bar’s background color.
Label Color Adjusts the text color.
Number of Labels Adjusts the total number of values displayed.
Decimal Places Adjust the number of decimal places present in the labels.
Font Size Adjusts labels font size (labels are drawn bold if Bold Text is checked).
Zoom FactorMagnifies the entire calibration bar canvas. Enter a value less than 1 to reduce the bar size.
The Calibration Bar Macros can be used to add a calibration bar to a stack or to all the images and stacks in a folder.

30.14.8Synchronize Windows

Synchronizes mouse motion and input between multiple windows so that a ROI drawn in one image is replicated in all other Synchronized windows↓ [46]. A synchronization cursor indicates the location of the mouse across the synchronized window set.
figure images/SyncWindows.png
Figure 46 AnalyzeToolsSynchronize Windows, IJ 1.46j. This command can be used to measure ROIs across images, transfer ROIs from a reference image (e.g., a Maximum Intensity Projection, MIP) to multiple images or to use an un-zoomed copy of the active image as a navigator palette.
Synchronized window set Images to be synchronized are specified in this list, containing all open images. To select a consecutive group of images, click the first item, press and hold down Shift, and then click the last item. Alternatively, click on the first item and drag it across. To select non-consecutive images, press and hold down Ctrl, then click each item to be selected. Use the Un/Synchronize All buttons to de/select all listed images.
Sync cursor If checked, the cursor is synchronized across selected images, with the mouse pointer changing to a red X-shape cursor. When unchecked, mouse movements become restricted to the active image.
Sync channelsIf checked, the channel slider (c) is synchronized across the synchronized window set.
Image coordinates If checked, spatial calibration units will be used instead of pixels coordinates. For proper registration, this option should be unchecked when syncing images with different pixel sizes (see ImageProperties… [P]↑).
Sync z-slicesIf checked, the depth slider (z) is synchronized across the synchronized window set.
Sync t-framesIf checked, the frame slider (t) is synchronized across the synchronized window set.
Image scaling If checked, positions to different windows are translated via offscreen coordinates, providing correct registration at different zoom levels.

 Sec. 29: Process Up Part V: Menu Commands Sec. 31: Plugins