USGS

Isis 2 Documentation


magcube Documentation

magcube - Scale cube up or down using bilinear interpolator
This program magnifies or demagnifies the core of a cube file.
That is, it will scale a cube up or down in the sample and line
dimensions. When scaling up, the program uses a bilinear
interpolator as opposed to a nearest neighbor interpolator.
The bilinear interpolator gives a smooth appearance to
interpolated pixels, whereas the nearest neighbor interpolator
gives a blocky appearance. When scaling down, the program
averages. For example, when scaling the image down by a factor
of 3, the program will average 9 pixels (a 3x3 window) to
generate each output pixel. Backplanes, sideplanes and bottom-
planes are not transfered from the input to the output cube.

Note, this program will only scale the cube in the line and
sample directions. Thus, it cannot do band interpolation or
compression; however, sample and line scales are independent
so that pixel aspect distortions can be corrected. Also, map
projection parameters from the input cube will be preserved
if the sample and line scales remain the same; otherwise the
map projection parameters will not be propagated to the
output cube. If a nearest neighbor interpolator is desired
for scaling use the "dsk2dsk" program and specify increment
values in SFROM.

Programmer: Jeff Anderson, U.S.G.S., Flagstaff, AZ

ParmDescriptionDefault
FROM
Input cube file name
  (default extension is .cub)
NONE
TO
Output cube file name
  (default extension is .cub)
NONE
SSCALE
Sample scaling factor
--
LSCALE
Line scaling factor
--
ONS
Number of samples in output cube
--
ONL
Number of lines in output cube
--
OTYPE
Output pixel type
 NULL = input type
    1 = 8 bit
    2 = 16 bit
    3 = 32 bit
--
ORANGE
Output min/max data range
--
VPER
Valid percentage for scaling
  down
0.5

ADDITIONAL NOTES:

ParmDescription
FROM
Input cube file name.  If the file extension is omitted,
then ".cub" will be assumed.
TO
Output cube file name.  If the file extension is omitted,
then ".cub" will be assumed.
SSCALE
The scaling factor for the sample direction. A value greater
than 1 enlarges the cube in the sample direction. Thus, 2.5
would increase the number of samples in the cube by 2.5
times.  Similarly, a value less than 1 shrinks the cube in
the sample direction. NOTE: This parameter CANNOT be used
in conjuction with the ONS parameter.
LSCALE
The scaling factor for the line direction. A value greater
than 1 enlarges the cube in the line direction. Thus, 2.5
would increase the number of lines in the cube by 2.5 times.
Similarly, a value less than 1 shrinks the cube in the line
direction. NOTE: This parameter CANNOT be used in
conjuction with the ONL parameter.
ONS
The number of samples desired in the output cube. NOTE: This
parameter CANNOT be used in conjunction with the SSCALE
parameter.
ONL
The number of lines desired in the output cube. NOTE: This
parameter CANNOT be used in conjunction with the LSCALE
parameter.
OTYPE
Output pixel data type.  Permitted values are:
 NULL = output type is same as input file pixel type
    1 = 8-bit (integer with type conversion parameters)
    2 = 16-bit (integer with type conversion parameters)
    3 = 32-bit (floating point)
When processed data are being written back into the input
file, the output pixel type must be the same as the
existing pixel type in the input file.
ORANGE
Output pixel data range.  If ORANGE is NULL, then the
CORE_BASE and CORE_MULTIPLIER in the output file will be
set to represent the same range of data as the input file.

If OTYPE=1 (8-bit) or OTYPE=2 (16-bit), then the CORE_BASE
and CORE_MULTIPLIER in the output file will be set to values
that allow representing the specified range of output
values.  Output values outside this range will be stored as
a special "representation saturation" value.

The ORANGE parameter is ignored if OTYPE=3 (32-bit) since
the CORE_BASE and CORE_MULTIPLIER are not applicable to
floating point pixel values.

**NOTE** For a more detailed explanation of ORANGE, tutor
the orange.pdf.
VPER
This parameter is only used when scaling an image down.
It is used to specify what percentage of the pixels
need to be valid (non-special pixels). For example,
scaling down by a factor of two results in a 3x3 window
(nine pixels) being reduced to one pixel.  If VPER is
set a 0.75 then at least seven of the nine pixels must
be valid.  If the critera is met then the resulting value
of the output pixel will be the average of the valid input
pixels.  Otherwise the output pixel will be set to the
input pixel which is closest to the center of the window.

Last updated: Nov 2 2005
File: pdfs2.html

Contact us online at the Isis Support Center: http://isisdist.wr.usgs.gov

ISIS Documentation Home Page