Your company here — click to reach over 10,000 unique daily visitors

unu-1op - Man Page

unary operation on a nrrd


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


Unary operation on a nrrd.



Unary operator. 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 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)

-t <type> , --type <type>

convert input nrrd to this type prior to doing operation. Useful when desired output is float (e.g., with log1p), but input is integral. By default (not using this option), the types of the input nrrds are left unchanged.

-i <nin> , --input <nin>

input nrrd

-o <nout> , --output <nout>

output nrrd (string); default: “-

See Also


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)

Referenced By


August 2021