teem | / | unrrdu |
General unu Info |
unu gamma: Brighten or darken values with a gamma. Just as in xv, the gamma value here is actually the reciprocal of the exponent actually used to transform the values. Usage: unu gamma [-i <nin>] -g <gamma> [-min <value>] [-max <value>] \ [-o <nout>] -i <nin> = input nrrd -g <gamma> = gamma > 1.0 brightens; gamma < 1.0 darkens. Negative gammas invert values (like in xv). (double) -min <value> = Value to implicitly map to 0.0 prior to calling pow(). Defaults to lowest value found in input nrrd. (double) -max <value> = Value to implicitly map to 1.0 prior to calling pow(). Defaults to highest value found in input nrrd. (double) -o <nout> = output nrrd (string); default: "-"
unu command | - | nrrd function |
about | - | n/a |
make, head, data | - | n/a |
convert | - | nrrdConvert() |
resample | - | nrrdSpatialResample() |
cmedian | - | nrrdCheapMedian() |
minmax | - | nrrdMinMaxSet() |
quantize | - | nrrdQuantize() |
unquantize | - | nrrdUnquantize() |
project | - | nrrdProject() |
slice | - | nrrdSlice() |
dice | - | repeated calls to nrrdSlice() |
splice | - | nrrdSplice() |
join | - | nrrdJoin() |
crop | - | nrrdCrop() |
inset | - | nrrdInset() |
pad | - | nrrdPad_nva() |
reshape | - | nrrdReshape_nva() |
permute | - | nrrdPermuteAxes() |
swap | - | nrrdSwapAxes() |
shuffle | - | nrrdShuffle() |
flip | - | nrrdFlip() |
axinfo | - | n/a |
axinsert | - | nrrdAxesInsert() |
axsplit | - | nrrdAxesSplit() |
axdelete | - | nrrdAxesDelete() |
axmerge | - | nrrdAxesMerge() |
histo | - | nrrdHisto() |
dhisto | - | nrrdHistoDraw() |
jhisto | - | nrrdHistoJoint() |
histax | - | nrrdHistoAxis() |
heq | - | nrrdHistoEq() |
gamma | - | nrrdArithGamma() |
1op | - | nrrdArithUnaryOp() |
2op | - | nrrdArithBinaryOp() |
3op | - | nrrdArithTernaryOp() |
lut | - | nrrdApply1DLut() |
rmap | - | nrrdApply1DRegMap() |
imap | - | nrrdApply1DIrregMap() |
ccfind | - | nrrdCCFind() |
ccadj | - | nrrdCCAdjacency() |
ccmerge | - | nrrdCCMerge() |
ccsettle | - | nrrdCCSettle() |
save | - | n/a |
"-i", "-o" | input nrrd or data, output nrrd | ||||||||||||||||||||||||||||||
"-t" | Scalar type of the data.
The possible valid values are exactly
the same as for the type
field descriptor in the NRRD header. Used by make,
convert, and many others. Every type has a one-word
equivalent, listed below:
| ||||||||||||||||||||||||||||||
"-p" | Position in index space along an axis. Used with slice, crop, and pad, for example. This can either be an integer (interpreted as an exact index position), or of the form "M+<int>" or "M-<int>", which is interpreted as some offset (int) from the last sample along that axis. That is, M is highest index along the axis, or, one less than the number of samples along that axis. crop and pad also allow "m+<int>", which is position relative to the given minimum position. | ||||||||||||||||||||||||||||||
"-b" | Number of bins, in a histogram. Used with cmedian, histo, jhisto, histax, heq. ("-b" means "# bits" to quantize) | ||||||||||||||||||||||||||||||
"-a" | Which axis. Always just an integer (the first axis is 0); nrrd has no notion of axis names like "X" or "Y". Used by slice, dice, project, join, and others. | ||||||||||||||||||||||||||||||
"-s" | Axis sizes. Used by make, resample, and reshape to identify the number of samples along each axis. | ||||||||||||||||||||||||||||||
"-e" | Encoding of data. Used by make and save. The arguments to this option are exactly the same as for the encoding field descriptor in the NRRD header. | ||||||||||||||||||||||||||||||
"-en" | Endianness of data. Used by make and save. The arguments to this option are exactly the same as for the endian field descriptor in the NRRD header. |
The encoding produced by all unu commands is raw. The exception to this is "unu save", which has a "-e" option to control the output encoding. This is the only way to control encoding with unu.
You can control output nrrd file format with the filename extension supplied to the "-o" option. This is also how to save the output nrrd with a detached header. The interpretation of filename extension is according to the table below. Every command except "unu make" conforms to this behavior.
extension (case sensitive) | format | ||
".txt" | plain text file | ||
".pgm" | PGM image file, raw encoding | ||
".ppm" | PPM image file, raw encoding | ||
".png" | PNG image file (zlib compression encoding) | ||
".vtk" | VTK "STRUCTURED POINTS" file, raw encoding | ||
".nhdr" | NRRD file with detached header, raw encoding | ||
".nrrd", anything else | NRRD file with attached header, raw encoding |
See the Reading and Writing non-NRRD files section of NRRD-Compatible File Formats for details.
If the output is not being written to a file, but sent to stdout, then "unu save" must be used to force a particular format. This facilitates a slick way of viewing 2-D nrrds with xv. If you have a 2-D nrrd of floats, and you want to get a qualitative sense of what it looks like, you can run:
No quantized nrrd is ever written to disk, nor is any PGM image.unu quantize -i float.nrrd -b 8 | unu save -f pnm | xv -