Package nom.tam.image.compression.hdu
Class CompressedImageData
java.lang.Object
nom.tam.fits.Data
nom.tam.fits.AbstractTableData
nom.tam.fits.BinaryTable
nom.tam.image.compression.hdu.CompressedImageData
- All Implemented Interfaces:
Cloneable,FitsElement,TableData
FITS representation of a compressed image. Compressed images are essentially stored as FITS binary tables. They are
distinguished only by a set of mandatory header keywords and specific column data structure. The image-specific
header keywords of the original image are re-mapped to keywords starting with 'Z' prefixed so as to not interfere
with the binary table description. (e.g. NAXIS1 of the original image is stored as ZNAXIS1 in the compressed table).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class nom.tam.fits.BinaryTable
BinaryTable.ColumnDesc, BinaryTable.SaveState -
Field Summary
Fields inherited from class nom.tam.fits.Data
dataSize, fileOffset, input -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new empty compressed image data to be initialized at a later pointprotectedCreates a new compressed image data based on the prescription of the supplied header. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis should only be called byCompressedImageHDU.voidfillHeader(Header h) Describe the structure of this data object in the supplied header.protected voidforceNoLoss(int x, int y, int width, int heigth) This should only be called buyCompressedImageHDU.protected <T extends ICompressOption>
TgetCompressOption(Class<T> clazz) Returns the compression (or quantization) options for a selected compression option class.protected BufferThis should only be called byCompressedImageHDU.protected voidprepareUncompressedData(Object data, Header header) This should only be called byCompressedImageHDU.protected voidpreserveNulls(long nullValue, String compressionAlgorithm) preserve the null values in the image even if the compression algorithm is lossy.protected CompressedImageDatasetAxis(int[] axes) Sets the size of the image to be compressed.protected voidsetCompressAlgorithm(HeaderCard compressAlgorithmCard) Sets the compression algorithm that was used to generate the HDU.protected voidsetQuantAlgorithm(HeaderCard quantAlgorithmCard) Sets the quantization algorithm that was used to generate the HDU.protected CompressedImageDatasetTileSize(int... axes) Sets the tile size to use for sompressing.Methods inherited from class nom.tam.fits.BinaryTable
addBitsColumn, addByteVaryingColumn, addColumn, addColumn, addComplexColumn, addFlattenedColumn, addRow, addStringColumn, addVariableSizeColumn, clone, compact, containsHeap, convertToBits, copy, createColumnDataFor, createColumnTable, createTable, defragment, deleteColumns, deleteRows, discardVLAs, fromColumnMajor, fromRowMajor, get, getArrayElement, getArrayElementAs, getBases, getColumn, getCurrentData, getData, getDescriptor, getDescriptor, getDescriptor, getDimens, getDouble, getElement, getFlatColumns, getFlattenedColumn, getFromHeap, getLogical, getLong, getModelRow, getNCols, getNRows, getNumber, getRawElement, getRow, getSizes, getString, getTrueSize, getTypes, indexOf, loadData, parseTDims, read, readHeap, readHeap, readTrueData, reserveHeapSpace, reserveRowSpace, set, setColumn, setComplexColumn, setElement, setFlattenedColumn, setRow, toHDU, updateAfterDelete, validColumn, validRow, writeMethods inherited from class nom.tam.fits.Data
calcChecksum, detach, ensureData, getFileOffset, getKernel, getRandomAccessInput, getSize, isDeferred, isEmpty, reset, rewrite, rewriteable, setFileOffsetMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nom.tam.fits.TableData
addRowEntries, setRowEntries
-
Constructor Details
-
CompressedImageData
protected CompressedImageData()Creates a new empty compressed image data to be initialized at a later point -
CompressedImageData
Creates a new compressed image data based on the prescription of the supplied header.- Parameters:
hdr- The header that describes the compressed image- Throws:
FitsException- If the header is invalid or could not be accessed.
-
-
Method Details
-
fillHeader
Description copied from class:DataDescribe the structure of this data object in the supplied header.- Overrides:
fillHeaderin classBinaryTable- Parameters:
h- header to fill with the data from the current data object- Throws:
FitsException- if the operation fails
-
compress
This should only be called byCompressedImageHDU.- Throws:
FitsException
-
forceNoLoss
protected void forceNoLoss(int x, int y, int width, int heigth) This should only be called buyCompressedImageHDU. -
getCompressOption
Returns the compression (or quantization) options for a selected compression option class. It is presumed that the requested options are appropriate for the compression and/or quantization algorithm that was selected. E.g., if you calledsetCompressionAlgorithm(, then you can retrieve options for it with this method asCompression.ZCMPTYPE_RICE_1)getCompressOption(.RiceCompressOption.class)- Type Parameters:
T- The generic type of the compression class- Parameters:
clazz- the compression class- Returns:
- The current set of options for the requested type, or
nullif there are no options or if the requested type does not match the algorithm(s) selected. - See Also:
-
getUncompressedData
This should only be called byCompressedImageHDU.- Throws:
FitsException
-
prepareUncompressedData
This should only be called byCompressedImageHDU.- Throws:
FitsException
-
preserveNulls
preserve the null values in the image even if the compression algorithm is lossy.- Parameters:
nullValue- the value representing null for byte/short and integer pixel valuescompressionAlgorithm- compression algorithm to use for the null pixel mask
-
setAxis
Sets the size of the image to be compressed.- Parameters:
axes- the image size- Returns:
- itself This should only be called by
CompressedImageHDU.
-
setCompressAlgorithm
Sets the compression algorithm that was used to generate the HDU.- Parameters:
compressAlgorithmCard- the FITS header card that specifies the compression algorithm that was used.- See Also:
-
setQuantAlgorithm
Sets the quantization algorithm that was used to generate the HDU.- Parameters:
quantAlgorithmCard- the FITS header card that specifies the quantization algorithm that was used.- Throws:
FitsException- if no algorithm is available by the specified name- See Also:
-
setTileSize
Sets the tile size to use for sompressing.- Parameters:
axes- the tile size along all dimensions. Only the last 2 dimensions may differ from 1.- Returns:
- itself
- Throws:
FitsException- if the tile size is invalid. This should only be called byCompressedImageHDU.
-