UNU(1)

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

✨ unu(1) β€” the Utah Nrrd Utilities command-line interface ✨

okay bestie, buckle up, because this is unu, from the UNU(1) manual, section 1, User Commands πŸ’–


🌸 NAME 🌸

unu β€” Utah Nrrd Utilities command-line interface


πŸŽ€ SYNOPSIS πŸŽ€

unu COMMAND [OPTION]...

πŸ¦‹ DESCRIPTION πŸ¦‹

unu(1) is a command-line interface to so much of the functionality in β€œnrrd”, a C library for raster data processing. Nrrd is one library in the β€œTeem” collection of libraries. More info about Teem lives at http://teem.sf.net. Wanna check out the Teem source? You can grab it like this:

svn co https://svn.code.sf.net/p/teem/code/teem/trunk teem
real talk for a sec: long-term maintenance of this software depends on funding, and funding depends on being able to document who is using it for what. So if unu(1) or Nrrd has helped in your research β€” and yes, that includes simple one-off experiments or mundane data hacking β€” the Teem developers would love to know. There are multiple ways of communicating this. In your publications, consider adding a line such as this in the Acknowledgments:
Data processing performed with the unu tool, part of the Teem
toolkit available at http://teem.sf.net.

Alternatively, please email glk@uchicago.edu and briefly describe how Teem software has helped in your work. Please also consider joining the teem-users mailing list. That's the primary forum for feedback, questions, and feature requests. 🫢


A summary list of unu commands is generated by running simply β€œunu”. And running a unu(1) command without additional arguments (like β€œunu slice”) generates its description and usage information. That includes info (marked with β€œ* Uses ...”) about the underlying Nrrd library calls β€” for example nrrdSlice() β€” that implement the basic functionality in that unu(1) command. ✨


The utility of unu(1) is mainly as a pre-processing tool for getting data into a type, encoding, format, or dimensions best suited for some visualization or rendering task. Also, slices and projections are effective ways to visually inspect the contents of a dataset. Especially useful commands include make, resample, crop, slice, project, histo, dhisto, quantize, and save. πŸ’…

unu(1) can process CT and MRI volume datasets, grayscale and color images, time-varying volumes of vector fields (5-D arrays), and more. Currently supported formats are plain text files (2-D float arrays), NRRD, VTK structured points, and PNG and PNM images. unu make -bs -1 can read from most DICOM files. unu save can generate EPS files. Supported encodings are raw, ascii, hex, gzip, and bzip2.

Much of the functionality of unu(1) derives from chaining multiple invocations together with pipes (β€œ|”), which minimizes the need to save out intermediate files. Obsessed, honestly. For example, if (data.raw.gz) is a gzip'ed 256 x 256 x 80 volume of raw floats written from a PC, then the following will save to (zsum.png) a histogram equalized summation projection along the slowest axis:

unu make -i data.raw.gz -t float -s 256 256 80 -e gzip -en little \
 | unu project -a 2 -m sum \
 | unu heq -b 2000 -s 1 \
 | unu quantize -b 8 -o zsum.png

Formats available: nrrd pnm png vtk text eps

Nrrd data encodings available: raw ascii hex gz bz2


πŸ‘‘ COMMANDS πŸ‘‘

Each of the following has a corresponding man page: for example, unu-about(1) for β€œunu about”. iykyk πŸ’œ

πŸ’« unu about

Information about this program and its use

πŸ’« unu env

List relevant environment variables and their values

πŸ’« unu i2w

Convert from 1-D index to world position

πŸ’« unu w2i

Convert from 1-D world to index position

πŸ’« unu make

Create a nrrd (or nrrd header) from scratch

πŸ’« unu head

Print header of one or more nrrd files

πŸ’« unu data

Print data segment of a nrrd file

πŸ’« unu convert

Convert to another type (as if by cast, w/ optional clamp)

πŸ’« unu resample

Filtering and {up,down}sampling with a separable kernel

πŸ’« unu fft

Fast Fourier Transform of selected axes

πŸ’« unu cmedian

Cheap histogram-based median/mode filtering

πŸ’« unu dist

Euclidean distance transform

πŸ’« unu minmax

Print out min and max values in one or more nrrds

πŸ’« unu cksum

Compute 32-bit CRC of nrrd data (same as via cksum(1))

πŸ’« unu diff

Sees if two nrrds are different in any way

πŸ’« unu quantize

Quantize values to 8, 16, or 32 bits

πŸ’« unu unquantize

Recover floating point values from quantized data

πŸ’« unu project

Collapse scanlines to scalars along some axis

πŸ’« unu slice

Slice along one or more axes at given positions

πŸ’« unu sselect

Select subset of slices along an axis

πŸ’« unu dice

Save all slices along one axis into separate files

πŸ’« unu splice

Replace a slice with a different nrrd

πŸ’« unu join

Connect slices and/or slabs into a bigger nrrd

πŸ’« unu crop

Crop along each axis to make a smaller nrrd

πŸ’« unu acrop

Automatically crop axes based on given measure

πŸ’« unu inset

Replace a sub-region with a different nrrd

πŸ’« unu pad

Pad along each axis to make a bigger nrrd

πŸ’« unu reshape

Superficially change dimension and/or axes sizes

πŸ’« unu permute

Permute ordering of axes

πŸ’« unu swap

Interchange ordering of two axes

πŸ’« unu shuffle

Permute slices along one axis

πŸ’« unu flip

Reverse order of slices along one axis

πŸ’« unu unorient

Make image orientation be axis-aligned

πŸ’« unu axinfo

Modify attributes of one or more axes

πŸ’« unu axinsert

Add a β€œstub” (length 1) axis to a nrrd

πŸ’« unu axsplit

Split one axis into two axes

πŸ’« unu axdelete

Remove one or more singleton axes from a nrrd

πŸ’« unu axmerge

Merge two adjacent axes into one

πŸ’« unu tile

Tile slices of one axis into two other axes

πŸ’« unu untile

Undo unu-tile(1): merge slow parts of two axis splits

πŸ’« unu histo

Create 1-D histogram of values in a nrrd

πŸ’« unu dhisto

Create image of 1-D value histogram

πŸ’« unu jhisto

Create joint histogram of two or more nrrds

πŸ’« unu histax

Replace each scanline along an axis with its histogram

πŸ’« unu heq

Perform histogram equalization

πŸ’« unu gamma

Brighten or darken values with a gamma

πŸ’« unu 1op

Unary operation on a nrrd

πŸ’« unu 2op

Binary operation on two nrrds, or on a nrrd and a constant

πŸ’« unu 3op

Ternary operation on three nrrds or constants

πŸ’« unu affine

Affine (lerp) mapping on 5 nrrds or constants

πŸ’« unu lut

Map nrrd through one univariate lookup table

πŸ’« unu mlut

Map nrrd through whole nrrd of univariate lookup tables

πŸ’« unu subst

Map nrrd through a univariate substitution table

πŸ’« unu rmap

Map nrrd through one regular univariate map (β€œcolormap”)

πŸ’« unu mrmap

Map nrrd through a whole nrrd of regular univariate maps

πŸ’« unu imap

Map nrrd through irregular univariate map (β€œcolormap”)

πŸ’« unu lut2

Map nrrd through a bivariate lookup table

πŸ’« unu ccfind

Find connected components (CCs)

πŸ’« unu ccadj

Form adjecency matrix of connected components

πŸ’« unu ccmerge

Merge CCs with their neighbors, under various constraints

πŸ’« unu ccsettle

Remap CC values down to lowest contiguous values

πŸ’« unu save

Write nrrd with specific format, encoding, or endianness


🌈 ENVIRONMENT 🌈

See unu-env(1).


⭐ SEE ALSO ⭐


and that's the whole page bestie, we ate and left no crumbs πŸ’…βœ¨ this edition of the UNU(1) page is dated April 2021 β€” go forth and process some rasters, you've got this πŸ¦‹πŸ’–

πŸ“¦ where this page comes from