UNU-1OP(1)

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

πŸ’… unu-1op β€” bestie edition ✨

okay so you know unu? this is the unary operation girlie of the family. she lives in the User Commands section of the manual, section 1, and she is so good at her one job. one nrrd in, one nrrd out, one operation applied to literally every value. no cap. πŸŽ€


✨ NAME ✨

unu-1op β€” unary operation on a nrrd πŸ¦‹


🌸 SYNOPSIS 🌸

unu 1op <operator> [-s,--seed <seed>] [-t,--type <type>] [-i,--input
<nin>] [-o,--output <nout>]

πŸ’– DESCRIPTION πŸ’–

Unary operation on a nrrd. that's it. that's the whole vibe. πŸ’…

  • Uses nrrdArithUnaryOp (the actual math machinery behind the scenes, she's iconic)

πŸ‘‘ OPTIONS πŸ‘‘

  • operator β€” the unary operator, bestie. Possibilities include:
    • β€œ-”: negative (multiply by -1.0) πŸ™ˆ
    • β€œr”: reciprocal (1.0/value)
    • β€œsin”, β€œcos”, β€œtan”, β€œasin”, β€œacos”, β€œatan”: same as in C 🧚
    • β€œexp”, β€œlog”, β€œlog10”: same as in C
    • β€œlog1p”, β€œexpm1”: accurate log(x+1) and exp(x)-1 ✨
    • β€œlog2”: log base 2
    • β€œsqrt”, β€œcbrt”, β€œceil”, β€œfloor”: same as in C 🌸
    • β€œerf”: error function (integral of Gaussian) πŸ”₯
    • β€œrup”, β€œrdn”: round up or down to integral value
    • β€œabs”: absolute value πŸ’œ
    • β€œsgn”: -1, 0, 1 if value is <0, ==0, or >0
    • β€œexists”: 1 iff not NaN or +/-Inf, 0 otherwise
    • β€œrand”: random value in [0.0,1.0), no relation to input πŸ’€
    • β€œnrand”: random sample from normal distribution with mean 0.0 and stdvi 1.0, no relation to input 😭
    • β€œif”: if input is non-zero, 1, else 0
    • β€œ0”: output always 0
    • β€œ1”: output always 1 πŸ‘‘
  • -s <seed> , --seed <seed> β€” seed value for the RNG, for rand and nrand, so that you can get repeatable results between runs. or, by not using this option, the RNG seeding will be based on the current time (string). so like, chaos mode by default, deterministic mode if you ask nicely πŸŽ€
  • -t <type> , --type <type> β€” convert input nrrd to this type prior to doing operation. useful when the desired output is float (e.g., with log1p) but the input is integral. by default (not using this option), the types of the input nrrds are left unchanged. she's not gonna touch your types unless you tell her to, fr fr
  • -i <nin> , --input <nin> β€” input nrrd πŸ¦‹
  • -o <nout> , --output <nout> β€” output nrrd (string); default: β€œ-” πŸ’…

🌈 SEE ALSO 🌈

unu(1) ✨

abs(3), acos(3), asin(3), atan(3), cbrt(3), ceil(3), cos(3), erf(3), exp(3), expm1(3), fabs(3), floor(3), isfinite(3), log(3), log10(3), log1p(3), log2(3), rand(3), sin(3), sqrt(3), tan(3) πŸ§šπŸ’–


okay one (1) warning-ish thing bestie: rand and nrand genuinely do not care about your input at all. zero relation. if you want the same numbers twice, use -s/--seed. periodt. πŸ’…

and that's the whole page, bestie!! this one's from the UNU-1OP(1) manual, August 2021 edition, and yeah she's still sitting in section 1 of User Commands where she belongs. mwah πŸ’–πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from