#include <ImageHdu.h>
Image HDU reader-writer.
The FITS format can accommodate images of any dimension. EleFits stores them in n-dimensional containers: Raster objects. This is visible in the ImageHdu services as a template parameter N
.
When the dimension is known at compile time and fixed, it is recommended to specify it (N > 0
), which allows for a few internal optimizations and brings safety as the code is less error-prone with fewer degrees of freedom.
The zero vector space (N = 0
) is supported; It is used to represent HDUs with no data, as recommended in the FITS standard.
When the dimension is unknown at compile time, or is expected to change (e.g. 2D images to be merged as a 3D image), special value N = -1
can be specified. In this case, the dimension is read in the FITS file, but the user should be careful to handle all possible values.
Classes | |
struct | Initializer |
A structure which holds everything known at image extension initialization. More... | |
Public Member Functions | |
Construction | |
const ImageHdu & | operator= (const ImageHdu &rhs) const |
Copy the contents of another image HDU. | |
Properties | |
HduCategory | category () const override |
Read the category of the HDU. More... | |
bool | is_compressed () const |
Check whether the HDU is compressed. | |
Element access | |
const ImageRaster & | raster () const |
Access the data unit to read and write the raster. More... | |
Operations | |
const std::type_info & | read_typeid () const |
Read the image pixel value type. | |
long | read_size () const |
Read the number of pixels in the image. | |
template<long N = 2> | |
Position< N > | read_shape () const |
Read the image shape. | |
std::unique_ptr< Compression > | read_compression () const |
Read the compression parameters. | |
template<typename T , long N = 2> | |
void | update_type_shape (const Position< N > &shape) const |
Redefine the image shape and type. | |
template<typename T , long N = 2> | |
VecRaster< T, N > | read_raster () const |
Read the Raster. | |
template<typename TRaster > | |
void | write_raster (const TRaster &data) const |
Write the Raster. | |
Deprecated | |
const std::type_info & | readTypeid () const |
long | readSize () const |
template<typename T , long N = 2> | |
void | updateShape (const Position< N > &shape) const |
template<typename T , long N = 2> | |
VecRaster< T, N > | readRaster () const |
template<typename TRaster > | |
void | writeRaster (const TRaster &data) const |
Public Member Functions inherited from Hdu | |
long | index () const |
Get the 0-based index of the HDU. | |
HduCategory | type () const |
Get the type of the HDU. More... | |
bool | matches (HduFilter filter) const |
Check whether the HDU matches a given filter. More... | |
std::size_t | size_in_file () const |
Read the number of bytes used by the Hdu. More... | |
const Header & | header () const |
Access the header unit to read and write records. More... | |
template<typename T > | |
const T & | as () const |
View as an ImageHdu , ImageRaster , BintableHdu or BintableColumns (if possible). | |
std::string | read_name () const |
Read the extension name. | |
long | read_version () const |
Read the extension version. | |
void | update_name (const std::string &name) const |
Write or update the extension name. | |
void | update_version (long version) const |
Write or update the extension version. | |
void | verify_checksums () const |
Compute the HDU and data checksums and compare them to the values in the header. More... | |
void | update_checksums () const |
Compute and write (or update) the HDU and data checksums. More... | |
HduCategory | readCategory () const |
std::string | readName () const |
long | readVersion () const |
void | updateName (const std::string &name) const |
void | updateVersion (long version) const |
void | verifyChecksums () const |
void | updateChecksums () const |