Skip to documentation
DocumentationAll documentsEnglish

USTATS(1)

NAME

ustats - compute basic statistics of a stream of unsigned short integers

On this page

SYNOPSIS

ustats [-h] [file]

DESCRIPTION

ustats reads a stream of 16-bit unsigned short integers (0 to 65535) and computes basic statistics on the data, printing them to standard output as a small text block. Input is read from the named file if given, otherwise from standard input.

The reported statistics are the number of samples (Num), the minimum (Min) and maximum (Max) values, the Sum of all values, the arithmetic Mean, and the sample standard deviation (SStdev).

It is a companion to the other signal-processing statistics tools such as istats(1) (signed shorts) and dstats(1) (doubles).

OPTIONS

-h

Print a usage message and exit.

EXAMPLES

Example 1. Summarize 16-bit unsigned image data
pix-bw scene.pix | bw-d | d-u > scene.ushorts
ustats scene.ushorts

Converts a color image to single-channel data, then to unsigned shorts, and reports the value distribution (min, max, mean, standard deviation) useful for checking the dynamic range of the data before further processing.

Example 2. Compute statistics from a pipeline
ustats < samples.ushorts

Reads unsigned short values directly from standard input and prints the statistical summary, suitable for inclusion in a shell pipeline.

SEE ALSO

brlcad(1), istats(1), dstats(1), ihist(1), umod(1)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org