Scyllarus: C++ Hyperspectral Processing Library
Hyperspectral Image Processing Pipeline
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
component_input.h
Go to the documentation of this file.
1 /****************************************************************************************
2  * SCYLLARUS : C++ HYPERSPECTRAL PROCESSING LIBRARY
3  * component_input.h - Hyperspectral Image Component Input Object.
4  *
5  * This computer code is subject to copyright:
6  * (c) National ICT Australia Limited (NICTA) 2013-2014 All Rights Reserved.
7  *
8  * Jeremy Oorloff, National ICT Australia (NICTA)
9  *
10  ***************************************************************************************/
11 #ifndef COMPONENTINPUT_H_
12 #define COMPONENTINPUT_H_
13 
14 #include "input.h"
15 #include "logger.h"
16 #include "scyllarus_types.h"
17 #include "spectral_library.h"
18 #include "image_utilities.h"
19 #include "input/hdr_input.h"
20 #include "utility.h"
21 
22 #include <iso646.h>
23 #include <armadillo>
24 #include <boost/filesystem.hpp>
25 
26 
27 namespace scyl
28 {
29 
66 {
67 
68 public:
69 
70  component_input(std::string filename,
71  unsigned int flags=scyl::ALL);
72 
73  virtual ~component_input();
74 
75  arma::fcube I() const;
76 
77  const arma::fcube * I_ptr() const;
78 
79  arma::fvec illuminant() const;
80 
81  arma::fmat k() const;
82 
83  arma::fcube s() const;
84 
85  const arma::fcube * s_ptr() const;
86 
87  arma::fmat elements() const;
88 
89  arma::fcube element_abundances() const;
90 
91  arma::ucube element_abundance_indexes() const;
92 
93  arma::fmat endmembers() const;
94 
95  std::vector<std::string> endmember_labels() const;
96 
97  arma::fmat endmember_abundances() const;
98 
99  arma::umat endmember_abundance_indexes() const;
100 
101  arma::fmat g() const;
102 
103  arma::fvec wavelengths() const;
104 
106 
107  static void load_I(scyl::component_input & in, std::string filename, bool check=true);
108 
109  static void load_s(scyl::component_input & in, std::string filename, bool check=true);
110 
111 
112 private:
113 
114  void reconstruct_I() const;
115 
116  void reconstruct_s() const;
117 
118  unsigned int m_flags;
119 
120  arma::fvec m_wavelengths;
121 
122  mutable arma::fcube m_s;
123 
124  mutable arma::fcube m_I;
125 
127 
129 
131 
133 
135 
137 
139 
141 
143 
145 
147 
149 
151 
153 
155 
157 
159 
161 
163 
165 
167 
169 };
170 
171 }
172 #endif /* COMPONENTINPUT_H_ */
scyl::hdr_input * m_hdr_k
Definition: component_input.h:130
bool m_loaded_endabundances
Definition: component_input.h:164
Definition: scyllarus_types.h:125
bool m_loaded_abundances
Definition: component_input.h:158
Input is a base class from which input classes for the pipeline are derived..
Definition: input.h:33
scyl::INPUT_TYPE type()
Tells you what an object is.
Definition: component_input.cpp:930
virtual ~component_input()
Definition: component_input.cpp:404
static void load_I(scyl::component_input &in, std::string filename, bool check=true)
Definition: component_input.cpp:419
bool m_loaded_indexes
Definition: component_input.h:160
scyl::hdr_input * m_hdr_s
Definition: component_input.h:132
std::vector< std::string > endmember_labels() const
Gets labels.
Definition: component_input.cpp:882
scyl::hdr_input * m_hdr_abundances
Definition: component_input.h:136
arma::fmat g() const
Gets g.
Definition: component_input.cpp:898
arma::fcube m_I
Definition: component_input.h:124
arma::ucube element_abundance_indexes() const
Gets indexes.
Definition: component_input.cpp:809
arma::fcube m_s
Definition: component_input.h:122
bool m_loaded_g
Definition: component_input.h:162
static void load_s(scyl::component_input &in, std::string filename, bool check=true)
Definition: component_input.cpp:480
arma::umat endmember_abundance_indexes() const
Gets endindexes.
Definition: component_input.cpp:845
component_input is an object that facilitates reading in of files saved by component_output (or assem...
Definition: component_input.h:65
unsigned int m_flags
Definition: component_input.h:118
bool m_loaded_k
Definition: component_input.h:152
INPUT_TYPE
Definition: scyllarus_types.h:21
arma::fmat k() const
Gets k.
Definition: component_input.cpp:682
bool m_loaded_elements
Definition: component_input.h:156
const arma::fcube * I_ptr() const
Gets a pointer to I.
Definition: component_input.cpp:638
scyl::hdr_input * m_hdr_I
Definition: component_input.h:126
arma::fcube s() const
Gets s.
Definition: component_input.cpp:701
bool m_loaded_s
Definition: component_input.h:154
arma::fvec illuminant() const
Gets illuminant.
Definition: component_input.cpp:666
arma::fcube element_abundances() const
Gets abundances.
Definition: component_input.cpp:793
scyl::hdr_input * m_hdr_g
Definition: component_input.h:140
scyl::hdr_input * m_hdr_endabundances
Definition: component_input.h:142
void reconstruct_I() const
reconstruct_I() will attempt to reconstruct I based on the loaded components in the object...
Definition: component_input.cpp:539
arma::fvec m_wavelengths
Definition: component_input.h:120
void reconstruct_s() const
reconstruct_s() will attempt to reconstruct s based on the loaded components in the object...
Definition: component_input.cpp:580
HDR_Input is an object that facilitates reading in of HDR files.
Definition: hdr_input.h:41
Spectral Library is a class that loads and saves SLZ files and holds information from them for use wi...
Definition: spectral_library.h:41
scyl::hdr_input * m_hdr_illuminant
Definition: component_input.h:128
bool m_loaded_I
Definition: component_input.h:148
const arma::fcube * s_ptr() const
Gets a pointer to s.
Definition: component_input.cpp:737
bool m_loaded_endindexes
Definition: component_input.h:166
scyl::spectral_library m_spectral_library
Definition: component_input.h:146
arma::fvec wavelengths() const
Gets wavelengths.
Definition: component_input.cpp:914
arma::fmat endmembers() const
Gets endmembers.
Definition: component_input.cpp:866
arma::fmat elements() const
Gets elements.
Definition: component_input.cpp:772
scyl::hdr_input * m_hdr_elements
Definition: component_input.h:134
bool m_loaded_illuminant
Definition: component_input.h:150
scyl::hdr_input * m_hdr_indexes
Definition: component_input.h:138
component_input(std::string filename, unsigned int flags=scyl::ALL)
Definition: component_input.cpp:24
scyl::hdr_input * m_hdr_endindexes
Definition: component_input.h:144
arma::fmat endmember_abundances() const
Gets endabundances.
Definition: component_input.cpp:824
arma::fcube I() const
Gets I.
Definition: component_input.cpp:610
bool m_loaded_spectral_library
Definition: component_input.h:168