UNU-DIST(1)

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

πŸ’– UNU-DIST(1) β€” bestie's guide to the Euclidean distance transform πŸ’–

okay so like, welcome to unu-dist, part of the unu user commands era (yes it lives in section 1 of the manual, we're fancy). this is the ✨Euclidean distance transform✨ and honestly? it's giving main character energy. buckle up πŸŽ€


✨ NAME ✨

unu-dist β€” Euclidean distance transform πŸ¦‹


✨ SYNOPSIS ✨

unu dist -th,--thresh <val> [-b,--bias <val>] [-t,--type <type>] [-sgn]
[-inv] [-i,--input <nin>] [-o,--output <nout>]

✨ DESCRIPTION ✨

so basically it's a Euclidean distance transform, no cap. it's based on β€œDistance Transforms of Sampled Functions” by Pedro F. Felzenszwalb and Daniel P. Huttenlocher, Cornell Computing and Information Science TR2004-1963 β€” literal icons, we stan πŸ’…

here's the tea on how it works: this function first thresholds at the specified value and then does the distance transform of the resulting binary image. two steps, one slay ✨

the signed distance (negative values inside the object) is also available if you want it β€” more on that below. and distances between non-isotropic samples are handled correctly, which, like, thank god 😭

  • Uses nrrdDistanceL2 or nrrdDistanceL2Signed

✨ OPTIONS ✨

  • -th <val>, --thresh <val> β€” the threshold value that separates inside from outside (a double). this one's required bestie, it's not optional, the synopsis said so 🫢
  • -b <val>, --bias <val> β€” if it's non-zero, this biases the distance transform by this amount times the difference in value from the threshold (a double). default: "0.0" β€” so yeah, zero bias unless you say otherwise πŸ’–
  • -t <type>, --type <type> β€” the type to save output in. default: "float" ✨
  • -sgn β€” also compute signed (negative) distances inside objects, instead of leaving them as zero. so instead of a flat zero inside, you get those lil negative numbers πŸ‘‘
  • -inv β€” values below threshold are considered interior to the object. by default (aka when you don't use this option), values above threshold are considered interior. so this literally flips the vibe check on what counts as "inside" 🌸
  • -i <nin>, --input <nin> β€” input nrrd πŸ¦‹
  • -o <nout>, --output <nout> β€” output nrrd (a string); default: "-" (which means stdout, standard behavior, iconic) πŸ’œ

✨ SEE ALSO ✨

unu(1) β€” go read it, it's the whole family, iykyk 🫢


lowkey reminder: -th/--thresh has no default and is not bracketed in the synopsis, so bestie, you gotta give it a value. no skipping πŸ’€

and that's the whole page!! 🌈 this was the unu-dist manual, from the User Commands era, dated May 2021 β€” mwah, periodt, go transform some distances πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from