Module ij
Package ij.process

# Class ImageStatistics

java.lang.Object
ij.process.ImageStatistics

All Implemented Interfaces:
  `Measurements`

Direct Known Subclasses:
  `ByteStatistics`, `ColorStatistics`, `FloatStatistics`, `ShortStatistics`, `StackStatistics`

public class ImageStatistics extends Object implements Measurements
Statistics, including the histogram, of an image or selection.

## Field Summary

Fields
Modifier and Type
Field
Description
`double`
`angle`
Angle in degrees of fitted ellipse
`double`
`area`
`double`
`areaFraction`
`double`
`binSize`
`protected Calibration`
`cal`
`double`
`dmode`
Mode
`protected int`
`height`
`double`
`histMax`
`double`
`histMin`
`int[]`
`histogram`
Use the hIstogram() method to get the histogram as a double array.
`int[]`
`histogram16`
Bin width 1 histogram of 16-bit images
`int`
`histYMax`
`double`
`kurtosis`
`protected long[]`
`longHistogram`
Long histogram; use getHIstogram() to retrieve.
`long`
`longPixelCount`
Long pixel count
`double`
`lowerThreshold`
Minimum threshold when "Limit to threshold" enabled
`double`
`major`
Length of major axis of fitted ellipse
`double`
`max`
`int`
`maxCount`
`double`
`mean`
`double`
`median`
`double`
`min`
`double`
`minor`
Length of minor axis of fitted ellipse
`int`
`mode`
Mode of 256 bin histogram (counts limited to 2^31-1)
`int`
`nBins`
`protected double`
`ph`
`int`
`pixelCount`
Int pixel count (limited to 2^31-1)
`protected double`
`pw`
`protected int`
`rh`
`double`
`roiHeight`
`double`
`roiWidth`
`double`
`roiX`
`double`
`roiY`
`protected int`
`rw`
`protected int`
`rx`
`protected int`
`ry`
`double`
`skewness`
`boolean`
`stackStatistics`
Used by HistogramWindow
`double`
`stdDev`
`double`
`umean`
Uncalibrated mean
`double`
`upperThreshold`
Maximum threshold when "Limit to threshold" enabled
`protected int`
`width`
`double`
`xCenterOfMass`
`double`
`xCentroid`
`int`
`xstart`
Used internally by AnalyzeParticles
`double`
`yCenterOfMass`
`double`
`yCentroid`
`int`
`ystart`
Used internally by AnalyzeParticles

### Fields inherited from interface ij.measure.Measurements

`ADD_TO_OVERLAY, ALL_STATS, AREA, AREA_FRACTION, CENTER_OF_MASS, CENTROID, CIRCULARITY, ELLIPSE, FERET, INTEGRATED_DENSITY, INVERT_Y, KURTOSIS, LABELS, LIMIT, MAX_STANDARDS, MEAN, MEDIAN, MIN_MAX, MODE, NaN_EMPTY_CELLS, PERIMETER, RECT, SCIENTIFIC_NOTATION, SHAPE_DESCRIPTORS, SKEWNESS, SLICE, STACK_POSITION, STD_DEV`

## Constructor Summary

Constructors
Constructor
Description
`ImageStatistics()`

## Method Summary

Modifier and Type
Method
Description
`void`
`drawEllipse(ImageProcessor ip)`
`long[]`
`getHistogram()`
Returns the histogram as an array of longs.
`static ImageStatistics`
`getStatistics(ImageProcessor ip)`
Calculates and returns uncalibrated (raw) statistics for the specified image, including histogram, area, mean, min and max, standard deviation and mode.
`static ImageStatistics`
`getStatistics(ImageProcessor ip, int mOptions, Calibration cal)`
Calculates and returns statistics for the specified image using the specified measurent options and calibration.
`double[]`
`histogram()`
Returns the histogram as an array of doubles.
`protected void`
`saveThreshold(double minThreshold, double maxThreshold, Calibration cal)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### histogram

public int[] histogram
Use the hIstogram() method to get the histogram as a double array.

### pixelCount

public int pixelCount
Int pixel count (limited to 2^31-1)

### longPixelCount

public long longPixelCount
Long pixel count

### dmode

public double dmode
Mode

### mode

public int mode
Mode of 256 bin histogram (counts limited to 2^31-1)

### area

public double area

### min

public double min

### max

public double max

### mean

public double mean

### median

public double median

### stdDev

public double stdDev

### skewness

public double skewness

### kurtosis

public double kurtosis

### xCentroid

public double xCentroid

### yCentroid

public double yCentroid

### xCenterOfMass

public double xCenterOfMass

### yCenterOfMass

public double yCenterOfMass

### roiX

public double roiX

### roiY

public double roiY

### roiWidth

public double roiWidth

### roiHeight

public double roiHeight

### umean

public double umean
Uncalibrated mean

### major

public double major
Length of major axis of fitted ellipse

### minor

public double minor
Length of minor axis of fitted ellipse

### angle

public double angle
Angle in degrees of fitted ellipse

### histogram16

public int[] histogram16
Bin width 1 histogram of 16-bit images

### longHistogram

protected long[] longHistogram
Long histogram; use getHIstogram() to retrieve.

### areaFraction

public double areaFraction

### xstart

public int xstart
Used internally by AnalyzeParticles

### ystart

public int ystart
Used internally by AnalyzeParticles

### stackStatistics

public boolean stackStatistics
Used by HistogramWindow

### lowerThreshold

public double lowerThreshold
Minimum threshold when "Limit to threshold" enabled

### upperThreshold

public double upperThreshold
Maximum threshold when "Limit to threshold" enabled

### histMin

public double histMin

### histMax

public double histMax

### histYMax

public int histYMax

### maxCount

public int maxCount

### nBins

public int nBins

### binSize

public double binSize

### width

protected int width

### height

protected int height

### rx

protected int rx

### ry

protected int ry

### rw

protected int rw

### rh

protected int rh

### pw

protected double pw

### ph

protected double ph

### cal

protected Calibration cal

## Constructor Details

### ImageStatistics

public ImageStatistics()

## Method Details

### getStatistics

public static ImageStatistics getStatistics(ImageProcessor ip)
Calculates and returns uncalibrated (raw) statistics for the specified image, including histogram, area, mean, min and max, standard deviation and mode. Use ImageProcessor.setRoi(x,y,width,height) to limit statistics to a rectangular area and ImageProcessor.setRoi(Roi) to limit to a non-rectangular area.

See Also:
  - `ImageProcessor.setRoi(int,int,int,int)`
  - `ImageProcessor.setRoi(Roi)`
  - `ImageProcessor.getStats()`

### getStatistics

public static ImageStatistics getStatistics(ImageProcessor ip, int mOptions, Calibration cal)
Calculates and returns statistics for the specified image using the specified measurent options and calibration. Use ImageProcessor.setRoi(x,y,width,height) to limit statistics to a rectangular area and ImageProcessor.setRoi(Roi) to limit to a non-rectangular area.

See Also:
  - `ImageProcessor.setRoi(int,int,int,int)`
  - `ImageProcessor.setRoi(Roi)`
  - `Measurements`

### drawEllipse

public void drawEllipse(ImageProcessor ip)

### histogram

public double[] histogram()
Returns the histogram as an array of doubles.

### getHistogram

public long[] getHistogram()
Returns the histogram as an array of longs.

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### saveThreshold

protected void saveThreshold(double minThreshold, double maxThreshold, Calibration cal)