unu cmedian: Cheap histogram-based median filtering. Only works on 1, 2, or 3
dimensions. The window over which filtering is done is always square, and only
a simplistic weighting scheme is available. The filtering works by forming a
histogram of the values in the window, and updating it as the window slides
through the volume. Because of this histogramming, precision will be lost on
anything other than 8-bit data (assuming a sane # bins "-b"). Also, this is
"cheap" because it doesn't do any filtering on the border (as defined by
radius "-r"); values at these locations are simply copied from input.
Usage: unu cmedian -r <radius> [-b <bins>] [-w <weight>] [-p] [-i <nin>] \
[-o <nout>]
-r <radius> = how big a window to filter over. "-r 1" leads to a 3x3 window
in an image, and a 3x3x3 window in a volume (int)
-b <bins> = # of bins in histogram (int); default: "2048"
-w <weight> = How much higher to preferentially weight samples that are
closer to the center of the window. "1.0" weight means that all
samples are uniformly weighted over the window, which
facilitates a simple speed-up. (float); default: "1.0"
-p = Pad the input (with boundary method "bleed"), and crop the
output, so as to overcome our cheapness and correctly handle the
border. Obviously, this takes more memory.
-i <nin> = input nrrd
-o <nout> = output nrrd (string); default: "-"