converts a "int32_t" image to a "byte" image
converts a "int32_t" image to a "ushort" image
Usage: long2byte in.pgm [mode] [n] out.pgm
Description:
Depending on the value given for the (optional) parameter mode:
- mode = 0 (default) : for all x, out[x] = min(255, in[x]).
- mode = 1 : for all x, out[x] = in[x] modulo 256.
- mode = 2 : scales values in the range 0-255.
- mode = 3 : sorts the values by decreasing number of occurence in the image. Replaces the values by their order. Only the n (default 255) first values are kept. Useful for label images.
- mode = 4 : truncation of the square root in the range 0-255.
- mode = 5 : truncation of the log in the range 0-255.
Types supported: int32_t 2d, int32_t 3d
Category: convert
- Author:
- Michel Couprie
Usage: long2byte in.pgm [mode] out.pgm
Description:
Depending on the value given for the (optional) parameter mode:
- mode = 0 (default) : for all x, out[x] = min(USHRT_MAX, in[x]).
- mode = 1 : for all x, out[x] = in[x] modulo USHRT_MAX.
- mode = 2 : scales values in the range 0-USHRT_MAX.
- mode = 4 : truncation of the square root in the range 0-255.
- mode = 5 : truncation of the log in the range 0-255.
Types supported: short_image (any D)
Category: convert
- Author:
- Laszlo Marak, 2011