UNU-2OP(1)
π UNU-2OP π
okay bestie, welcome to unu-2op, one of the unu girlies β she does a binary operation on two nrrds, or on a nrrd and a constant. that's the whole vibe. let's get into it π
β¨ SYNOPSIS β¨
unu 2op <operator> <in1> <in2> [-s,--seed <seed>] [-t,--type <type>]
[-w,--which <arg>] [-o,--output <nout>]
πΈ DESCRIPTION πΈ
so like, it's a binary operation on two nrrds, OR on a nrrd and a constant. no cap. either the first or the second operand can be a float constant, but NOT both β pick a lane, babe, you can't have two constants, that's not giving anything.
use - for an operand to signify a nrrd that's gonna be read from stdin (a pipe) π«Ά. but heads up β that - can probably only be used once (reliably). so don't be greedy with it, iykyk.
- Uses
nrrdArithIterBinaryOpor (with-w)nrrdArithIterBinaryOpSelect
π OPTIONS π
operatorβ the binary operator, the moment, the main character. possibilities include:+,-x/: add, subtract, multiply, divide β¨^: exponentiation (pow(3))spow: signed exponentiation:sgn(x)pow(abs(x),p)fpow: likespowbut with curves flipped%: integer modulofmod: same asfmod(3)in Catan2: same asatan2(3)in Cminmax: minimum, maximumltltegtgte: same as C's<,<=,>,<=eqneq: same as C's==and!=comp:-1,0, or1if 1st value is less than, equal to, or greater than 2nd valueif: if 1st value is non-zero, use it, else use 2nd valueexists: if 1st value exists, use it, else use 2nd valuenrand: scale unit-stdv Gaussian noise by 2nd value and add to first valuerrand: sample Rician distribution with 1st value for "true" mean, and 2nd value for sigma
in1β first input π₯. can be a single value or a nrrd.in2β second input π₯. can be a single value or a nrrd.-s <seed>,--seed <seed>β seed value for the RNG fornrand, 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 either you're a control freak (valid) or you're letting chaos decide (also valid).-t <type>,--type <type>β type to convert all INPUT nrrds to, prior to doing the operation π. super useful for doing, for instance, the difference between two unsigned char nrrds. this will ALSO determine the output type. by default (not using this option), the types of the input nrrds are left unchanged. so like, she's not gonna touch your types unless you ask.-w <arg>,--which <arg>β which argument (0or1) should be used to determine the shape of the output nrrd π. by default (not using this option), the first non-constant argument is used. (int); default:"-1"-o <nout>,--output <nout>β output nrrd (string); default:"-"π€
ngl the defaults here are doing a LOT of heavy lifting, so if you don't pass-oyou're getting stdout, and if you don't pass-wthe first non-constant arg is your shape queen. just know that.
π¦ SEE ALSO π¦
unu(1)abs(1),atan2(1),fabs(1),fmod(1),pow(1)
and that's the tea π β this page is from August 2021 and it's page UNU-2OP(1) of the manual, so go forth, do your little binary ops, and slay π β¨π«Ά
π¦ 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