imop
Manual
The following sections briefly describe how to run IMOP from the command-line, the required input, and the produced output files.
Introduction
IMOP performs logical and arithmetic operations on detector images and masks. Supported use cases include combining masks, applying a mask to an image, or modifying detector image values.
Running imop
Usage:
$ imop [OPTIONS] <OPERATOR> <FILE(S)>
Command-Line Arguments and Options
IMOP requires the following command line arguments:
Argument | Description |
---|---|
OPERATOR | One of: ADD, SUB for image arithmetic; AND, OR, XOR for mask operations; MASK to apply a mask to an image. |
FILE(S) | One or more detector image or mask files. |
Absolute as well as relative paths to input files are accepted. Instead of a file name, one of the arguments may be given as ‘-‘ to read from stdin.
IMOP recognizes the following command-line options:
Short option | Long option | Description |
---|---|---|
-o | --output=<FILE>; | Relative or absolute path to save the result; if not specified, the result is printed to stdout. |
-v | --version | Print version information and exit. |
-h | --help | Print usage information and exit. |
imop input files
IMOP expects Crystallographic Binary Format (.cbf), ESRF Data Format (.edf), Tagged Image File Format (.tiff), or detector mask (.msk).
imop output files
The output is a modified detector image or mask, resulting from the specified operation.
Examples
Apply a mask to an image:
$ imop MASK detector.tif mask.msk -o masked.tif
Combine two masks using XOR:
$ imop XOR mask1.msk mask2.msk -o combined.msk
Subtract a dark frame from an image:
$ imop SUB image.tif dark.tif -o corrected.tif