20 #ifndef VespucciDataset_H 21 #define VespucciDataset_H 24 #include <QTextStream> 80 QSharedPointer<VespucciWorkspace> ws);
86 QString x_axis_description,
87 QString y_axis_description,
95 QString x_axis_description,
96 QString y_axis_description,
102 QSharedPointer<VespucciDataset> original,
115 void CropSpectra(
double x_min,
double x_max,
double y_min,
double y_max,
double wl_min,
double wl_max);
119 mat ZScoreNormCopy();
120 void MinMaxNormalize();
121 void VectorNormalize(uword norm);
123 void ZScoreNormalize();
124 void SNVNormalize(
double offset,
bool center);
125 void AbsoluteValue();
126 void PeakIntensityNormalize(
double peak_position);
127 void PeakIntensityNormalize(
double left_bound,
double right_bound);
128 void Booleanize(
double min,
double max,
bool keep_inside,
bool oneify);
129 void Clamp(
double min,
double max);
130 void ShedZeroSpectra();
131 void ShedZeroWavelengths();
135 void SubtractBackground(
const QStringList &data_keys);
137 void LinearMovingAverage(
unsigned int window_size);
138 void SavitzkyGolay(
unsigned int derivative_order,
139 unsigned int polynomial_order,
140 unsigned int window_size);
141 void SingularValue(
unsigned int singular_values);
142 int QUIC_SVD(
double epsilon);
143 void MFBaseline(
int window_size,
int iterations);
145 void CWTBaseline(
int lambda,
int penalty_order,
double SNR_threshold,
double peak_shape_threshold);
146 void IModPolyBaseline(
const uword poly_order,
const uword max_it,
double threshold);
147 void RemoveClippedSpectra(
double threshold);
148 void RemoveFlatSpectra(
double threshold);
149 void ZeroClippedSpectra(
double threshold);
150 void ZeroFlatSpectra(
double threshold);
151 void Scale(
double scaling_factor);
152 void ShedSpectrum(
const uword index);
153 void ZeroSpectrum(
const uword index);
155 void TransformAbscissa(QString input_units,
double input_factor,
156 QString output_units,
double output_factor, QString description);
158 unsigned int poly_order,
159 unsigned int window_size);
161 void FourierTransform(
int n);
162 void InverseFourierTransform(
int n);
163 void ApplyFTWeight(QString type,
double param);
164 void ApplyFTWeight(
double start_offset,
double end_offset,
172 vec PointSpectrum(uword index)
const;
175 QVector<double> WavelengthQVector()
const;
178 int FindIndex(
int x_value,
int y_value)
const;
179 uword FindIndex(
double abscissa_value)
const;
182 uvec FindRange(
double start,
double end)
const;
184 uword FindOrigin()
const;
188 int ValueSize()
const;
192 bool Save(QString filename);
193 bool Load(QString filename);
194 bool SaveSpectrum(QString filename, uword column, file_type type);
196 void Univariate(
const QString &name,
double &left_bound,
double &right_bound,
198 void FitPeak(
const QString &name,
199 const QString &peak_shape,
201 double &right_bound);
202 void BandRatio(
const QString &name,
203 double &first_left_bound,
double &first_right_bound,
204 double &second_left_bound,
double &second_right_bound,
206 void ClassicalLeastSquares(
const QString &name,
const QStringList &reference_keys);
207 void PartialLeastSquares(
const QString &name, uword components);
208 void PLSCalibration(
const QString &name,
const QStringList &control_keys);
209 void TrainPLSDA(
const QString &name,
const QStringList &label_keys);
210 void CorrelationAnalysis(
const QString &control_key, QString name);
211 void VertexComponents(
const QString &name, uword endmembers);
212 void KMeans(
const QString &name,
const QString &metric_text,
213 const QString &partition_policy,
bool allow_empty,
size_t clusters);
214 void PrincipalComponents(
const QString &name);
215 void PrincipalComponents(
const QString &name,
bool scale_data);
216 void FindPeaks(
const QString &name,
double sel,
double threshold,
217 uword poly_order, uword window_size);
218 void AgglomerativeClustering(
const QString &name,
const QString &linkage,
const QString &metric);
219 void CalculateRepresentativeSpectrum(
const QString &name, QString statistic, QString metric);
223 vec wavelength()
const;
224 vec abscissa()
const;
227 vec x(uvec indices)
const;
228 vec y(uvec indices)
const;
229 double x(uword index)
const;
230 double y(uword index)
const;
231 vec wavelength(uvec indices)
const;
232 mat spectra(uvec indices)
const;
234 cx_mat cx_spectra()
const;
235 cx_mat cx_spectra(uvec indices)
const;
236 const QString name()
const;
239 QStringList operations();
241 bool principal_components_calculated()
const;
242 bool mlpack_pca_calculated()
const;
243 bool vertex_components_calculated()
const;
244 bool partial_least_squares_calculated()
const;
246 QList<QSharedPointer<UnivariateData> > univariate_datas();
247 const QString x_axis_description()
const;
248 const QString y_axis_description()
const;
250 void SetName(QString new_name);
251 void SetData(
const mat &spectra,
const vec &wavelength,
const vec &x,
const vec &y);
253 void SetIndices(vec indices);
255 void AddMap(QSharedPointer<MapData> map);
256 void RemoveMap(
const QString &name);
257 int map_loading_count()
const;
259 void SetXDescription(QString description);
260 void SetYDescription(QString description);
263 QCPRange PointSpectrumRange(
int i)
const;
268 bool ConstructorCancelled()
const;
269 mat AverageSpectrum(
bool stats)
const;
273 mat *wavelength_ptr();
276 mat *spectra_old_ptr(
bool *ok);
278 const mat &spectra_ref();
279 const vec &abscissa_ref();
283 size_t columns()
const;
284 double AbscissaMin()
const;
285 double AbscissaMax()
const;
287 bool non_spatial()
const;
289 void SetParentDatasetIndices(mat parent_dataset_indices);
290 mat *parent_dataset_indices();
291 bool Undoable()
const;
292 uword UniqueX()
const;
293 uword UniqueY()
const;
294 int UnivariateCount()
const;
296 const QString last_operation()
const;
305 void AddAnalysisResult(QSharedPointer<AnalysisResults> analysis_result);
306 void AddAnalysisResult(QSharedPointer<AnalysisResults> analysis_result, uword start_row, uword end_row);
308 QStringList AnalysisResultsKeys()
const;
309 QMap<QString, QStringList> AnalysisResultsTreeStructure()
const;
311 void ImportAuxiliaryMatrix(
const QString &name,
const QString &filename);
312 void AddAuxiliaryMatrix(
const QString &name, mat &matrix);
313 void AddMatrix(
const QString &name, mat &matrix);
314 QStringList AuxiliaryMatrixKeys()
const;
315 QStringList CoreMatrixKeys()
const;
318 const mat & GetAnalysisResultMatrix(
const QString &results_key,
const QString &matrix_key)
const;
319 QSharedPointer<AnalysisResults> GetAnalysisResult(
const QString &key);
320 const mat & GetAuxiliaryMatrix(
const QString &key)
const;
321 const mat &GetCoreMatrix(
const QString &key)
const;
322 bool IsCoreMatrix(
const QString &key)
const;
323 QSharedPointer<MapData> GetMapData(
const QString &key);
325 void CreateMap(
const QString &map_name,
326 const QString &results_key,
327 const QString &matrix_key,
330 void CreateMap(
const QString &map_name,
331 const QString &matrix_key,
335 bool ShowMapViewer(
const QString &map_key,
bool show);
337 QStringList MapKeys()
const;
341 bool Contains(
const QString &key)
const;
343 bool IsValid()
const;
345 bool state_changed()
const;
347 QString filename()
const;
348 QString last_save_filename()
const;
358 const mat empty_matrix_;
363 QSharedPointer<AnalysisResults> auxiliary_matrices_;
371 QSharedPointer<VespucciWorkspace> workspace_;
420 QString last_operation_;
425 QList<QSharedPointer<MapData> > maps_;
431 mat parent_dataset_indices_;
436 int map_loading_count_;
441 QString x_axis_description_;
446 QString y_axis_description_;
463 bool z_scores_calculated_;
468 bool constructor_canceled_;
496 QVector<QSharedPointer<AnalysisResults> > analysis_results_;
502 QStringList operations_;
507 QString last_save_filename_;
522 map<pair<int, int>,
string> text_filenames_;
528 Q_DECLARE_METATYPE(QSharedPointer<VespucciDataset> *)
530 #endif // VespucciDataset_H The PLSData class A class for performing and storing data related to partial least squares determinan...
QTextStream log_text_stream_
log_text_stream_ A log of all UI-induced functions called on this dataset
The PrincipalComponentsData class A class for performing and storing data from principal components a...
The MapData class Class for processed map data. Images are created from this data.
VESPUCCI_EXPORT arma::uword max(arma::uword a, arma::uword b)
Vespucci::Math::max.
VESPUCCI_EXPORT arma::vec MedianFilter(const arma::vec &X, arma::uword window_size)
Vespucci::Math::Smoothing::MedianFilter.
The VespucciDataset class This is the main class for dealing with hyperspectral data. This handles the import and export of spectra, and the creation of maps. Images are handled by the MapData class. This class is intended to be allocated on the heap inside of a smart pointer, there is no copy constructor.
The AbstractDataAnalyzer class Pure abstract class describing an object that can be passed as a point...
VESPUCCI_EXPORT size_t HySime(const arma::mat &y, const arma::mat &n, arma::mat &Rn, arma::mat &Ek)
Vespucci::Math::DimensionReduction::HySime.
VESPUCCI_EXPORT arma::vec RollingBallBaseline(const arma::vec &spectrum, arma::vec &baseline, arma::uword wm, arma::uword ws)
Vespucci::Math::Baseline::RollingBallBaseline.
The VespucciWorkspace class A class which contains all "global variables" (that aren't held in MainWi...
VESPUCCI_EXPORT arma::mat InterpolateToNewAbscissa(const arma::mat &spectra, const arma::vec &old_abscissa, const arma::vec &new_abscissa, const int window_size, const int order)
InterpolateToNewAbscissa.
VESPUCCI_EXPORT arma::vec FindPeaks(arma::vec X, arma::vec dX, double sel, double threshold, arma::vec &peak_magnitudes)
Vespucci::Math::PeakFinding::FindPeaks an implementation of the peakfinder arma::mat routine...
VESPUCCI_EXPORT arma::uword min(arma::uword a, arma::uword b)
Vespucci::Math::min.
The VCAData class A class for performing and storing data from Vertex Components Analysis.
Defines a color gradient for use with e.g. QCPColorMap.
Represents the range an axis is encompassing.
The MainWindow class The main window of the program, this is where the user performs most operations...
The AnalysisResults class A container for a mat object that allows a mat to be copied to a heap-alloc...
The MapListModel class Exposes the UI to the contents of the master map list.