This program will reduce a cube to a given proportion of the original or to
specific dimensions. The user can specify to perform the reduction by
either averaging pixels or using the nearest-neighbor algorithm. The user
also has the option of filling all special pixels that can't be resolved by
the VALIDPER value with NULL or the nearest-neighbor value.
Ported to Isis 3.0, Separated magcube into reduce and enlarge.
Tracie Sucharski
2003-05-13
Read in ons/onl as integers not doubles.
Stuart Sides
2003-05-16
Modified schema location from astogeology... to isis.astrogeology..."
Stuart Sides
2003-07-29
Modified filename parameters to be cube parameters where necessary
Jeff Anderson
2004-07-14
Fixed propagation bug
Tracie Sucharski
2004-07-15
Forget to change ons/onl minimum inclusive values from 1.0 to 1 during the
2003-5-13 change.
Drew Davidson
2005-08-17
Added example
Tracie Sucharski
2006-04-03
Fixed bug in average algorithm, forgot to divide Vper by 100.
Jeff Anderson
2006-09-19
Fixed problems when program ran in batchlist
Sean Crosby
2007-02-28
Program now updates output file's mapping keywords
Steven Koechle
2008-01-23
Changed so if it failed VPER the output cube would get null values.
Now processes cube bands from user input correctly
Steven Lambright
2008-05-13
Removed references to CubeInfo
Steven Koechle
2008-05-15
Added radio button for VPER options to allow original functionaliy.
Steven Lambright
2008-12-22
The "Scale" keyword in the Projection group in the labels is now being
updated if this program is run on a projected cube.
Mackenzie Boyd
2009-09-03
Added keyword REDUCTION_TYPE to allow for clear switching between ons, onl
and sscale, lscale. Fixed problem involving cube remaning open after an
exception.
Janet Barrett
2009-10-22
Now uses the SubArea class to produce output cube labels
with corrected Mapping, Instrument, and AlphaCube groups.
Travis Addair
2009-11-12
Improved documentation, changed parameter names, and updated examples.
Travis Addair
2009-12-09
Updated documentation and changed parameters STOTAL and LTOTAL back to ONS
and ONL, respectively.
Sharmila Prasad
2011-04-26
Ported the reduce by near and average functionality from the app to
base/objs/Reduce class
Sharmila Prasad
2011-10-07
Fixed bug #0000463 regarding memory leak
Sharmila Prasad
2012-02-01
Fixed bug #0000681 - reduce in ISIS 3.3.0 is ignoring the +N band identifier
Tracie Sucharski
2013-01-16
Fixed an intermittent bug which caused a round off error which resulted in the output bands
beyond band 1 being all NULL. Fixes #1385.
Select between reducing the image to a proportion of the original (by
a scaling factor inverse) or to specific dimensions (in terms of total
number of pixels).
Type
string
Default
SCALE
Option List:
Option
Brief
Description
SCALE
Reduce by a scaling factor inverse
Reduces the input image by a scaling factor inverse. The scaling
factor inverse along the sample range and line range must then be
specified in the SSCALE and LSCALE parameters, respectively.
Exclusions
ONS
ONL
Inclusions
SSCALE
LSCALE
TOTAL
Reduce to a total number of pixels
Reduces the input image to a total number of pixels. The number
of pixels in the output image along the sample range and line
range must then be specified in the ONS and ONL parameters,
respectively.
This parameter specifies what percentage of the pixels need to be
valid (non-special pixels). For example, scaling down by a factor
of two results in a 2x2 window (four pixels) being reduced to one
pixel. If VALIDPER is set at 50, then at least two pixels of the four
must be valid (50%). If this criteria is met, 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.
Reduce the number of samples by a factor inverse of 2, while leaving the
number of lines the same
Description
Essentially the opposite of enlarge, this configuration for reduce takes
an image and scales down the samples, keeping all parameters, except the
sample scale, at their default settings.
In this example the sample scale factor inverse is 2. Note that this implies
that the image will be scaled down by a factor of 2, not scaled up. No
line scale is specified since the default is 1.0. Since the default
mode of reduction is scale, the mode parameter does not need to be
specified.
GUI Screenshot
reduce gui
Example GUI
Screenshot of the GUI with parameters set to perform a sample
reduction by scaling.
Input Image
The image before reduction
Input image for reduce
Parameter Name:
FROM
This is the image as it was taken originally.
Output Image
The image after reduction
Output image for reduce
Parameter Name:
TO
The reduced image. Though it has been scaled down so that it can
be viewed in a web browser, the essential change can still be
observed. The vertical distortion is noticable, and the output cube
is 1/2 the size of the input cube.
Example 2
Reduce the number of samples to 150, and the number of lines to 250
Description
Here the mode has been set to reduce to a total number of pixels along
the sample and line dimensions, with all other parameters kept at their
default settings.
In order to reduce to specific dimensions, the mode is set here to
"total".
GUI Screenshot
reduce gui
Example GUI
Screenshot of the GUI with parameters set to perform a sample and
line reduction to a total number of pixels.
Input Image
The image before reduction
Input image for reduce
Parameter Name:
FROM
This is the image as it was taken originally.
Output Image
The image after reduction
Output image for reduce
Parameter Name:
TO
The reduced image. Though it has been scaled down so that it can
be viewed in a web browser, the essential change can still be
observed. The vertical and horizontal distortion is noticable, and
the output cube has 1/3 the number of samples and 1/2 the number of
lines as the input cube.