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::component_output Class Reference

component_output is a class that is used to output processed image components from a pipeline object as separate HDR files in a folder. More...

#include <component_output.h>

Inheritance diagram for scyl::component_output:
scyl::output

Public Member Functions

 component_output (unsigned int flags=scyl::ALL)
 
virtual ~component_output ()
 
void save (scyl::pipeline *in, std::string filename)
 save() takes a pipeline object and file name and writes out several files containing the data in the given pipeline object. More...
 
- Public Member Functions inherited from scyl::output
 output ()
 
virtual ~output ()
 

Private Attributes

unsigned int m_flags
 

Detailed Description

component_output is a class that is used to output processed image components from a pipeline object as separate HDR files in a folder.

If no flags are specified component_output will save all image components defined in scyl::COMPONENTS that are present within the pipeline object to the directory given in the save call. These are (Component, suffix, file):

I                    :  _I,              as HDR/data pair size height x width x bands
Illuminant           :  _illuminant,     as HDR/data pair size 1 x 1 x bands
k                    : _k,               as HDR/data pair size height x width x 1
g                    : _g,               as HDR/data pair size height x width x 1
s                    : _s,               as HDR/data pair size height x width x bands
Material Elements    : _elements,        as HDR/data pair size num_materials x bands
Material Abundances  : _abundances,      as HDR/data pair size height x width x num_materials
Material Indexes     : _indexes,         as HDR/data pair size height x width x num_materials
Endmember Abundances : _endabundances    as HDR/data pair size num_materials x abund_mat_per_pixel
Endmember Indexes    : _endindexes       as HDR/data pair size num_materials x abund_mat_per_pixel
Endmembers + Labels  : _spectral_library as an slz file.

Otherwise it will save according to given flags, see examples below.

scyl::output * output = scyl::component_output(); // No flags so will attempt to save all image components
pipeline.set_output(output);
pipeline.save("path/to/output001"); // Will save files to directory 'path/to' with prefix 'output001' (e.g. output001_I.hdr, output001_s.hdr etc)

scyl::output * output = scyl::component_output(scyl::I bitand scyl::ELEMENTS); // Flags for I and Elements set, will only save those two.
pipeline.set_output(output);
pipeline.save("path/to/output001"); // Will save files to directory 'path/to' with prefix 'output002' (e.g. output002_I.hdr, output001_elements.hdr)

Constructor & Destructor Documentation

scyl::component_output::component_output ( unsigned int  flags = scyl::ALL)

Output Constructor

Parameters
flagsFlags for which image components to save (default is all). Set by bitor ( | ) ing scyl::COMPONENTS together.
scyl::component_output::~component_output ( )
virtual

Output Destructor

Member Function Documentation

void scyl::component_output::save ( scyl::pipeline in,
std::string  filename 
)
virtual

save() takes a pipeline object and file name and writes out several files containing the data in the given pipeline object.

Names of output files will be as according to the provided string, with the file extension stripped and suffixes appended. e.g if the path given is /data/output001.ext then files /data/output001_I.hdr, /data/output001_illuminant.hdr etc will be created.

Parameters
inA pointer to the pipeline object to be saved
filenameA string file path to the intended save location (directory/prefix)
Exceptions
ExceptionInvalid file argument
ExceptionMissing data in Pipeline object preventing saving

Implements scyl::output.

Member Data Documentation

unsigned int scyl::component_output::m_flags
private

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