unu-quantize - Man Page

quantize values to 8, 16, or 32 bits

Synopsis

unu quantize -b,--bits <bits> [-min,--minimum <value>] [-max,--maximum <value>] [-hb,--bins <bins>] [-blind8 <bool>] [-i,--input <nin>] [-o,--output <nout>]

Description

Quantize values to 8, 16, or 32 bits. Input values can be fixed point (e.g. quantizing ushorts down to uchars) or floating point. Values are clamped to the min and max before they are quantized, so there is no risk of getting 255 where you expect 0 (with unsigned char output, for example). The min and max can be specified explicitly (as a regular number), or in terms of percentiles (a number suffixed with “%”, no space in between). This does only linear quantization. See also unu-convert(1), unu-2op(1) x, and unu-3op(1) clamp.

Options

-b <bits> , --bits <bits>

Number of bits to quantize down to; determines the type of the output nrrd:

  • 8”: unsigned char
  • 16”: unsigned short
  • 32”: unsigned int
-min <value> , --minimum <value>

The value to map to zero, given explicitly as a regular number, or, if the number is given with a “%” suffix, this minimum is specified in terms of the percentage of samples in input that are lower. “0%” means the lowest input value is used, “1%” means that the 1% of the lowest values are all mapped to zero. By default (not using this option), the lowest input value is used. (string); default: “nan

-max <value> , --maximum <value>

The value to map to the highest unsigned integral value, given explicitly as a regular number, or, if the number is given with a “%” suffix, this maximum is specified in terms of the percentage of samples in input that are higher. “0%” means the highest input value is used, which is also the default behavior (same as not using this option). (string); default: “nan

-hb <bins> , --bins <bins>

number of bins in histogram of values, for determining min or max by percentiles. This has to be large enough so that any errant very high or very low values do not compress the interesting part of the histogram to an inscrutably small number of bins. (unsigned int); default: “5000

-blind8 <bins>

if not using “-min” or “-max”, whether to know the range of 8-bit data blindly (uchar is always [0,255], signed char is [-128,127]) (bool); default: “true”, "true"

-i <nin> , --input <nin>

input nrrd

-o <nout> , --output <nout>

output nrrd (string); default: “-

See Also

unu(1), unu-unquantize(1), unu-convert(1), unu-2op(1) x, unu-3op(1) clamp

Referenced By

unu(1), unu-convert(1), unu-unquantize(1).

August 2021