HiRISE Operations Center

Department of Planetary Sciences
University of Arizona
Tucson, Arizona

HiView User's Guide
Reference

Statistics

The Statistics tool provides various statistical measures of selected source and display data. This tool is used by the Data Mapper tool to obtain pixel data distributions to appropriately locate Saturation Bounds when applying contrast stretches to the image display.

The Statistics Tool is a dockable tool with a Measurements Panel and a Histograms Panel. When the tool is located in a side dock area the Histograms Panel is not shown; this can result in a more compact application window when only using the Measurements Panel to provide statistics values reports.

Calculating statistics, though not very computationally expensive, will slow the responsiveness of the user interface updates during interactive image display operations, such as scrolling and scaling, when the statistics will be constantly recalculated every time the display is updated. The statistics calculations are not done when not viewing the Statistics tool. So more responsive display rendering can be realized by closing the Statistics tool during intensive image manipulation and then viewing the tool again when the statistics information is desired.

Data Selection

The Statistics Tool is composed of two parts: a Source Data section and a Display Data section. Tab buttons on the bottom of the tool are provided to select the section of the tool to be used.

Source Data

Statistics Tool - Source Data

Source Data refers to the image data from the file at the Source Location. The statistics for the source data are based on the original image pixel values.

Display Data

Statistics Tool - Display Data

Display Data refers to the image as currently shown in the Main Image Viewport, taking into account any scrolling, scaling, alternate band mapping, and/or partially loaded image data. In other words, the Display Image is exactly the image displayed in the Main Image Viewport. The user may choose to think of the display image as the changeable visible image display and the source image as the unchanging data "underneath" the display

While Source Data may contain 0 to many bands of data, HiView's Display Data has three bands: red, green and blue (RGB). Source Data is mapped to Display Data using a lookup table (LUT), resulting in a displayable image. Therefore, while the Source Data panel may display 0 to many histograms - one histogram per band of data in the source image, the Display Data panel will always display 3 histograms - one for the display's red band, one for the green band, and one for the blue band.

Measurements Region

The statistics that are provided are calculated from a selected image region of the Main Window Display Viewport. By default the entire image region in the viewport is used as the statistics Measurements Region. A more specific image region may be selected by clicking and dragging the cursor over the region of interest. The cursor will change to a diagonal Resize Region cursor image while the corner of the image region is being dragged. The selected region will be outlined and highlighted as an overlay of the image display. The selected region may be resized after the selection has been made by clicking and dragging the edges or corners of the selection rectangle. The cursor will change to the corresponding Resize Region cursor when it is over a selection edge or corner. The selected region may be moved to a new location by clicking and dragging the cursor anywhere inside the selected region. The cursor will change to a Shift Region cursor image when it is over the selected region. To revert to using the entire image region in the viewport as the Measurements Region double-click anywhere inside the displayed image region.

The location and size of the statistics image Measurements Region is reported at the top of the Measurements Panel.

Origin
The origin (upper-left corner) of the Measurements Region is reported in the coordinate system of the source image for the Source Data, and in the coordinate system of the Display Viewport for the Display Data.

Size
The width (X), height (Y), and area of the Measurements Region is reported in the pixel units of the source image for the Source Data, and in display pixel units for the Display Data.

When the source image data is rendered from a JP2 file the resolution of the available source data for measurement will depend on the display scaling factor. When the scaling factor is sufficiently small full resolution source data is not rendered. In this case the measured source data is composed of pixel samples at less than full source data resolution. For example, at a display scaling factor of 0.5 each rendered pixel sample corresponds to four full resolution pixels; i.e. a patch 2 pixels wide by two pixels high. At scaling factor 0.25 the patch size increases to four by four; and the patch size continues to double as the scaling factor is halved. The value of low resolution pixel samples is mathematically determined by the combined values of the full resolution pixel values in the patch that the sample represents.

When the statistics Measurements Region is based on low resolution image samples the Area of the actual sample region is listed inside brackets in the Origin row; i.e. this is the actual origin of the measurements.

Measurements

The Measurements panel lists a set of statistical information calculated from the Measurements Region. The values are reported for each source data band mapped to a display band. The Band column labels for the Source Data Measurements panel indicate which source data band is measured. For monochrome source data there is only one band of data and so there will be only one Band column of statistics measurements.

Most of the same measurements are reported for the Source Data and Display Data. Exceptions are noted.

Values
The number of unique pixel Values. In the Histogram this will be the number of occurrences of a non-zero Count along the Values axis.

Below
Above
The total number of pixels below and above the valid data Limits. This is the area of the Histogram below and above Limits Values.

These measures are only relevant for Source Data.

Lowest
Highest
The lowest and highest pixel Values with a non-zero Count.

For Source Data these values will be within the valid data Limits.

Minimum
Maximum
The minimum and maximum Count values.

For Source Data those Values outside the valid data Limits are excluded.

Mean
The arithmetic mean (average) of all pixel sample values.

For Source Data those pixel values outside the valid data Limits are excluded from the calculation.

Median
The median of all pixel sample values. The median is a better measure of the central tendency of pixel sample values than the mean, especially when the pixel sample values occur in multiple clumps represented by more than one significant peak in the Histogram.

For Source Data touse pixel values outside the valid data Limits are excluded from the calculation.

Std. Dev.
The standard deviation of all pixel sample values.

For Source Data pixel values outside the valid data are excluded from the calculation.

Limits

The Source Data section adds two rows to the Measurements Panel concerned with the limits of valid data in the image. Scientific image data is often extensively processed in an effort to compensate for photometric (pixel values) and geometric (image structure) inaccuracies produced by the imaging instrument and/or the observing conditions when the image data was obtained. The results of the image processing algorithms can produce pixel values that are known to be invalid for some reason. For example, when geometrically adjusting the image to provide a spatially aligned data set from an oblique view of a surface area some parts of the new image rectangle may not fall within the area of the original image resulting in invalid background pixel values. Or photometric processing calibration of the pixel values may result in some values that are too high for the available data precision of the resulting image. Invalid pixel values are usually reserved at the extreme range of the possible values; perhaps one or two of the lowest pixel values and a couple of the highest pixel values are used to give to pixels that turn out to have invalid values during image processing. Invalid pixel values should be excluded from statistical measures that are meant to apply to valid image data.

Below
Above
The Below value specifies the lower limit of valid data below which invalid pixel values occur. The Above value specifies the upper limit of valid data above which invalid pixel values occur. These values are remembered (they are "sticky": the current values are stored in the HiView configuration file and restored each time HiView is run). The Above, upper, limit is stored as an offset from the maximum pixel value, so even if the data precision for a source image is different than the data precision of the source image when the value was set, the same number of Above limit invalid pixel values will be used.

The Below and Above Limits are marked on the Histogram Graph as black vertical lines at the corresponding Values locations. The Measurements Panel lists the total number of pixels with values Below and Above the Limits.

Note: When the Limits are moved the Saturation Bounds are forced to remain within the Limits.

Histograms
The Histograms Panel displays histogram plots of each data band used in the statistics Measurements Region. This will be always be all three data bands for the Display Data, and the mapped data band for the Source Data. Each histogram provides a visual representation of how often each pixel value occurs in the Measurements Region.

Plot Values

The histogram plots are colored according to the display band with which they are associated. The height of a bar on the histogram is the Count of pixels with the corresponding Values in the Measurements Region. When the cursor is over the histogram plot canvas it appears as a small crosshair image with its position in the plot - as a Values, Count coordinate - listed next to the cursor. The maximum value of the Values axis is the maximum pixel value.

Count Axis
Max Value

The maximum value of the Count axis is automatically adjusted as the Measurements Region changes if the field about the Count axis says "auto". The value in this field may be set to a specific value to fix the maximum value of the Count axis, and returned to automatic tracking by entering a value of zero.

Histogram Opacity

At the bottom of the Measurements panel are Opacity controls for each band plot of the Histogram. The Opacity value controls how transparent the band plot will be in allowing plots for other bands underneath to show through. An Opacity of 100 has no transparency - i.e. it is 100 percent opaque - and will completely obscure any underlying band plot. Histogram bands are plotted with the red band on top of the green band which is on top of the blue band.

Bounds

Marked on the Source Data Histograms plots are the Saturation Bounds Values for each mapped source band. The marks are short vertical bars of staggered height at the bottom of the plot canvas at the bound's Values location, colored the same as their band and outlined in black for Lower Bounds and white for Upper Bounds.

Lower Bound Upper Bound
When the cursor is over the plot canvas and gets within the sensitivity distance of a Saturation Bounds Values location for a selected band the cursor will change to a vertical bar with pointer in the inward direction of the plot relative to the Saturation Bound value; i.e. the pointer will be directed to the right for a Lower Bound node, and to the left for an Upper Bound node. In addition, the color of the cursor will be the color of the bands for the selected Bounds: red, green, or blue for the corresponding single band; cyan, magenta, or yellow for two corresponding bands - cyan is a combination of green and blue, magenta is a combination of red and blue, yellow is a combination of red and green - and white for all three bands. Only those Bounds for which band selections are enabled will be noticed. Clicking and dragging the cursor will relocate the selected Saturation Bounds to new Values and cause the image data to be immediately remapped to the display.