binarymath
Purpose:
This program will compute intersections, additions, contrasts, and
subtractions of pairs of binary files. It will also invert a single
binary file
Usage:
binarymath
binary-file-1
operation
binary-file-2
output
[overwrite?(y/n)]
- operation options:
- where the following definitions apply:
- binary-file-1
- the name of the first binary file
- operation
- one of the following:
- intersect
- returns 1's wherever both two binary files are nonzero
- add
- returns 1's wherever either of the binary files are
nonzero
- contrast
- returns 1's wherever the two binary files differ
- subtract
- returns 1's wherever binary-file-1 is 1 and
binary-file-2 is zero.
- invert
- returns 1's wherever binary-file-1 is 0 (binary-file-2
is ignored but must be specified to allow correct command
line parsing).
- binary-file-2
- the name of the second binary file
- output
- the name of the output binary file
- overwrite?(y/n)
- 'y' if ok to overwrite existing file output
Examples:
binarymath mask1 invert mask1 invertedmask1 y
- binary file mask1.img is inverted to create binary file
invertedmask1.img
Comments:
- This program will not operate on normal (8 or 16 bit files).
However, you can achieve many of the binary functions by
creating binary masks based on the 8
or 16 bit files, operating on them and then
reapplying the masks to the original
files.
Error messages: (alphabetical by
case)
See also: Generic error messages
- Cannot understand command ____
- Only the five operations described above may be specified.
- Incompatible file dimensions:
- The input binary files have incompatible dimensions. Use
scanheader to verify the header
information.
See also:
Modified: December 11, 1996
© 1995-6 Roger P. Woods,
M.D.(rwoods@ucla.edu)