Hide
 Sec. 26: Process Up Part V: Menu Commands Sec. 28: Plugins

27Analyze

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

27.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 first four tools in the toolbar (cf. Area Selection Tools↑). For linear selections (Straight, Segmented and Freehand lines, cf. Line Selection Tools↑) length and angle (straight lines only) are also calculated. For Point selections (cf. 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 (cf. Point Tool↑).
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 area selections, the following parameters can be recorded: Area, Center of Mass, Centroid, Perimeter, Bounding Rectangle, Shape Descriptors, Fitted Ellipse, Feret’s Diameter, Skewness, Kurtosis and Area Fraction.
With line selections, the following parameters can be recorded: Length, Angle (straight lines only), and Bounding Rectangle. The mean, standard deviation, etc. are calculated from the values of the pixels along the line.

27.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 EdgesInclude HolesSize: 0-50 Circ.: 0.5-1.0
figure images/AnalyzeParticlesDemo-1.png
Size: 0- Circ.: 0.0-0.5Size: 0- Circ.: 0.3-0.5Size: 0- Circ.: 0.0-0.3Size: 50- Circ.: 0.5-1.0
figure images/AnalyzeParticlesDemo-2.png
Figure 33 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), cf. 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 Particle Analyzer). Note that with IJ 1.44e and later, the particle analyzer will display a blank image when the count of detected particles is zero and Show is not Nothing. The font size and line width used can be change in a macro by using call("ij.plugin.filter.ParticleAnalyzer.setFontSize", size); and call("ij.plugin.filter.ParticleAnalyzer.setLineWidth", width); in a macro or ParticleAnalyzer.setFontSize(size); ParticleAnalyzer.setLineWidth(width); in a script or plugin.
Nothing Neither images nor overlays will be displayed.
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.
Original (thresholded)OutlinesBare OutlinesMasks
figure images/AnalyzeParticlesShowOptions-1.png
EllipsesCount MasksOverlay OutlinesOverlay Masks
figure images/AnalyzeParticlesShowOptions-2.png
Figure 34 Display options of Particle Analyzer (AnalyzeAnalyze Particles…↑), IJ 1.44l.

27.3Summarize

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

27.4Distribution…

figure images/Distribution.png
Produces a relative frequency histogram from the data of a chosen column of the Results table [33].
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

27.5Label

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.

27.6Clear Results

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

27.7Set Measurements…

figure images/SetMeasurements.png
Use this dialog box to specify which measurements are recorded by AnalyzeMeasure… [m]↑, ROI Manager’s Measure command (cf. ROI Manager…) and AnalyzeAnalyze Particles…↑ Measurements are performed on the current selection, the entire active image if no selection is present. For thresholded images, 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:
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 length of the object’s projection in the X (FeretX) and Y (FeretY) direction is 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. Each measured selection will be displayed with an accompanying numeric label, matching its row in the Results Table↑. Selections color can be changed in EditOptionsColors…↑ or by double clicking on the Point Tool↑. The numeric label is defined by the “Show All” color in ROI Manager↓’s MoreOptions… widget.
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]).

27.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’.
ImageJ will have automatically filled in the Distance in Pixels field based on the length of the line selection.
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 23: Global Calibrations↓.
Click to Remove Scale resets Distance in Pixels field and Know Distance to zero and the Unit of Length to ‘pixel’.

27.9Calibrate…

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.
figure images/Calibrate.png
Note that to create a calibration curve, the left column must contain a list of measured mean pixel values and the right column must contain the same number of calibration standard values.
The ImageJ web site has a tutorial on Optical Density Calibration explaining how to calibrate an image to an optical density step tablet.
  1. Before using this command, use AnalyzeClear Results↑ to reset the measurement counter and use one of the selection tools and AnalyzeMeasure… [m]↑ to record the mean gray value of each of the standards.
  2. When finished making the measurements, select AnalyzeCurve Fitting…↓ 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’. ImageJ will then display the calibration function on a separate window.
  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 fourteen functions that can be chosen from the drop-down menu (described in Curve Fitting…↓) two other functions are available that do not require any measurement of OD standards:
Uncalibrated OD Causes ImageJ to convert gray values from 8-bit images to uncalibrated optical density values using the function Unc. OD = log10(255 Pixel value).
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.
23 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.

27.10Histogram [h]  [I]  [I] 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.

figure images/Histogram.png
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 [34]. 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).
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 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…↑. 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 or 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. (27.10↓) Histogram [h]).
Obtaining Histogram Lists
1 // 1. Single images: 
2 run("Blobs (25K)"); 
3 getHistogram(values, counts, 256); 
4 for (i=0; i<values.length; i++)
5     print(values[i], counts[i]);
67 // 2. Entire stacks:
8 run("T1 Head (2.4M, 16-bits)");
9 run("Histogram", "stack");
10 Plot.getValues(values, counts);
11 for (i=0; i<values.length; i++)
12     print(values[i], counts[i]);

27.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. NaNs 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…↑
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.

27.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

27.13Gels

Use the commands in this submenu to analyze one-dimensional electrophoretic gels. 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 the 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 wiki page 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.

27.14Tools

This submenu provides access to various image analysis plugins.

27.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.

27.14.2Fractal Box Count…

figure images/FractalBoxCount.png
This command is used to estimate 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.

27.14.3Analyze Line Graph

figure images/AnalyzeLineGraph.png
ImageJ can be used to recover numeric coordinate data from scanned line graphs using the following procedure. Steps 2 and 3 are not necessary for binary (black and white) graphs. For practice, use the FileOpen SamplesLine Graph sample image.
  1. Open the image containing the graph.
  2. Open the Threshold… [T]↑ tool (Shift T). Adjust the threshold so the graph is highlighted in red.
  3. Click on Apply (make sure foreground is black and background is white).
  1. [4.]Use the Elliptical Selection Tool↑ as an eraser (press Backspace to erase) to isolate a single curve (NB: background color must be white, cf. Color Picker… [K]↑).
  2. Select the curve by clicking to the left of it with the Wand Tool↑.
  3. Use EditClear Outside↑ to erase everything but the curve.
  4. Use AnalyzeToolsAnalyze Line Graph↑ to get the XY coordinates.
figure images/CurveFitter.png
Figure 40 ImageJ’s curve fitter (AnalyzeToolsCurve Fitting…↓) — ImageJ 1.44l.
Table 6 Summary of ImageJ’s CurveFitter functions. The complete documentation for the CurveFitter class is available at http://imagej.nih.gov/ij/developer/api/ij/measure/CurveFitter.html.
FunctionFormulaComments
Straight Liney = a + bxcf. Pixel Inverter (Calibrate…↑)
2nd Degree Polynomialy = a + bx + cx2
3rd Degree Polynomialy = a + bx + cx2 + dx3
4th Degree Polynomialy = a + bx + cx2 + dx3 + ex4
5th Degree Polynomialy = a + bx + cx2 + dx3 + ex4 + fx5Via the *User-defined* option
Exponentialy = a × ebx
Powery = axb
Logy = a × ln(bx)
Gamma Variatey = a × (x − b)c × e − ((x − b)/(d))
Rodboardy = (d + (a − d))/(1 + ((x)/(c))b)[35]
Exponential with Offsety = a × e − (bx) + c
Gaussiany = a + (b − a) × e − ((x − c)2)/(2d2)[35]
Exponential Recoveryy = a × (1 − e( − bx)) + ccf. FRAP_Profiler plugin

27.14.4Curve Fitting…

ImageJ’s curve fitter provides a very simple tool for fitting various functions to X- and Y-data. 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. Fourteen built-in functions are available. User defined functions with up to six parameters are also possible by choosing *User-defined*. In this case, Formula and Fitting Options must be specified by the user.
  3. Once the Fit button is pressed, ImageJ displays a graph of the data with the fitted curve as well as a log window containing information about the fit and the values of the fitted parameters if Show Settings is checked.
  4. Click Apply to create a 32-bit copy of the current image transformed with the chosen function.
figure images/ROIManager.png
Figure 41 The ROI Manager (AnalyzeToolsROI Manager…) — ImageJ 1.45i.

27.14.5ROI Manager…

The ROI (Region of Interest) Manager is a tool for working with multiple selections. The 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. With IJ 1.45 it also updates the z/t-position of the ROI in stacks/hyperstacks.
Delete Deletes the selected ROIs from the list. Deletes all the ROIs if none is selected.
Rename… Renames the selected ROI. The chosen string will be used as Edit Mode label if Use ROI names as labels is checked in the MoreOptions… dialog. The selected ROI can also be renamed using the Properties… button.
Measure Measures the selected ROIs, or if none is selected, all ROIs on the list. Use AnalyzeSet Measurements… to specify the parameters to measure.
Deselect Deselects any selected ROIs on the list. Delete, Measure, MoreSave…, and MoreCombine work with all ROIs on the list when none are selected.
Properties… Opens a dialog box (depicted in ROI Manager↑) in which is possible to assign a contour color (Stroke color) of a certain Width or a Filling color. With text selections (see Text Tool↑), it is also possible to specify the Font size and Justification.
As explained for EditSelectionProperties… [y], 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↑). If multiple ROIs have been selected from the Manager’s list (see 24: Selecting Multiple ROIs in the ROI Manager↓), properties will be applied to the specified Range of selections.
Flatten [F] Alias for ImageOverlayFlatten [F]↑.
Show All Toggles a non-destructive overlay that outlines all ROI Manager selections. If Edit Mode is active selections will also be labelled. In this case, click on a label (selection number) in the overlay to activate the corresponding selection. That selection can then be moved or edited and the overlay will be dynamically updated. The color and behavior of the Show All overlay can be changed in the MoreOptions… dialog box.
Edit Mode Toggles selection labels displayed by Show All. As mentioned, clicking on a label activates its selection allowing edit operations.
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/ROIManagerMenu.png
Open… Opens a .roi file and adds it to the list or opens a ZIP archive (.zip file) and adds all the selections contained in it to the list. Use the Open All macro to add all the .roi files in a folder.
Save… Saves the selected ROI as a .roi file. If no ROIs are selected, saves all the ROI Manager selections in a ZIP archive.
Fill Alias for EditFill [f]↑.
Draw Alias for EditDraw [d]↑.
AND Uses the conjunction operator on the selected ROIs to create a composite selection. All ROIs are considered if none is selected.
OR (Combine) Uses the union operator on the selected ROIs to create a composite selection. Combines all ROIs if none is selected.
XOR Uses the exclusive or operator on the selected ROIs to create a composite selection [36]. All ROIs are considered if none is selected.
Split Splits the current selection (it must be a composite selection) into its component parts and adds them to the ROI Manager.
Add Particles Adds objects segmented by the particle analyzer to the ROI Manager. Requires that Record Starts be checked in the AnalyzeAnalyze Particles…↑ dialog box. Particle analyzer objects can also be added to the ROI Manager by checking Add to Manager in the Analyze Particles dialog box.
figure images/ROIManagerMultiMeasure.png
Multi Measure Measures all the ROIs on all slices in the stack, creating a Results table with either one row per slice (if One Row Per Slice is checked in the dialog) or one row per measurement [37].
Multi Plot  Runs AnalyzePlot Profile [k] on the selected ROIs on a single graph [38]. All selections are plotted if none is selected. When plotting less than seven selections colored lines are drawn: blue (ROI 1), green (ROI 2), magenta (ROI 3), red (ROI 4), cyan (ROI 5) and yellow (ROI 6). Profiles with more selections are drawn in gray tones.
While AnalyzePlot Profile [k] requires a line or rectangular selection, Multi Plot accepts all type of selections by first running EditSelectionArea to Line, which converts oval and freehand ROIs to line selections.
Sort Sorts the list in alphanumeric order.
Specify… Alias for EditSelectionSpecify…↑
Remove Slice Info Removes the information in the ROI names that associates them with particular stack slices (see ROI Manager↑).
Options…Displays a dialog box (depicted in ROI Manager↑) that allows you to set several ROI Manager settings:
figure images/ROIoperators.png
Figure 42 Logical operations using the ROI Manager (AnalyzeToolsROI Manager…).
24 Selecting Multiple 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 with a single Shift--click. Non-contiguous ROIs can be selected by Control--click (Command--click on Mac OS X).

27.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 ImageOverlay submenu). If unchecked, the scale bar is drawn invasively. Note that previously added overlays are removed when using this option.

27.14.7Calibration Bar…

figure images/CalibrationBar.png
Creates an RGB copy of the current image and displays a labelled calibration bar on it.
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.


 Sec. 26: Process Up Part V: Menu Commands Sec. 28: Plugins