UNU-CMEDIAN(1)

πŸ“¦ version 1.11.0, in fedora 43, fedora 44

πŸ’– 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 by unu-minmax(1)). so like, do the math first, iykyk.
  • Uses nrrdCheapMedian, plus nrrdSlice and nrrdJoin in case of β€œ-c”

✨ OPTIONS ✨

  • -r <radius>, --radius <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 (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 most 256 bins. (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 axis 0, 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 πŸŽ€

unu(1), unu-minmax(1)


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