An official website of the United States government
Here’s how you know
Official websites use .gov A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS A
lock
() or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
This program will enlarge a cube by a given scalar of the original or to
specific dimensions. The user can specify to perform the enlargement by
cubic convolution, nearest neighbor, or bi-linear interpolation.
Fixed documentation error. The application name was rotate
instead of enlarge.
Kim Sides
2003-05-13
Added application test
Stuart Sides
2003-05-16
Modified schema location from astogeology... to isis.astrogeology..."
Stuart Sides
2003-05-30
Fixed compiler error with uninitialized variable after adding -O1 flag
Stuart Sides
2003-07-29
Modified filename parameters to be cube parameters where necessary
Drew Davidson
2005-08-17
Added example
Brendan George
2005-10-31
Fixed application test
Sean Crosby
2007-02-28
Program now updates output file's mapping keywords
Steven Lambright
2007-06-22
Fixed typo in the user documentation
Steven Lambright
2008-05-13
Removed references to CubeInfo
Steven Koechle
2008-05-28
Fixed problems with the way the Alpha Cube was handled
Christopher Austin
2008-12-11
Changed the parameter names smag/lmag to sscale/lscale for consistancy
with reduce.
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.
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-12-10
Added functionality for enlarging to a total number of pixels.
Travis Addair
2009-12-11
Updated example.
Sharmila Prasad
2011-04-14
Ported the enlarge functionality to base/objs/Enlarge class
Sharmila Prasad
2011-09-15
Fixed issue 0000280 - enlarge fails when run with a batchlist
Kaitlyn Lee
2020-04-09
The SetOutputCube method from Process we were originally using called
Application::GetUserInterface(), but this became a problem when trying to
call enlarge(), or run the application, programmatically since we are no
longer using Application in the application's cpp file. Changed the call
to the one that takes in a CubeAttribute object. Also, removed the check
to see if an invalid interpolation method was passed in since the UserInterface
class checks and throws the exception and it was unreachable code.
Parameters
Files
Use this parameter to select the filename. All bands within the file
will be enlarged unless a specific band is specified.
Type
cube
File Mode
input
Filter
*.cub
This file will contain the results of the enlargement.
Type
cube
File Mode
output
Scaling Parameters
This is the type of interpolation to be performed on the input.
Type
string
Default
CUBICCONVOLUTION
Option List:
Option
Brief
Description
CUBICCONVOLUTION
Cubic Convolution interpolation
Each output pixel will be set to the value calculated by
a cubic convolution interpolation of the calculated input pixel.
NEARESTNEIGHBOR
Nearest Neighbor
Each output pixel will be set to the pixel nearest the
calculated input pixel.
BILINEAR
Bi-Linear interpolation
Each output pixel will be set to the value calculated by
a bi-linear interpolation of the calculated input pixel.
Select between enlarging the image to a multiple of the original (by a
scaling factor) or to specific dimensions (in terms of total
number of pixels).
Type
string
Default
SCALE
Option List:
Option
Brief
Description
SCALE
Enlarge by a scaling factor
Enlarges the input image by a scaling factor. The scaling factor
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
Enlarge to a total number of pixels
Enlarges 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.
Exclusions
SSCALE
LSCALE
Inclusions
ONS
ONL
This determines new size of the cube in the sample direction only.
The number of samples will be multiplied by this number.
Type
double
Default
1.0
Minimum
1.0
(inclusive)
This determines new size of the cube in the line direction only.
The number of linees will be multiplied by this number.
Type
double
Default
1.0
Minimum
1.0
(inclusive)
The number of samples desired in the output cube. This value
must be greater than or equal to the number of samples in the input
image.
Type
integer
Minimum
1
(inclusive)
The number of lines desired in the output cube. This value
must be greater than or equal to the number of lines in the input
image.
Type
integer
Minimum
1
(inclusive)
Example 1
Enlarge the number of samples by a scaling factor of 2, while leaving
the number of lines the same.
Here, the 1024 x 1024 image "peaks.cub" has had the application "reduce"
applied to it in order to produce a 512 x 1024 image called
"reducedPeaks.cub". In this example, the reduced image,
reducedPeaks.cub, will be enlarged by a factor of 2 along the sample
dimension in an attempt to restore it back to its original form.
Command Line
In order to double the number of sample pixels, the sample scale is
set to 2.0, and the line scale remains at its default of 1.0. Since
no mode or interpolation has been specified, the application will
default to scale and cube convolution interpolation, respectively.
Screenshot of the GUI with parameters set to perform an enlargement
of the samples by scaling.
Input Images
Input image for reduce
peaks.cub
This is the original image, before being reduced, that the enlarge
application will attempt to replicate. It is important to realize
that this image has been scaled down to fit in a web browser. At
full size, the image would be 1024 x 1024 pixels.
Input image for enlarge, output from reduce
reducedPeaks.cub
Parameter Name:
FROM
This is the reduced image, containing half its original number of
samples, that enlarge will attempt to restore. Though it
has also been scaled down to fit in a web browser, at full size it
would be 512 x 1024 pixels. For more information, see the
documentation for the "reduce" application.
Output Image
Output image from enlarge
restoredPeaks.cub
Parameter Name:
TO
The enlarged image. Despite the fact that half the samples were
lost as a result of the reduction, the two images (peaks.cub and
restoredPeaks.cub) look nearly identical due to the cubic
convolution interpolation that was applied. Again scaled down for
web browsers, at full size, the image would be 1024 x 1024 pixels.
Example 2
Enlarge the number of samples to 768, and keep the number of lines at
1024
Here the mode has been set to enlarge to a total number of pixels along
the sample and line dimensions, with all other parameters kept at their
default settings.
Command Line
In order to enlarge to specific dimensions, the mode is set here to
"total". Also, because total lines and samples do not have default
values, the output number of lines must still be specified, even
though they will be unchanged.
Screenshot of the GUI with parameters set to perform a sample
enlargement to a total number of pixels.
Input Image
Input image for enlarge
reducedPeaks.cub
Parameter Name:
FROM
This is the same input image, reducedPeaks.cub, that was enlarged in
the last example.
Output Image
Output image from enlarge
enlargeTotalPeaks.cub
Parameter Name:
TO
The enlarged 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 horizontal enlargement is noticable, and the output
cube has 3/2 the number of samples as the input cube.