Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
|
TIF_Input is an object that facilitates reading in of GTIFF/TIFF files. More...
#include <tif_input.h>
Public Member Functions | |
tif_input () | |
tif_input (std::string filename, bool hold=true) | |
tif_input (std::vector< std::string > filenames) | |
virtual | ~tif_input () |
arma::fcube | I () const |
Gets I. More... | |
const arma::fcube * | I_ptr () const |
Gets a pointer to I. More... | |
arma::fvec | wavelengths () const |
Gets wavelengths. More... | |
GDALDataset * | gdal_dataset_ptr () const |
Gets gdal_dataset_ptr. More... | |
scyl::INPUT_TYPE | type () |
Tells you what an object is. More... | |
void | set_wavelengths (const arma::fvec &in) |
Sets the wavelength vector for the input object. (Set I first) More... | |
Public Member Functions inherited from scyl::input | |
input () | |
virtual | ~input () |
virtual arma::fcube | I (const arma::uvec bands) const |
Gets I (subset of bands) More... | |
virtual arma::fcube | I (int r0, int c0, int r1, int c1) const |
Gets I (cropped) More... | |
virtual arma::fcube | I (const arma::uvec bands, int r0, int c0, int r1, int c1) const |
Gets I (subset of bands) More... | |
virtual arma::fvec | illuminant () const |
Gets illuminant. More... | |
virtual arma::fmat | k () const |
Gets k. More... | |
virtual arma::fmat | g () const |
Gets g. More... | |
virtual arma::fcube | s () const |
Gets s. More... | |
virtual const arma::fcube * | s_ptr () const |
Gets a pointer to s. More... | |
virtual arma::fmat | elements () const |
Gets elements. More... | |
virtual arma::fmat | endmembers () const |
Gets endmembers. More... | |
virtual std::vector< std::string > | endmember_labels () const |
Gets endmember_labels. More... | |
virtual arma::fcube | element_abundances () const |
Gets element_abundances. More... | |
virtual arma::ucube | element_abundance_indexes () const |
Gets element_abundance_indexes. More... | |
virtual arma::fmat | endmember_abundances () const |
Gets endmember_abundances. More... | |
virtual arma::umat | endmember_abundance_indexes () const |
Gets endmember_abundance_indexes. More... | |
int | height () const |
Get height. More... | |
int | width () const |
Get width. More... | |
int | bands () const |
Get bands. More... | |
Private Attributes | |
GDALDataset * | m_podataset |
std::string | m_filename |
arma::fvec | m_wavelengths |
bool | m_hold |
arma::fcube | m_I |
Additional Inherited Members | |
Protected Attributes inherited from scyl::input | |
unsigned int | m_height |
unsigned int | m_width |
unsigned int | m_bands |
TIF_Input is an object that facilitates reading in of GTIFF/TIFF files.
At the most basic level, the input can be used as follows:
scyl::input * input = scyl::tif_input("string/filename/path.tif");
Class members will extract data from the file as requested. Only I() and wavelengths() will return non zero values for TIF files. Default values for wavelengths are set.
To open up a series of tif images as one object/image, use the second constructor. When provided with a list of images it will simply use those to construct an image. If the list contains only one element it will assume this determines the taget folder and scan for all tifs in that directory, assembling them into an image in alphabetical order. For this type of image loading the only option is to load the image into memory.
scyl::tif_input::tif_input | ( | ) |
TIF_Input Constructor Creates a blank TIF_Input object (can't do anything but be a placeholder till overwritten with a constructed object).
scyl::tif_input::tif_input | ( | std::string | filename, |
bool | hold = true |
||
) |
TIF_Input Constructor Creates a TIF_Input object. An ENVI style header file (.hdr) of the same basename as the tif can be provided to specify wavelengths.
filename | the string path to the file to be loaded. |
hold | set to true if the object is to maintain the image in memory, false otherwise. |
Exception | Invalid file |
scyl::tif_input::tif_input | ( | std::vector< std::string > | filenames | ) |
TIF_Input Constructor Creates a TIF_Input object. This variation of the constructor is used to create a tif input from TIF images where each band is stored as a seperate image file. The image locations can be given as a vector (n images for n bands), or the images can be found automatically by just giving a single element vector with the target directory as the string contained. An ENVI style header file (.hdr) of the same basename as the tif can be provided to specify wavelengths.
filename | the string path to the file to be loaded. |
Exception | Invalid file |
|
virtual |
TIF_Input Destructor.
|
virtual |
Gets gdal_dataset_ptr.
Exception | Data does not exist. |
Reimplemented from scyl::input.
|
virtual |
|
virtual |
void scyl::tif_input::set_wavelengths | ( | const arma::fvec & | in | ) |
Sets the wavelength vector for the input object. (Set I first)
Bands in I will be sorted when this function is called, according to the wavelength vector (If not already sorted).
in | the input wavelength vector. |
Exception | data size mismatch |
|
virtual |
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |