Exports a cube to PNG, BMP, TIFF, JPEG, or JPEG 2000
Overview
Parameters
Example 1
Description
This program exports an ISIS cube to one of several popular standard image
formats. The current supported formats are BMP, JPEG, JP2, PNG, and TIFF.
This program uses TrollTech's version of the Qt Library to export BMP
and JPEG formatted output images. For these format types, due to limitations of Qt, the
input file size must not exceed 2 gigabytes and the only valid output bit type is 8-bit.
The JPEG2000 (JP2) and TIFF formats do not depend on the Qt library. These formats do not
have the 2 GB limitation for input files and the output bit type may be 8-bit, U16-bit or S16-bit.
For these formats, the writing routines output are streamed lines from the cube, and little
of the image is held in memory at any one time, therefore increasing the processing speed to
convert the file. It is recommended that large images are exported to JP2 or TIFF format.
For some output image types, users may specify a value for the level of compression
represented as a percentage using the QUALITY parameter. The default is no compression
(i.e. QUALITY = 100%). For the TIFF format a compression algorithm can be selected.
Each of the input cube parameters (FROM, ALPHA, RED, GREEN, and BLUE) requires a single band
from an ISIS cube. If a cube contains multiple bands, the user must specify a single band of
the input image. To do this, the user must append a plus sign and the band number to be used
to the input file name. For example, inputFile.cub+4 indicates that the 4th band in the cube
will be used. No band needs to be specified if the cube only has a single band.
In addition, if the cube has Mapping labels, the program will produce a world file for use
in Arc and/or other GIS packages. The file will have an extension that uses the first and
last letters for the image extension and a "w". For example, .tif produces a world file
extension of .tfw.
To ensure acceptable contrast in the output file, the user may select from three stretch
options: linear, piecewise-linear, or manual.
Special pixels such as Low Saturation values and Nulls are set to black and High Saturation
values are set to white. See the BITTYPE parameter documentation for more information about
which output pixel values are assigned for particular input DNs of the various bit types.
Added two new modes (rgb and argb) and updated the appTest.
Elizabeth Miller
2006-05-08
Added MIN and MAX percent options
Jacob Danton
2006-05-22
Added seperate MINIMUM and MAXIMUM parameters for all channels.
Brendan George
2007-05-03
Modified to use Filename class, and added appropriate appTest
Steven Lambright
2007-07-10
Modified to give an error if write fails. Memory leak fixed.
Jeff Anderson
2007-08-20
Modified so that ISIS Null pixels are written as zeros in the output cube
and low data in the input is written as a one
Steven Koechle
2007-08-22
Added a check to see that raw image data will be less than 4GB.
Throw exception if it is too big.
Steven Lambright
2008-05-12
Removed references to CubeInfo
Kris Becker
2008-10-17
Added QUALITY parameter to set compression levels
Christopher Austin
2008-11-04
Fixed checkDataSize() since Qimage has a maximum size of 2 GB, not 4GB.
Added some QT error catching.
Steven Koechle
2009-02-20
Documentation Change
Janet Barrett
2010-01-27
Added support for JPEG2000 files.
Stuart Sides and Steven Lambright
2012-04-03
Added minimum and maximum input stretch values and output file
name to the output log. fixes #761
Travis Addair
2012-04-03
Added support for exporting cubes greater than 2GB to TIFFs.
Steven Lambright
2012-08-28
Fixed some problems with the big tiff exports that caused
corrupt outputs. The 2GB limitation should be removed
completely now. References #579.
Jeannie Backer
2013-06-05
Fixed bug where alpha channel was not being utilized for ARGB option. Fixed bug that mapped
Nulls as the min value for TIFF and JP2 formats. Changed ImageExporter calls to new method
names, where needed. Added test for ARGB parameter. Added xml example. Added appTests to
improve coverage for isis2std program and the ImageExporter and its derived classes.
Fixes #1380.
Jeffrey Covington
2015-02-12
Changed default compression of TIFF format images to no compression. Added COMPRESSION parameter to
choose the compression algorithm for TIFF format images. Fixes #1745
Kaitlyn Lee
2018-02-08
Removed the option to export as a GIF because Qt does not support GIF
exports. Fixes #1667.
This parameter specifies the image mode. If GRAYSCALE, a single one-band cube is used.
If RGB, three one-band cubes are used. If ARGB, four one-band cubes are used.
Type
string
Default
GRAYSCALE
Option List:
Option
Brief
Description
GRAYSCALE
Output has one channel (gray scaled).
If this option is chosen, the output image will have a single channel and the user
will be required to specify the parameter FROM.
Exclusions
ALPHA
RED
GREEN
BLUE
AMIN
AMAX
RMIN
RMAX
GMIN
GMAX
BMIN
BMAX
RGB
Output has three channels (red, green, and blue).
If this option is chosen, the output image will have three channels and the user will
be required to specify the parameters RED, GREEN, and BLUE.
Exclusions
FROM
ALPHA
MINIMUM
MAXIMUM
AMIN
AMAX
ARGB
Output has four channels (alpha, red, green, and blue).
If this option is chosen, the output image will have four channels and the user will
be required to specify the parameters ALPHA, RED, GREEN, and BLUE.
This parameter is used to select the output format. It can be one of
PNG, BMP, JPEG, TIF, or JP2. Note that not all formats may be
available. It will depend on your installation of the Qt libraries.
In addition, if the cube has Mapping labels, the program will produce
a world file for use in Arc and/or other GIS packages. The file will
have an extension that uses the first and last letters for the image
extension and a "w". For example, .tif produces a world file extension of .tfw.
Type
string
Default
PNG
Option List:
Option
Brief
Description
PNG
Output image will be PNG
The output image is in PNG (Portable Network Graphics) format. The default extension
for this format is "png."
Exclusions
BITTYPE
COMPRESSION
BMP
Output image will be BMP
The output image is in BMP (Bit Mapped Graphics) format. The default extension for
this format is "bmp."
Exclusions
BITTYPE
COMPRESSION
TIFF
Output image will be TIFF
The output image is in TIFF (Tagged Image Files Format) format. The default extension
for this format is "tif."
JPEG
Output image will be JPEG
The output image is in JPEG (Joint Photographic Experts Group) format. The default
extension for this format is "jpg."
Exclusions
BITTYPE
COMPRESSION
JP2
Output image will be JPEG2000
The output image is in JPEG2000 (Joint Photographic Experts Group 2000) format. The
default extension for this format is "jp2."
This parameter allows the user to specify level of quality
(compression) for the output image. Some output image types may not
utilize this parameter. The range is from 100 (no compression and
highest quality) to 0 (highest compression and reduced quality). A
value of -1 can be given to use the default settings.
This parameter allows the userPackBits is also known as Macintosh RLE. to set the bit type of the output image.
Some FORMAT values will only allow 8-bit outputs.
16 bit signed (-32767=black, 32768=white)
Type
string
Default
8BIT
Option List:
Option
Brief
Description
8BIT
Output is 8 bit unsigned integer data
Pixels values are within 8-bit unsigned integer data range from 0 to 255.
U16BIT
Output is 16 bit unsigned integer data
Pixel values are within the 16-bit unsigned integer data range from 0 to 65535. This
option is not available for some output formats.
S16BIT
Output is 16 bit signed integer data
Pixel values are in 16-bit signed integer data range -32768 to 32767. This option is
not available for some output formats.
The compression algorithm used to compress an output TIFF format image. Only used if the format
is set to TIFF. The default is no compression. PACKBITS is the most widely supported compression
algorithm for the TIFF format.
Type
string
Default
NONE
Option List:
Option
Brief
Description
NONE
Use no compression
Use no compression on the output TIFF image.
PACKBITS
Use PackBits compression
Use PackBits compression on the output TIFF format image. PackBits is also known as Macintosh RLE.
This compression algorithm should be supported by all TIFF readers that conform to the
Baseline TIFF specification.
LZW
Use LZW compression
Use Lempel-Ziv-Welch(LZW) compression on the output TIFF format image.
DEFLATE
Use Deflate compression
Use Deflate compression on the output TIFF format image.
Note: This uses the official version of Deflate for TIFF images described in the
TIFF Specification Supplement 2. Other versions of deflate for TIFF images are considered
obsolete.
This parameter is used to select one of three ways to stretch (or map)
output pixels. The are LINEAR, PIECEWISE, or MANUAL.
Type
string
Default
LINEAR
Option List:
Option
Brief
Description
LINEAR
Linear stretch
A minimum and maximum are automatically computed based on the
statistics of the selected band. A histogram of the band is used
to pick the minimum at 0.5% of the data and the maximum at 99.5%
of the data. Input pixels less than or equal to the minimum are
stretched to black while pixels greater than or equal to the
maximum are stretched to white. A linear mapping occurs between
the minimum and maximum.
Exclusions
MINIMUM
MAXIMUM
AMIN
AMAX
RMIN
RMAX
GMIN
GMAX
BMIN
BMAX
PIECEWISE
Piecewise-linear stretch
This option is similar to the LINEAR option. A minimum and
maximum are automatically computed. Additionally, the median is
computed and it is mapped to the middle gray value (halfway
between white and black). Therefore, it is a piecewise-linear
stretch with input pixels mapped linearly between either 1) the
minimum/median or 2) the median/maximum. This option is useful
for contrast stretching cubes with skewed histograms to ensure a
balanced contrast.
Exclusions
MINIMUM
MAXIMUM
AMIN
AMAX
RMIN
RMAX
GMIN
GMAX
BMIN
BMAX
MANUAL
Manual stretch
This option allows you to pick your own stretch. You must
enter a value for MINIMUM and MAXIMUM
Example of red/green/blue output of isis2std program.
Description
This example creates an output TIFF format file from 3 bands of an ISIS cube, designated
red, green, and blue using a linear stretch and 8-bit output type. A histogram is created
from the input values. Using this histogram, we determine the minimum value to be any DN
in the bottom 0.2% of the data. These DNs will be set to black in the output. Similarly,
the maximum value is any DN in the top 99.8% of the data and these DNs will be set to white.