All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FusionWizardPage.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/rp/FusionWizardPage.cpp
22 
23  \brief This file defines a class for a Fusion Wizard page.
24 */
25 
26 // TerraLib
27 #include "../../../common/StringUtils.h"
28 #include "../../../dataaccess/dataset/DataSet.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../raster/Interpolator.h"
31 #include "../../../raster/Raster.h"
32 #include "../../../rp/Functions.h"
33 #include "../../../rp/SpectralResponseFunctions.h"
34 #include "../../../se/Utils.h"
35 #include "FusionWizardPage.h"
36 #include "ui_FusionWizardPageForm.h"
37 
38 // Qt
39 #include <QApplication>
40 #include <QFileDialog>
41 #include <QGridLayout>
42 #include <QMessageBox>
43 
44 // stl
45 #include <fstream>
46 #include <iosfwd>
47 #include <memory>
48 #include <stdio.h>
49 
50 //QWT
51 #include <qwt_legend.h>
52 #include <qwt_plot.h>
53 
55 
57  : QWizardPage(parent),
58  m_ui(new Ui::FusionWizardPageForm),
59  m_scatterHighRes(0),
60  m_layerLower(0),
61  m_layerHigher(0)
62 {
63 // setup controls
64  m_ui->setupUi(this);
65 
67 
68  fillSensorTypes(m_ui->m_sensorTypeComboBox);
69 
71 
72  //chart dialog
73  m_chartDialog = new QDialog(this, Qt::Tool | Qt::WindowTitleHint);
74  QGridLayout* dlgLayout = new QGridLayout(m_chartDialog);
76  dlgLayout->addWidget(m_chartDisplay);
77 
78  m_chartDisplay->setAxisTitle(QwtPlot::xBottom, tr("Wavelength in Microns"));
79  m_chartDisplay->setAxisTitle(QwtPlot::yLeft, tr("Reflectance"));
80  m_chartDisplay->insertLegend(new QwtLegend(), QwtPlot::RightLegend);
81 
82  //connects
83  connect(m_ui->m_scatterBoolButton, SIGNAL(toggled(bool)), m_chartDialog, SLOT(setVisible(bool)));
84  connect(m_ui->m_sensorTypeComboBox, SIGNAL(activated(int)), this, SLOT(onHighResSensorTypeActivated(int)));
85  connect(m_ui->m_csvToolButton, SIGNAL(clicked()), this, SLOT(onHighCsvToolButtonClicked()));
86 
87 
88  //configure page
89  this->setTitle(tr("Fusion"));
90  this->setSubTitle(tr("Select the type of fusion and set their specific parameters."));
91 
92  m_ui->m_scatterBoolButton->setIcon(QIcon::fromTheme("chart-lines"));
93 }
94 
96 {
97 
98 }
99 
101 {
102  return true;
103 }
104 
106 {
107  m_layerLower = layer;
108 
109  m_ui->m_ihsLowerLineEdit->setText(m_layerLower->getTitle().c_str());
110  m_ui->m_pcaLowerLineEdit->setText(m_layerLower->getTitle().c_str());
111  m_ui->m_wisperLowerLineEdit->setText(m_layerLower->getTitle().c_str());
112 
113  listBandsLower();
114 }
115 
117 {
118  m_layerHigher = layer;
119 
120  m_ui->m_higherLineEdit_IHS->setText(m_layerHigher->getTitle().c_str());
121  m_ui->m_higherLineEdit_PCA->setText(m_layerHigher->getTitle().c_str());
122  m_ui->m_higherLineEdit_Wisper->setText(m_layerHigher->getTitle().c_str());
123 
124  listBandsHigher();
125 }
126 
128 {
129  int idx = m_ui->m_fusionTypeComboBox->currentIndex();
130 
131  int type = m_ui->m_fusionTypeComboBox->itemData(idx).toInt();
132 
133  if(type == FUSION_IHS)
134  return true;
135 
136  return false;
137 }
138 
140 {
141  int idx = m_ui->m_fusionTypeComboBox->currentIndex();
142 
143  int type = m_ui->m_fusionTypeComboBox->itemData(idx).toInt();
144 
145  if(type == FUSION_PCA)
146  return true;
147 
148  return false;
149 }
150 
152 {
153  int idx = m_ui->m_fusionTypeComboBox->currentIndex();
154 
155  int type = m_ui->m_fusionTypeComboBox->itemData(idx).toInt();
156 
157  if(type == FUSION_WISPER)
158  return true;
159 
160  return false;
161 }
162 
164 {
165  return m_ui->m_cropCheckBox->isChecked();
166 }
167 
169 {
170  int interpolationIdx = m_ui->m_interpolatorComboBox->currentIndex();
171  te::rst::Interpolator::Method method = (te::rst::Interpolator::Method)m_ui->m_interpolatorComboBox->itemData(interpolationIdx).toInt();
172 
173  te::rp::IHSFusion::InputParameters algoInputParams;
174 
175  algoInputParams.m_enableProgress = true;
176  algoInputParams.m_interpMethod = method;
177 
178  algoInputParams.m_lowResRasterRedBandIndex = m_ui->m_ihsRComboBox->currentText().toInt();
179  algoInputParams.m_lowResRasterGreenBandIndex = m_ui->m_ihsGComboBox->currentText().toInt();
180  algoInputParams.m_lowResRasterBlueBandIndex = m_ui->m_ihsBComboBox->currentText().toInt();
181 
182  algoInputParams.m_highResRasterBand = m_ui->m_bandComboBox_IHS->currentText().toInt();
183 
184  return algoInputParams;
185 }
186 
188 {
189  te::rp::IHSFusion::OutputParameters algoOutputParams;
190 
191  return algoOutputParams;
192 }
193 
195 {
196  int interpolationIdx = m_ui->m_interpolatorComboBox->currentIndex();
197  te::rst::Interpolator::Method method = (te::rst::Interpolator::Method)m_ui->m_interpolatorComboBox->itemData(interpolationIdx).toInt();
198 
199  te::rp::PCAFusion::InputParameters algoInputParams;
200 
201  algoInputParams.m_enableProgress = true;
202  algoInputParams.m_interpMethod = method;
203 
204  int nBands = m_ui->m_listWidget->count();
205  for(int i = 0; i < nBands; ++i)
206  {
207  if(m_ui->m_listWidget->item(i)->isSelected())
208  algoInputParams.m_lowResRasterBands.push_back(i);
209  }
210 
211  algoInputParams.m_highResRasterBand = m_ui->m_bandComboBox_PCA->currentText().toInt();
212 
213  return algoInputParams;
214 }
215 
217 {
218  te::rp::PCAFusion::OutputParameters algoOutputParams;
219 
220  return algoOutputParams;
221 }
222 
224 {
225  int idx = m_ui->m_interpolatorComboBox->currentIndex();
226  te::rst::Interpolator::Method method = (te::rst::Interpolator::Method)m_ui->m_interpolatorComboBox->itemData(idx).toInt();
227 
229 
230  algoInputParams.m_enableProgress = true;
231  algoInputParams.m_interpMethod = method;
232 
233  int nBands = m_ui->m_wisperTableWidget->rowCount();
234  for(int i = 0; i < nBands; ++i)
235  {
236  QTableWidgetItem* item = m_ui->m_wisperTableWidget->item(i, 0);
237 
238  if(item->checkState() == Qt::Checked)
239  {
240  algoInputParams.m_lowResRasterBands.push_back(i);
241 
242  QComboBox* cmbBox = (QComboBox*)m_ui->m_wisperTableWidget->cellWidget(i, 2);
243 
244  idx = cmbBox->currentIndex();
245  te::rp::srf::SensorType st = (te::rp::srf::SensorType)cmbBox->itemData(idx).toInt();
246  std::string stName = cmbBox->itemText(idx).toStdString();
247  algoInputParams.m_lowResRasterBandsSRFs.push_back(getSRFMap(st, stName));
248 
249  //algoInputParams.m_lowResRasterBandSensors.push_back((te::rp::srf::SensorType)cmbBox->itemData(idx).toInt());
250  }
251  }
252 
253  algoInputParams.m_highResRasterBand = m_ui->m_bandComboBox_Wisper->currentText().toInt();
254 
255  idx = m_ui->m_sensorTypeComboBox->currentIndex();
256  te::rp::srf::SensorType st = (te::rp::srf::SensorType)m_ui->m_sensorTypeComboBox->itemData(idx).toInt();
257  std::string stName = m_ui->m_sensorTypeComboBox->itemText(idx).toStdString();
258  algoInputParams.m_hiResRasterBandsSRFs = getSRFMap(st, stName);
259 
260  //algoInputParams.m_hiResRasterBandSensor = (te::rp::srf::SensorType)m_ui->m_sensorTypeComboBox->itemData(idx).toInt();
261 
262  //wavelet
263  idx = m_ui->m_waveletComboBox->currentIndex();
264  algoInputParams.m_waveletFilterType = (te::rp::WaveletAtrousFilterType)m_ui->m_waveletComboBox->itemData(idx).toInt();
265  algoInputParams.m_hiResRasterWaveletLevels = (unsigned int)m_ui->m_waveletLevelsSpinBox->value();
266 
267  return algoInputParams;
268 }
269 
271 {
273 
274  return algoOutputParams;
275 }
276 
278 {
279  //start scatter
280  if(!m_scatterHighRes)
281  {
282  m_scatterHighRes = new te::qt::widgets::Scatter();
283  m_scatterChartHighRes = new te::qt::widgets::ScatterChart(m_scatterHighRes);
284  m_scatterChartHighRes->setPen(Qt::blue);
285  m_scatterChartHighRes->setSymbol(0);
286  m_scatterChartHighRes->setStyle(QwtPlotCurve::Lines);
287  m_scatterChartHighRes->attach(m_chartDisplay);
288  m_scatterChartHighRes->setTitle(tr("High Resolution"));
289  }
290 
291  te::rp::srf::SensorType st = (te::rp::srf::SensorType)m_ui->m_sensorTypeComboBox->itemData(idx).toInt();
292  std::string stName = m_ui->m_sensorTypeComboBox->itemText(idx).toStdString();
293 
294  std::map<double, double> srf = getSRFMap(st, stName);
295  std::map<double, double>::iterator it;
296 
297  //plot model curve
298  std::vector<double> wavelengthX;
299  std::vector<double> reflectanceY;
300 
301  for(it = srf.begin(); it != srf.end(); ++it)
302  {
303  wavelengthX.push_back(it->first);
304  reflectanceY.push_back(it->second);
305  }
306 
307  m_scatterHighRes->setXValues(wavelengthX);
308  m_scatterHighRes->setYValues(reflectanceY);
309  m_scatterHighRes->calculateMinMaxValues();
310  m_scatterChartHighRes->setData();
311 
312  //replot the chart display
313  m_chartDisplay->replot();
314  m_chartDisplay->updateLayout();
315 }
316 
318 {
319  QComboBox* cmbBox = dynamic_cast<QComboBox*>(sender());
320  if(!cmbBox)
321  return;
322 
323  int row = m_comboMap[cmbBox];
324 
325  te::qt::widgets::Scatter* scatter = m_scatterLowResVec[row];
326  te::qt::widgets::ScatterChart* scatterChart = m_scatterChartLowResVec[row];
327 
328  //start scatter
329  if(!scatter)
330  {
331  scatter = new te::qt::widgets::Scatter();
332  scatterChart = new te::qt::widgets::ScatterChart(scatter);
333 
334  //color
335  QColor c(te::se::GenerateRandomColor().c_str());
336  scatterChart->setPen(c);
337 
338  scatterChart->setSymbol(0);
339  scatterChart->setStyle(QwtPlotCurve::Lines);
340  scatterChart->attach(m_chartDisplay);
341 
342  //title
343  QString title(tr("Low Resolution - Band "));
344  title.append(QString::number(row));
345  scatterChart->setTitle(title);
346 
347  m_scatterLowResVec[row] = scatter;
348  m_scatterChartLowResVec[row] = scatterChart;
349  }
350 
351  te::rp::srf::SensorType st = (te::rp::srf::SensorType)cmbBox->itemData(idx).toInt();
352  std::string stName = cmbBox->itemText(idx).toStdString();
353 
354  std::map<double, double> srf = getSRFMap(st, stName);
355  std::map<double, double>::iterator it;
356 
357  //plot model curve
358  std::vector<double> wavelengthX;
359  std::vector<double> reflectanceY;
360 
361  for(it = srf.begin(); it != srf.end(); ++it)
362  {
363  wavelengthX.push_back(it->first);
364  reflectanceY.push_back(it->second);
365  }
366 
367  scatter->setXValues(wavelengthX);
368  scatter->setYValues(reflectanceY);
369  scatter->calculateMinMaxValues();
370  scatterChart->setData();
371 
372  //replot the chart display
373  m_chartDisplay->replot();
374  m_chartDisplay->updateLayout();
375 }
376 
378 {
379  QString fileName = QFileDialog::getOpenFileName(this, tr("Open Spectral Response Function File"), "", tr("CSV Files (*.csv *.CSV)"));
380 
381  if(fileName.isEmpty())
382  return;
383 
384  int idx = m_ui->m_sensorTypeComboBox->count();
385  m_ui->m_sensorTypeComboBox->addItem(fileName, QVariant(-1));
386  m_ui->m_sensorTypeComboBox->setCurrentIndex(idx);
387  onHighResSensorTypeActivated(idx);
388 }
389 
391 {
392  QToolButton* button = dynamic_cast<QToolButton*>(sender());
393  if(!button)
394  return;
395 
396  int row = m_buttonMap[button];
397 
398  QComboBox* combo = (QComboBox*)m_ui->m_wisperTableWidget->cellWidget(row, 2);
399 
400  if(!combo)
401  return;
402 
403  QString fileName = QFileDialog::getOpenFileName(this, tr("Open Spectral Response Function File"), "", tr("CSV Files (*.csv *.CSV)"));
404 
405  if(fileName.isEmpty())
406  return;
407 
408  int idx = combo->count();
409  combo->addItem(fileName, QVariant(-1));
410  combo->setCurrentIndex(idx);
411 }
412 
414 {
415  m_ui->m_fusionTypeComboBox->clear();
416 
417  m_ui->m_fusionTypeComboBox->addItem(tr("IHS"), FUSION_IHS);
418  m_ui->m_fusionTypeComboBox->addItem(tr("PCA"), FUSION_PCA);
419  m_ui->m_fusionTypeComboBox->addItem(tr("WISPER"), FUSION_WISPER);
420 
421  m_ui->m_interpolatorComboBox->clear();
422 
423  m_ui->m_interpolatorComboBox->addItem(tr("Nearest Neighbor"), te::rst::NearestNeighbor);
424  m_ui->m_interpolatorComboBox->addItem(tr("Bilinear"), te::rst::Bilinear);
425  m_ui->m_interpolatorComboBox->addItem(tr("Bicubic"), te::rst::Bicubic);
426 }
427 
429 {
430  combo->clear();
431 
432  combo->addItem("CBERS 2B Band 1", QVariant(te::rp::srf::CBERS2BCCDB1Sensor));
433  combo->addItem("CBERS 2B Band 2", QVariant(te::rp::srf::CBERS2BCCDB2Sensor));
434  combo->addItem("CBERS 2B Band 3", QVariant(te::rp::srf::CBERS2BCCDB3Sensor));
435  combo->addItem("CBERS 2B Band 4", QVariant(te::rp::srf::CBERS2BCCDB4Sensor));
436  combo->addItem("CBERS 2B Band 5", QVariant(te::rp::srf::CBERS2BCCDB5PANSensor));
437 
438  combo->addItem("CBERS 4 MUX Band 5", QVariant(te::rp::srf::CBERS4MUXB5Sensor));
439  combo->addItem("CBERS 4 MUX Band 6", QVariant(te::rp::srf::CBERS4MUXB6Sensor));
440  combo->addItem("CBERS 4 MUX Band 7", QVariant(te::rp::srf::CBERS4MUXB7Sensor));
441  combo->addItem("CBERS 4 MUX Band 8", QVariant(te::rp::srf::CBERS4MUXB8Sensor));
442 
443 
444  combo->addItem("LANDSAT 8 OLI Band 1", QVariant(te::rp::srf::LANDSAT8OLIB1Sensor));
445  combo->addItem("LANDSAT 8 OLI Band 2", QVariant(te::rp::srf::LANDSAT8OLIB2Sensor));
446  combo->addItem("LANDSAT 8 OLI Band 3", QVariant(te::rp::srf::LANDSAT8OLIB3Sensor));
447  combo->addItem("LANDSAT 8 OLI Band 4", QVariant(te::rp::srf::LANDSAT8OLIB4Sensor));
448  combo->addItem("LANDSAT 8 OLI Band 5", QVariant(te::rp::srf::LANDSAT8OLIB5Sensor));
449  combo->addItem("LANDSAT 8 OLI Band 6", QVariant(te::rp::srf::LANDSAT8OLIB6Sensor));
450  combo->addItem("LANDSAT 8 OLI Band 7", QVariant(te::rp::srf::LANDSAT8OLIB7Sensor));
451  combo->addItem("LANDSAT 8 OLI Band 8", QVariant(te::rp::srf::LANDSAT8OLIB8Sensor));
452  combo->addItem("LANDSAT 8 OLI Band 9", QVariant(te::rp::srf::LANDSAT8OLIB9Sensor));
453  combo->addItem("LANDSAT 8 OLI Band 10", QVariant(te::rp::srf::LANDSAT8OLIB10Sensor));
454  combo->addItem("LANDSAT 8 OLI Band 11", QVariant(te::rp::srf::LANDSAT8OLIB11Sensor));
455 
456  combo->addItem("LANDSAT 7 ETM+ Band 1", QVariant(te::rp::srf::LANDSAT7ETMB1Sensor));
457  combo->addItem("LANDSAT 7 ETM+ Band 2", QVariant(te::rp::srf::LANDSAT7ETMB2Sensor));
458  combo->addItem("LANDSAT 7 ETM+ Band 3", QVariant(te::rp::srf::LANDSAT7ETMB3Sensor));
459  combo->addItem("LANDSAT 7 ETM+ Band 4", QVariant(te::rp::srf::LANDSAT7ETMB4Sensor));
460  combo->addItem("LANDSAT 7 ETM+ Band 5", QVariant(te::rp::srf::LANDSAT7ETMB5Sensor));
461  combo->addItem("LANDSAT 7 ETM+ Band 7", QVariant(te::rp::srf::LANDSAT7ETMB7Sensor));
462  combo->addItem("LANDSAT 7 ETM+ Band 8 PAN", QVariant(te::rp::srf::LANDSAT7ETMB8PANSensor));
463 }
464 
466 {
467  m_ui->m_waveletComboBox->clear();
468 
469  m_ui->m_waveletComboBox->addItem(tr("Spline"), te::rp::B3SplineWAFilter);
470  m_ui->m_waveletComboBox->addItem(tr("Triangle"), te::rp::TriangleWAFilter);
471  m_ui->m_waveletComboBox->addItem(tr("Invalid"), te::rp::InvalidWAFilter);
472 }
473 
475 {
476  m_ui->m_ihsRComboBox->clear();
477  m_ui->m_ihsGComboBox->clear();
478  m_ui->m_ihsBComboBox->clear();
479  m_ui->m_listWidget->clear();
480  m_ui->m_wisperTableWidget->setRowCount(0);
481 
482  m_comboMap.clear();
483 
484  assert(m_layerLower.get());
485 
486  //get input raster
487  std::auto_ptr<te::da::DataSet> ds = m_layerLower->getData();
488 
489  if(ds.get())
490  {
491  std::size_t rpos = te::da::GetFirstPropertyPos(ds.get(), te::dt::RASTER_TYPE);
492 
493  std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
494 
495  if(inputRst.get())
496  {
497  for(unsigned int i = 0; i < inputRst->getNumberOfBands(); ++i)
498  {
499  m_ui->m_ihsRComboBox->addItem(QString::number(i));
500  m_ui->m_ihsGComboBox->addItem(QString::number(i));
501  m_ui->m_ihsBComboBox->addItem(QString::number(i));
502  m_ui->m_listWidget->addItem(QString::number(i));
503 
504  //wisper table
505  int newrow = m_ui->m_wisperTableWidget->rowCount();
506  m_ui->m_wisperTableWidget->insertRow(newrow);
507 
508  QString bName(tr("Band "));
509  bName.append(QString::number(i));
510 
511  QTableWidgetItem* itemBand = new QTableWidgetItem(bName);
512  itemBand->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
513  itemBand->setCheckState(Qt::Checked);
514  m_ui->m_wisperTableWidget->setItem(newrow, 0, itemBand);
515 
516  //csv toolbutton
517  QToolButton* button = new QToolButton(this);
518  button->setText("...");
519  button->setToolTip(tr("Open Spectral Response Function File..."));
520  button->resize(16,16);
521 
522  m_ui->m_wisperTableWidget->setCellWidget(newrow, 1, button);
523 
524  connect(button, SIGNAL(clicked()), this, SLOT(onLowCsvToolButtonClicked()));
525 
526  m_buttonMap.insert(std::map<QToolButton*, int>::value_type(button, (int)i));
527 
528  //combo
529  QComboBox* cmbBox = new QComboBox(this);
530  fillSensorTypes(cmbBox);
531  m_ui->m_wisperTableWidget->setCellWidget(newrow, 2, cmbBox);
532 
533  connect(cmbBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLowResSensorTypeActivated(int)));
534 
535  m_comboMap.insert(std::map<QComboBox*, int>::value_type(cmbBox, (int)i));
536  }
537 
538  m_scatterLowResVec.resize(inputRst->getNumberOfBands(), 0);
539  m_scatterChartLowResVec.resize(inputRst->getNumberOfBands(), 0);
540  }
541  }
542 
543  m_ui->m_wisperTableWidget->resizeColumnsToContents();
544 }
545 
547 {
548  m_ui->m_bandComboBox_IHS->clear();
549  m_ui->m_bandComboBox_PCA->clear();
550  m_ui->m_bandComboBox_Wisper->clear();
551 
552  assert(m_layerHigher.get());
553 
554  //get input raster
555  std::auto_ptr<te::da::DataSet> ds = m_layerHigher->getData();
556 
557  if(ds.get())
558  {
559  std::size_t rpos = te::da::GetFirstPropertyPos(ds.get(), te::dt::RASTER_TYPE);
560 
561  std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
562 
563  if(inputRst.get())
564  {
565  for(unsigned int i = 0; i < inputRst->getNumberOfBands(); ++i)
566  {
567  m_ui->m_bandComboBox_IHS->addItem(QString::number(i));
568  m_ui->m_bandComboBox_PCA->addItem(QString::number(i));
569  m_ui->m_bandComboBox_Wisper->addItem(QString::number(i));
570  }
571  }
572  }
573 }
574 
575 std::map<double, double> te::qt::widgets::FusionWizardPage::getSRFMap(te::rp::srf::SensorType st, std::string stName)
576 {
577  std::map<double, double> srfMap;
578 
579  if(st == -1) //from csv file
580  {
581  std::ifstream file(stName.c_str());
582 
583  if(file.is_open())
584  {
585  //create boost tokenizer
586  std::string buffer;
587 
588  //get header line (ignore)
589  std::getline(file, buffer);
590 
591  while(std::getline(file, buffer))
592  {
593  std::vector<std::string> line;
594 
595  te::common::Tokenize(buffer, line, ",");
596 
597  if(line.size() >=2)
598  {
599  double wavelength = atof(line[0].c_str());
600  double response = atof(line[1].c_str());
601 
602  srfMap.insert(std::map<double, double>::value_type(wavelength, response));
603  }
604  }
605  }
606  }
607  else if(st != te::rp::srf::InvalidSensor) //hardcode defined
608  {
609  te::rp::srf::getSRF(st, srfMap);
610  }
611 
612  return srfMap;
613 }
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: PCAFusion.h:70
te::rp::IHSFusion::InputParameters getInputIHSParams()
te::rp::WisperFusion::OutputParameters getOutputWisperParams()
Near neighborhood interpolation method.
Definition: Enums.h:95
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: WisperFusion.h:87
void getSRF(const SensorType &sensor, ContainerT &container)
Returns a Spectral Response Function from the given sensor.
te::qt::widgets::ChartDisplay * m_chartDisplay
Spline filter type.
Definition: Functions.h:77
IHSFusion output parameters.
Definition: IHSFusion.h:108
Triangle filter type.
Definition: Functions.h:78
IHSFusion input parameters.
Definition: IHSFusion.h:64
PCAFusion output parameters.
Definition: PCAFusion.h:96
unsigned int m_hiResRasterWaveletLevels
The number of wavelet decomposition levels to use (0-automatically found, default:0).
Definition: WisperFusion.h:85
unsigned int m_lowResRasterRedBandIndex
The low-resolution raster red band index (default:0).
Definition: IHSFusion.h:70
std::map< double, double > getSRFMap(te::rp::srf::SensorType st, std::string stName)
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
InterpolationMethod Method
Allowed interpolation methods.
Definition: Interpolator.h:62
WisperFusion output parameters.
Definition: WisperFusion.h:117
te::rp::PCAFusion::OutputParameters getOutputPCAParams()
void setLower(te::map::AbstractLayerPtr layer)
This method is used to set the selected layer for classifier operation.
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: PCAFusion.h:74
SensorType
Satellite sensors.
void setYValues(std::vector< double > yValues)
It sets the values of the Y axis.
Definition: Scatter.cpp:157
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: IHSFusion.h:78
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
It tokenizes a given string with a delimiter of your own choice.
Definition: StringUtils.h:216
This file defines a class for a Fusion Wizard page.
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: WisperFusion.h:79
A class to represent a scatter.
Definition: Scatter.h:51
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: WisperFusion.h:89
WisperFusion input parameters.
Definition: WisperFusion.h:65
te::rp::WisperFusion::InputParameters getInputWisperParams()
std::auto_ptr< Ui::FusionWizardPageForm > m_ui
WaveletAtrousFilterType
Wavelet Atrous Filter types.
Definition: Functions.h:74
std::vector< std::map< double, double > > m_lowResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for each low resolution band (The wav...
Definition: WisperFusion.h:75
A class to represent a chart display.
Definition: ChartDisplay.h:65
std::vector< unsigned int > m_lowResRasterBands
Bands to processe from the low resolution raster.
Definition: WisperFusion.h:71
unsigned int m_lowResRasterBlueBandIndex
The low-resolution raster blue band index (default:2).
Definition: IHSFusion.h:74
te::rp::IHSFusion::OutputParameters getOutputIHSParams()
A class to represent a scatter chart.
Definition: ScatterChart.h:55
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: IHSFusion.h:80
Bicubic interpolation method.
Definition: Enums.h:97
Invalid filter type.
Definition: Functions.h:76
std::vector< unsigned int > m_lowResRasterBands
The low-resolution raster band indexes.
Definition: PCAFusion.h:64
void fillSensorTypes(QComboBox *combo)
void setHigher(te::map::AbstractLayerPtr layer)
This method is used to set the selected layer for classifier operation.
void setXValues(std::vector< double > xValues)
It sets the values of the X axis.
Definition: Scatter.cpp:142
PCAFusion input parameters.
Definition: PCAFusion.h:58
std::map< double, double > m_hiResRasterBandsSRFs
An optional vector of user supplied Spectral Response Functions for the high resolution band (The wav...
Definition: WisperFusion.h:83
void calculateMinMaxValues()
Calculates the minimum and maximum values for both the X and Y axis.
Definition: Scatter.cpp:59
Bilinear interpolation method.
Definition: Enums.h:96
TESEEXPORT std::string GenerateRandomColor()
Creates a random RGB color encoded using two hexadecimal digits per primary-color component prefixed ...
Definition: Utils.cpp:394
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Definition: Utils.cpp:481
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: IHSFusion.h:82
unsigned int m_lowResRasterGreenBandIndex
The low-resolution raster green band index (default:1).
Definition: IHSFusion.h:72
unsigned int m_highResRasterBand
Band to process from the high-resolution raster.
Definition: PCAFusion.h:68
te::rp::PCAFusion::InputParameters getInputPCAParams()
te::rp::WaveletAtrousFilterType m_waveletFilterType
The wavelet filter type to use (default: TriangleWAFilter);.
Definition: WisperFusion.h:91