UNU-CMEDIAN(1)
π UNU-CMEDIAN(1) β bestie edition π
okay so this is unu-cmedian, a little User Commands page from section 1, and it's all about cheap histogram-based median/mode filtering. yes the filter is cheap. no it does not care about your feelings. let's go β¨
πΈ NAME πΈ
unu-cmedian β cheap histogram-based median/mode filtering
π¦ SYNOPSIS π¦
unu cmedian -r,--radius <radius> [-mode] [-b,--bins <num>] [-w,--weight
<weight>] [-p,--pad] [-c,--channel] [-i,--input <nin>] [-o,--output
<nout>]
π DESCRIPTION π
Cheap histogram-based median/mode filtering. that's the whole vibe. but here's the fine print, bestie, and it matters:
- It only works on 1, 2, or 3 dimensions. that's it. don't try to be cute with 4D.
- The window you filter over is always square. always. no other shapes, no exceptions.
- There's only a simplistic weighting scheme available. that's what we've got. π«Ά
- It's cheap because it does the median or mode based on a histogram β which enforces a quantization to the number of bins in that histogram. translation: you'll probably lose precision on anything that isn't 8-bit data. π
- Also, integral values can be recovered exactly only when the number of bins is exactly
min-max+1(as reported byunu-minmax(1)). so like, do the math first, iykyk. - Uses
nrrdCheapMedian, plusnrrdSliceandnrrdJoinin case of β-cβ
β¨ OPTIONS β¨
-r <radius>,--radius <radius>β how big a window to filter over. β-r 1β leads to a3x3window in an image, and a3x3x3window in a volume (unsigned int)-modeβ by default, median filtering is done. Using this option enables mode filtering, in which the most common value is used as output-b <num>,--bins <num>β # of bins in histogram. It is in your interest to minimize this number, since big histograms mean slower execution times. 8-bit data needs at most256bins. (unsigned int); default: β256β-w <weight>,--weight <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β 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.-c,--channelβ Slice the input along axis0, run filtering on all slices, and join the results back together. This is the way you'd want to process color (multi-channel) images or volumes. π-i <nin>,--input <nin>β input nrrd-o <nout>,--output <nout>β output nrrd (string); default: β-β
π SEE ALSO π
bestie reminder: -p costs you memory, big bin counts cost you time, and non-8-bit data costs you precision. it's giving tradeoffs. π
okay that's the whole page!! this one's from May 2021, page UNU-CMEDIAN(1), and you can find its source/version info right there in that footer. slay, go filter something. πβ¨π¦
π¦ where this page comes from
- fedora 43: teem 1.11.0-83.fc43 Β· LGPL-2.1-or-later WITH LicenseRef-Fedora-Temporary-Simple-Library-exception
- fedora 43: teem 1.11.0-86.fc43 Β· LGPL-2.1-or-later WITH Simple-Library-Usage-exception
- fedora 44: teem 1.11.0-87.fc44 Β· LGPL-2.1-or-later WITH Simple-Library-Usage-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms