Package nom.tam.image.compression.hdu
Class CompressedImageHDU
java.lang.Object
nom.tam.fits.BasicHDU<BinaryTable>
nom.tam.fits.TableHDU<BinaryTable>
nom.tam.fits.BinaryTableHDU
nom.tam.image.compression.hdu.CompressedImageHDU
- All Implemented Interfaces:
FitsElement
A compressed image is a normal binary table with a defined structure. The
image is split in tiles and each tile is compressed on its own. The
compressed data is then stored in the 3 data columns of this binary table
(compressed, gzipped and uncompressed) depending on the compression type used
in the tile.
-
Field Summary
Fields inherited from class nom.tam.fits.BasicHDU
BITPIX_BYTE, BITPIX_DOUBLE, BITPIX_FLOAT, BITPIX_INT, BITPIX_LONG, BITPIX_SHORT, isPrimary, myData, myHeader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
compress()
forceNoLoss
(int x, int y, int width, int heigth) Specify an areaWithin the image that will not undergo a lossy compression.static CompressedImageHDU
fromImageHDU
(ImageHDU imageHDU, int... tileAxis) Prepare a compressed image hdu for the specified image.<T extends ICompressOption>
TgetCompressOption
(Class<T> clazz) getData()
boolean
isHeader()
Check that this HDU has a valid header.static boolean
Check that this HDU has a valid header for this type.static CompressedImageData
manufactureData
(Header hdr) preserveNulls
(String compressionAlgorithm) preserve the null values in the image even if the compression algorithm is lossy.setCompressAlgorithm
(String compressAlgorithm) setQuantAlgorithm
(String quantAlgorithm) Methods inherited from class nom.tam.fits.BinaryTableHDU
addColumn, binaryTableColumnKeyStems, columnKeyStems, encapsulate, info, isData, manufactureHeader, setComplexColumn, write
Methods inherited from class nom.tam.fits.TableHDU
addRow, deleteColumnsIndexOne, deleteColumnsIndexOne, deleteColumnsIndexZero, deleteColumnsIndexZero, deleteRows, deleteRows, findColumn, getColumn, getColumn, getColumnFormat, getColumnMeta, getColumnName, getColumns, getElement, getNCols, getNRows, getRow, setColumn, setColumn, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnMeta, setColumnName, setCurrentColumn, setCurrentColumn, setElement, setRow
Methods inherited from class nom.tam.fits.BasicHDU
addValue, addValue, addValue, addValue, addValue, addValue, addValue, addValue, card, getAuthor, getAxes, getBitPix, getBlankValue, getBScale, getBUnit, getBZero, getCreationDate, getDummyHDU, getEpoch, getEquinox, getFileOffset, getGroupCount, getHeader, getInstrument, getKernel, getMaximumValue, getMinimumValue, getObject, getObservationDate, getObserver, getOrigin, getParameterCount, getReference, getSize, getTelescope, getTrimmedString, getTrimmedString, read, reset, rewrite, rewriteable, saveReplaceCard
-
Constructor Details
-
CompressedImageHDU
-
-
Method Details
-
fromImageHDU
public static CompressedImageHDU fromImageHDU(ImageHDU imageHDU, int... tileAxis) throws FitsException Prepare a compressed image hdu for the specified image. the tile axis that are specified with -1 are set to the corresponding axis of the image. The image will be compressed in "sqaures" that ar defined by the tile size. Next step would be to set the compression options into the hdu and then compress it.- Parameters:
imageHDU
- the image to compresstileAxis
- the axis of the tiles in the image- Returns:
- the prepared compressed image hdu.
- Throws:
FitsException
- if the image could not be used to create a compressed image.
-
isHeader
Check that this HDU has a valid header for this type.- Parameters:
hdr
- header to check- Returns:
true
if this HDU has a valid header.
-
manufactureData
- Throws:
FitsException
-
asImageHDU
- Throws:
FitsException
-
compress
- Throws:
FitsException
-
forceNoLoss
Specify an areaWithin the image that will not undergo a lossy compression. This will only have affect it the selected compression (including the options) is a lossy compression. All tiles touched by this region will be handled so that there is no loss of any data, the reconstruction will be exact.- Parameters:
x
- the x position in the imagey
- the y position in the imagewidth
- the width of the areaheigth
- the height of the area- Returns:
- this
-
getCompressOption
-
getData
- Overrides:
getData
in classBasicHDU<BinaryTable>
- Returns:
- the associated Data object
-
getUncompressedData
- Throws:
FitsException
-
isHeader
public boolean isHeader()Check that this HDU has a valid header.- Overrides:
isHeader
in classBinaryTableHDU
- Returns:
true
if this HDU has a valid header.
-
preserveNulls
preserve the null values in the image even if the compression algorithm is lossy. I the image that will be compressed a BLANK header should be available if the pixel value is one of the integer types.- Parameters:
compressionAlgorithm
- compression algorithm to use for the null pixel mask- Returns:
- this
-
setCompressAlgorithm
- Throws:
FitsException
-
setQuantAlgorithm
- Throws:
FitsException
-