Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Private Attributes | List of all members
scyl::tif_input Class Reference

TIF_Input is an object that facilitates reading in of GTIFF/TIFF files. More...

#include <tif_input.h>

Inheritance diagram for scyl::tif_input:
scyl::input

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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
filenamethe string path to the file to be loaded.
holdset to true if the object is to maintain the image in memory, false otherwise.
Exceptions
ExceptionInvalid 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.

Parameters
filenamethe string path to the file to be loaded.
Exceptions
ExceptionInvalid file
scyl::tif_input::~tif_input ( )
virtual

TIF_Input Destructor.

Member Function Documentation

GDALDataset * scyl::tif_input::gdal_dataset_ptr ( ) const
virtual

Gets gdal_dataset_ptr.

Returns
gdal_dataset_ptr
Exceptions
ExceptionData does not exist.

Reimplemented from scyl::input.

arma::fcube scyl::tif_input::I ( ) const
virtual

Gets I.

Returns
I

Reimplemented from scyl::input.

const arma::fcube * scyl::tif_input::I_ptr ( ) const
virtual

Gets a pointer to I.

Returns
a pointer to I

Reimplemented from scyl::input.

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).

Parameters
inthe input wavelength vector.
Exceptions
Exceptiondata size mismatch
scyl::INPUT_TYPE scyl::tif_input::type ( )
virtual

Tells you what an object is.

Returns
The type enum of this object.

Reimplemented from scyl::input.

arma::fvec scyl::tif_input::wavelengths ( ) const
virtual

Gets wavelengths.

Returns
wavelengths

Reimplemented from scyl::input.

Member Data Documentation

std::string scyl::tif_input::m_filename
private
bool scyl::tif_input::m_hold
private
arma::fcube scyl::tif_input::m_I
private
GDALDataset* scyl::tif_input::m_podataset
private
arma::fvec scyl::tif_input::m_wavelengths
private

The documentation for this class was generated from the following files: