MATRIX commands


PROGRAM NAME

mtransform - Transform all vectors in an object using a single matrix

DESCRIPTION

mtransform multiplies a given matrix onto each of the WxHxDxT vectors down E in a data object. The matrix is assumed to be provided as a single WxH plane, thus the W dimension of the matrix must match the E dimension of the vectors. The result is to transform each vector down W from the input vector object into a vector down the E axis of the output vector object, with the E size of the output object being the same as the H dimension of the matrix.

This operation is represented schematically as:

[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] -> [ ] [ ] [ ] [ ] [ ] [ ] E x1 W x H E x1 o m m i

^ ^ ^ | | | | | +--- output vector, E =H | | o m | +--- input vector | +--- input matrix

The output data type is controlled by the -type argument. If -type is 0 ("Propagate input type") then output data type will be the same as the input data type (look out for wraparound). If a different data type is specified, the output data is cast to that type after the transformation is computed.

REQUIRED ARGUMENTS

-i1
type: infile
desc: matrix to be used to transform the vectors
-i2
type: infile
desc: object of vectors (down E) to be transformed
-o
type: outfile
desc: Object of transformed E vectors

OPTIONAL ARGUMENTS

-type
type: list
desc: Data type of output
default: 0 "Propagate input type"

EXAMPLES

The following will scale the first band of a 3-band image by 1.0, the second
band by 2.0, and the third band by 3.0:

% cat > matrix <<EOF 1 0 0 0 2 0 0 0 3 EOF

% mtransform -i1 matrix -i2 3-band-image -o output

SEE ALSO

mcovar(1)

RESTRICTIONS

This routine really should be able to operate on vectors along ANY direction, not just E.

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.