All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ContrastWizardPage.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/ContrastWizardPage.cpp
22 
23  \brief This file defines a class for a Contrast 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/Raster.h"
31 #include "ContrastWizardPage.h"
32 #include "RasterHistogramWidget.h"
33 #include "RasterNavigatorWidget.h"
34 #include "ui_ContrastWizardPageForm.h"
35 
36 // Qt
37 #include <QGridLayout>
38 #include <QMessageBox>
39 
40 // Boost
41 #include <boost/lexical_cast.hpp>
42 
43 //STL
44 #include <memory>
45 
47  : QWizardPage(parent),
48  m_ui(new Ui::ContrastWizardPageForm),
49  m_layer(0)
50 {
51 // setup controls
52  m_ui->setupUi(this);
53 
55 
56  //build preview
57  QGridLayout* displayLayout = new QGridLayout(m_ui->m_displayWidget);
58  m_navigator.reset(new te::qt::widgets::RasterNavigatorWidget(m_ui->m_displayWidget));
59  m_navigator->showAsPreview(true);
60  m_navigator->hideColorCompositionTool(true);
61  displayLayout->addWidget(m_navigator.get());
62  displayLayout->setContentsMargins(0,0,0,0);
63 
64  //build histogram
65  QGridLayout* histogramLayout = new QGridLayout(m_ui->m_histWidget);
67  histogramLayout->addWidget(m_histogramWidget.get());
68  histogramLayout->setContentsMargins(0,0,0,0);
69 
70 //connects
71  connect(m_ui->m_contrastTypeComboBox, SIGNAL(activated(int)), this, SLOT(onContrastTypeComboBoxActivated(int)));
72  connect(m_ui->m_bandTableWidget, SIGNAL(cellClicked(int, int)), this, SLOT(onCellClicked(int, int)));
73  connect(m_navigator.get(), SIGNAL(mapDisplayExtentChanged()), this, SLOT(onPreviewChanged()));
74  connect(m_navigator.get(), SIGNAL(previewClicked()), this, SLOT(apply()));
75 
76  connect(m_histogramWidget.get(), SIGNAL(minValueSelected(int, int)), this, SLOT(onMinValueSelected(int, int)));
77  connect(m_histogramWidget.get(), SIGNAL(maxValueSelected(int, int)), this, SLOT(onMaxValueSelected(int, int)));
78 
79 //configure page
80  this->setTitle(tr("Contrast"));
81  this->setSubTitle(tr("Select the type of contrast and set their specific parameters."));
82 
83  //onContrastTypeComboBoxActivated(m_ui->m_contrastTypeComboBox->currentIndex());
84 }
85 
87 {
88 }
89 
91 {
92  int nBands = m_ui->m_bandTableWidget->rowCount();
93 
94  for(int i = 0; i < nBands; ++i)
95  {
96  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
97 
98  if(item->checkState() == Qt::Checked)
99  {
100  return true;
101  }
102  }
103 
104  return false;
105 }
106 
108 {
109  m_layer = layer;
110 
111  std::list<te::map::AbstractLayerPtr> list;
112 
113  list.push_back(m_layer);
114 
115  m_navigator->set(m_layer, true);
116 
117  listBands();
118 }
119 
121 {
122  return m_layer;
123 }
124 
126 {
127  //get contrast type
128  int index = m_ui->m_contrastTypeComboBox->currentIndex();
129  int contrastType = m_ui->m_contrastTypeComboBox->itemData(index).toInt();
130  int nBands = m_ui->m_bandTableWidget->rowCount();
131 
132  te::rp::Contrast::InputParameters algoInputParams;
133 
135  {
137 
138  for(int i = 0; i < nBands; ++i)
139  {
140  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
141 
142  if(item->checkState() == Qt::Checked)
143  {
144  QString valueMin = m_ui->m_bandTableWidget->item(i, 1)->text();
145  algoInputParams.m_lCMinInput.push_back(valueMin.toDouble());
146 
147  QString valueMax = m_ui->m_bandTableWidget->item(i, 2)->text();
148  algoInputParams.m_lCMaxInput.push_back(valueMax.toDouble());
149  }
150  }
151  }
153  {
155 
156  for(int i = 0; i < nBands; ++i)
157  {
158  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
159 
160  if(item->checkState() == Qt::Checked)
161  {
162  QString valueMax = m_ui->m_bandTableWidget->item(i, 1)->text();
163  algoInputParams.m_hECMaxInput.push_back(valueMax.toDouble());
164  }
165  }
166  }
168  {
170 
171  for(int i = 0; i < nBands; ++i)
172  {
173  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
174 
175  if(item->checkState() == Qt::Checked)
176  {
177  QString valueMean = m_ui->m_bandTableWidget->item(i, 1)->text();
178  algoInputParams.m_sMASCMeanInput.push_back(valueMean.toDouble());
179 
180  QString valueStdDev = m_ui->m_bandTableWidget->item(i, 2)->text();
181  algoInputParams.m_sMASCStdInput.push_back(valueStdDev.toDouble());
182  }
183  }
184  }
186  {
188 
189  for(int i = 0; i < nBands; ++i)
190  {
191  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
192 
193  if(item->checkState() == Qt::Checked)
194  {
195  QString valueMin = m_ui->m_bandTableWidget->item(i, 1)->text();
196  algoInputParams.m_squareCMinInput.push_back(valueMin.toDouble());
197 
198  QString valueMax = m_ui->m_bandTableWidget->item(i, 2)->text();
199  algoInputParams.m_squareCMaxInput.push_back(valueMax.toDouble());
200  }
201  }
202  }
204  {
206 
207  for(int i = 0; i < nBands; ++i)
208  {
209  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
210 
211  if(item->checkState() == Qt::Checked)
212  {
213  QString valueMin = m_ui->m_bandTableWidget->item(i, 1)->text();
214  algoInputParams.m_squareRootCMinInput.push_back(valueMin.toDouble());
215 
216  QString valueMax = m_ui->m_bandTableWidget->item(i, 2)->text();
217  algoInputParams.m_squareRootCMaxInput.push_back(valueMax.toDouble());
218  }
219  }
220  }
221  else if(contrastType == te::rp::Contrast::InputParameters::LogContrastT)
222  {
224 
225  for(int i = 0; i < nBands; ++i)
226  {
227  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
228 
229  if(item->checkState() == Qt::Checked)
230  {
231  QString valueMin = m_ui->m_bandTableWidget->item(i, 1)->text();
232  algoInputParams.m_logCMinInput.push_back(valueMin.toDouble());
233 
234  QString valueMax = m_ui->m_bandTableWidget->item(i, 2)->text();
235  algoInputParams.m_logCMaxInput.push_back(valueMax.toDouble());
236  }
237  }
238  }
240  {
242  }
243 
244  for(int i = 0; i < nBands; ++i)
245  {
246  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
247 
248  if(item->checkState() == Qt::Checked)
249  {
250  algoInputParams.m_inRasterBands.push_back(i);
251  }
252  }
253 
254  return algoInputParams;
255 }
256 
258 {
259  QApplication::setOverrideCursor(Qt::WaitCursor);
260 
261  //get preview raster
262  te::rst::Raster* inputRst = m_navigator->getExtentRaster();
263 
264  //set contrast parameters
265  te::rp::Contrast::InputParameters algoInputParams = getInputParams();
266 
267  algoInputParams.m_inRasterPtr = inputRst;
268 
269  te::rp::Contrast::OutputParameters algoOutputParams;
270 
271  std::map<std::string, std::string> rinfo;
272  rinfo["MEM_RASTER_NROWS"] = boost::lexical_cast<std::string>(inputRst->getNumberOfRows());
273  rinfo["MEM_RASTER_NCOLS"] = boost::lexical_cast<std::string>(inputRst->getNumberOfColumns());
274  rinfo["MEM_RASTER_DATATYPE"] = boost::lexical_cast<std::string>(inputRst->getBandDataType(0));
275  rinfo["MEM_RASTER_NBANDS"] = boost::lexical_cast<std::string>(inputRst->getNumberOfBands());
276 
277  algoOutputParams.m_createdOutRasterDSType = "MEM";
278  algoOutputParams.m_createdOutRasterInfo = rinfo;
279 
280  //run contrast
281  te::rp::Contrast algorithmInstance;
282 
283  try
284  {
285  if(algorithmInstance.initialize(algoInputParams))
286  {
287  if(algorithmInstance.execute(algoOutputParams))
288  {
289  m_navigator->drawRaster(algoOutputParams.m_outRasterPtr);
290 
291  //update histogram and replot
292  m_histogramWidget->setOutputRaster(algoOutputParams.m_createdOutRasterPtr.release());
293 
294  drawHistogram();
295  }
296  }
297  }
298  catch(...)
299  {
300  QMessageBox::warning(this, tr("Warning"), tr("Constrast error."));
301  }
302 
303  QApplication::restoreOverrideCursor();
304 }
305 
307 {
308  m_ui->m_contrastTypeComboBox->clear();
309 
310  m_ui->m_contrastTypeComboBox->addItem(tr("Linear"), te::rp::Contrast::InputParameters::LinearContrastT);
311  m_ui->m_contrastTypeComboBox->addItem(tr("Histogram Equalization"), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT);
312  m_ui->m_contrastTypeComboBox->addItem(tr("Square Constrast"), te::rp::Contrast::InputParameters::SquareContrastT);
313  m_ui->m_contrastTypeComboBox->addItem(tr("Square Root Constrast"), te::rp::Contrast::InputParameters::SquareRootContrastT);
314  m_ui->m_contrastTypeComboBox->addItem(tr("Log Constrast"), te::rp::Contrast::InputParameters::LogContrastT);
315  m_ui->m_contrastTypeComboBox->addItem(tr("Mean and Standard Deviation"), te::rp::Contrast::InputParameters::MeanAndStdContrastT);
316  m_ui->m_contrastTypeComboBox->addItem(tr("Decorrelation Enhancement"), te::rp::Contrast::InputParameters::DecorrelationEnhancementT);
317 }
318 
320 {
321  assert(m_layer.get());
322 
323  //get input raster
324  std::auto_ptr<te::da::DataSet> ds = m_layer->getData();
325 
326  if(ds.get())
327  {
328  std::size_t rpos = te::da::GetFirstPropertyPos(ds.get(), te::dt::RASTER_TYPE);
329 
330  std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
331 
332  if(inputRst.get())
333  {
334  for(unsigned int i = 0; i < inputRst->getNumberOfBands(); ++i)
335  {
336  m_ui->m_bandTableWidget->setRowCount(0);
337 
338  // initializing the list of bands
339  for(unsigned b = 0 ; b < inputRst->getNumberOfBands(); b++)
340  {
341  int newrow = m_ui->m_bandTableWidget->rowCount();
342  m_ui->m_bandTableWidget->insertRow(newrow);
343 
344  QString bName(tr("Band "));
345  bName.append(QString::number(b));
346 
347  QTableWidgetItem* itemBand = new QTableWidgetItem(bName);
348  itemBand->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
349  itemBand->setCheckState(Qt::Checked);
350  m_ui->m_bandTableWidget->setItem(newrow, 0, itemBand);
351 
352  }
353  }
354  }
355  }
356 
357  m_ui->m_bandTableWidget->resizeColumnsToContents();
358 #if (QT_VERSION >= 0x050000)
359  m_ui->m_bandTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
360 #else
361  m_ui->m_bandTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
362 #endif
363 
364  onContrastTypeComboBoxActivated(m_ui->m_contrastTypeComboBox->currentIndex());
365 }
366 
368 {
369  int contrastType = m_ui->m_contrastTypeComboBox->itemData(index).toInt();
370 
375  {
376  bool reset = true;
377 
378  if(m_ui->m_bandTableWidget->horizontalHeaderItem(1) && m_ui->m_bandTableWidget->horizontalHeaderItem(1)->text() == tr("Minimum") &&
379  m_ui->m_bandTableWidget->horizontalHeaderItem(2) && m_ui->m_bandTableWidget->horizontalHeaderItem(2)->text() == tr("Maximum"))
380  reset = false;
381 
382  if(reset)
383  {
384  QStringList list;
385  list.append(tr("Band"));
386  list.append(tr("Minimum"));
387  list.append(tr("Maximum"));
388 
389  m_ui->m_bandTableWidget->setColumnCount(3);
390  m_ui->m_bandTableWidget->setHorizontalHeaderLabels(list);
391 
392  int nBands = m_ui->m_bandTableWidget->rowCount();
393 
394  for(int i = 0; i < nBands; ++i)
395  {
396  QTableWidgetItem* itemMin = new QTableWidgetItem("0");
397  itemMin->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
398  m_ui->m_bandTableWidget->setItem(i, 1, itemMin);
399 
400  QTableWidgetItem* itemMax = new QTableWidgetItem("255");
401  itemMax->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
402  m_ui->m_bandTableWidget->setItem(i, 2, itemMax);
403  }
404  }
405 
406  m_histogramWidget->setMinimumValueEnabled(true);
407  m_histogramWidget->setMaximumValueEnabled(true);
408 
409  m_histogramWidget->updateMinimumValueLabel(tr("Minimum"));
410  m_histogramWidget->updateMaximumValueLabel(tr("Maximum"));
411 
412  m_histogramWidget->updateMinimumValueLine(0, false);
413  m_histogramWidget->updateMaximumValueLine(255, false);
414 
415  m_ui->m_tipLabel->setText(tr("Use left button to set minimum value and right button to define maximum value over the histogram."));
416  }
418  {
419  QStringList list;
420  list.append(tr("Band"));
421  list.append(tr("Maximum"));
422 
423  m_ui->m_bandTableWidget->setColumnCount(2);
424  m_ui->m_bandTableWidget->setHorizontalHeaderLabels(list);
425 
426  int nBands = m_ui->m_bandTableWidget->rowCount();
427 
428  for(int i = 0; i < nBands; ++i)
429  {
430  QTableWidgetItem* itemMax = new QTableWidgetItem("255");
431  itemMax->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
432  m_ui->m_bandTableWidget->setItem(i, 1, itemMax);
433  }
434 
435  m_histogramWidget->setMinimumValueEnabled(true);
436  m_histogramWidget->setMaximumValueEnabled(false);
437 
438  m_histogramWidget->updateMinimumValueLabel(tr("Maximum"));
439 
440  m_histogramWidget->updateMinimumValueLine(255, false);
441 
442  m_ui->m_tipLabel->setText(tr("Use left button to set maximum value over the histogram."));
443  }
445  {
446  QStringList list;
447  list.append(tr("Band"));
448  list.append(tr("Mean"));
449  list.append(tr("Std Dev"));
450 
451  m_ui->m_bandTableWidget->setColumnCount(3);
452  m_ui->m_bandTableWidget->setHorizontalHeaderLabels(list);
453 
454  int nBands = m_ui->m_bandTableWidget->rowCount();
455 
456  for(int i = 0; i < nBands; ++i)
457  {
458  QTableWidgetItem* itemMean = new QTableWidgetItem("127");
459  itemMean->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
460  m_ui->m_bandTableWidget->setItem(i, 1, itemMean);
461 
462  QTableWidgetItem* itemStdDev = new QTableWidgetItem("50");
463  itemStdDev->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
464  m_ui->m_bandTableWidget->setItem(i, 2, itemStdDev);
465  }
466 
467  m_histogramWidget->setMinimumValueEnabled(true);
468  m_histogramWidget->setMaximumValueEnabled(true);
469 
470  m_histogramWidget->updateMinimumValueLabel(tr("Mean"));
471  m_histogramWidget->updateMaximumValueLabel(tr("Std Dev"));
472 
473  m_histogramWidget->updateMinimumValueLine(127, false);
474  m_histogramWidget->updateMaximumValueLine(50, false);
475 
476  m_ui->m_tipLabel->setText(tr("Use left button to set Mean value and right button to define Std Dev value over the histogram."));
477  }
479  {
480  QStringList list;
481  list.append(tr("Band"));
482 
483  m_ui->m_bandTableWidget->setColumnCount(1);
484  m_ui->m_bandTableWidget->setHorizontalHeaderLabels(list);
485 
486  m_histogramWidget->setMinimumValueEnabled(false);
487  m_histogramWidget->setMaximumValueEnabled(false);
488 
489  m_ui->m_tipLabel->setText(tr(""));
490  }
491 
492  drawHistogram();
493 
494  m_ui->m_bandTableWidget->resizeColumnsToContents();
495 #if (QT_VERSION >= 0x050000)
496  m_ui->m_bandTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
497 #else
498  m_ui->m_bandTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
499 #endif
500 }
501 
503 {
504  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(row, 0);
505 
506  if(item->checkState() == Qt::Checked)
507  drawHistogram();
508 }
509 
511 {
512  int index = m_ui->m_contrastTypeComboBox->currentIndex();
513 
514  int contrastType = m_ui->m_contrastTypeComboBox->itemData(index).toInt();
515 
520  {
521  m_ui->m_bandTableWidget->item(band, 1)->setText(QString::number(value));
522  m_ui->m_bandTableWidget->setCurrentCell(band, 1);
523 
524  m_histogramWidget->updateMinimumValueLine(value, true);
525  }
527  {
528  m_ui->m_bandTableWidget->item(band, 1)->setText(QString::number(value));
529  m_ui->m_bandTableWidget->setCurrentCell(band, 1);
530 
531  m_histogramWidget->updateMinimumValueLine(value, true);
532  }
534  {
535  m_ui->m_bandTableWidget->item(band, 1)->setText(QString::number(value));
536  m_ui->m_bandTableWidget->setCurrentCell(band, 1);
537 
538  m_histogramWidget->updateMinimumValueLine(value, true);
539  }
540  else
541  {
542  return;
543  }
544 }
545 
547 {
548  int index = m_ui->m_contrastTypeComboBox->currentIndex();
549 
550  int contrastType = m_ui->m_contrastTypeComboBox->itemData(index).toInt();
551 
556  {
557  m_ui->m_bandTableWidget->item(band, 2)->setText(QString::number(value));
558  m_ui->m_bandTableWidget->setCurrentCell(band, 2);
559 
560  m_histogramWidget->updateMaximumValueLine(value, true);
561  }
563  {
564  if(!m_ui->m_bandTableWidget->item(band, 1)->text().isEmpty())
565  {
566  double mean = m_ui->m_bandTableWidget->item(band, 1)->text().toDouble();
567 
568  double stdDev = abs(mean - value);
569 
570  m_ui->m_bandTableWidget->item(band, 2)->setText(QString::number(stdDev));
571  m_ui->m_bandTableWidget->setCurrentCell(band, 2);
572 
573  m_histogramWidget->updateMaximumValueLine(value, true);
574  }
575  }
576  else
577  {
578  return;
579  }
580 }
581 
583 {
584  te::rst::Raster* inputRst = m_navigator->getExtentRaster();
585 
586  m_histogramWidget->setInputRaster(inputRst);
587 
588  drawHistogram();
589 }
590 
592 {
593  int bandIdx = -1;
594 
595  for(int i = 0; i <= m_ui->m_bandTableWidget->currentRow(); ++i)
596  {
597  QTableWidgetItem* item = m_ui->m_bandTableWidget->item(i, 0);
598 
599  if(item->checkState() == Qt::Checked)
600  {
601  ++bandIdx;
602  }
603  }
604 
605  if(bandIdx == -1)
606  return;
607 
608  int index = m_ui->m_contrastTypeComboBox->currentIndex();
609 
610  int contrastType = m_ui->m_contrastTypeComboBox->itemData(index).toInt();
611 
616  {
617  int min = m_ui->m_bandTableWidget->item(bandIdx, 1)->text().toInt();
618  int max = m_ui->m_bandTableWidget->item(bandIdx, 2)->text().toInt();
619 
620  m_histogramWidget->updateMinimumValueLine(min, false);
621  m_histogramWidget->updateMaximumValueLine(max, false);
622  }
624  {
625  int min = m_ui->m_bandTableWidget->item(bandIdx, 1)->text().toInt();
626 
627  m_histogramWidget->updateMinimumValueLine(min, false);
628  }
630  {
631  int min = m_ui->m_bandTableWidget->item(bandIdx, 1)->text().toInt();
632  int max = m_ui->m_bandTableWidget->item(bandIdx, 2)->text().toInt();
633 
634  m_histogramWidget->updateMinimumValueLine(min, false);
635  m_histogramWidget->updateMaximumValueLine(max, false);
636  }
637 
638  m_histogramWidget->drawHistogram(bandIdx);
639 }
std::auto_ptr< te::qt::widgets::RasterHistogramWidget > m_histogramWidget
This file has the RasterHistogramWidget class.
std::vector< double > m_logCMaxInput
The contrast maximum input greyscale value of each band.
Definition: Contrast.h:146
std::vector< double > m_lCMinInput
The contrast minimum input greyscale value of each band.
Definition: Contrast.h:102
te::rst::Raster * m_outRasterPtr
A pointer to a valid initiated raster instance where the result must be written, leave NULL to create...
Definition: Contrast.h:188
void onMinValueSelected(int value, int band)
ContrastType m_type
The contrast type to be applied.
Definition: Contrast.h:87
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
Definition: Raster.cpp:213
std::vector< double > m_squareRootCMinInput
The contrast minimum input greyscale value of each band.
Definition: Contrast.h:133
std::vector< double > m_squareRootCMaxInput
The contrast maximum input greyscale value of each band.
Definition: Contrast.h:135
void set(te::map::AbstractLayerPtr layer)
This method is used to set the selected layer for contrast operation.
std::vector< double > m_logCMinInput
The contrast minimum input greyscale value of each band.
Definition: Contrast.h:144
te::rp::Contrast::InputParameters getInputParams()
void onCellClicked(int row, int column)
This class is used to define a component for viewing overlaid layers.
Contrast input parameters.
Definition: Contrast.h:65
std::auto_ptr< Ui::ContrastWizardPageForm > m_ui
An abstract class for raster data strucutures.
Definition: Raster.h:71
unsigned int getNumberOfRows() const
Returns the raster number of rows.
Definition: Raster.cpp:208
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
std::auto_ptr< te::qt::widgets::RasterNavigatorWidget > m_navigator
std::vector< unsigned int > m_inRasterBands
Bands to be processed from the input raster.
Definition: Contrast.h:91
std::vector< double > m_hECMaxInput
The contrast maximum input greyscale value of each band.
Definition: Contrast.h:113
std::vector< double > m_sMASCStdInput
The standard deviation to be applied in each band.
Definition: Contrast.h:157
std::auto_ptr< te::rst::Raster > m_createdOutRasterPtr
A pointer to the created output raster instance, or an empty pointer empty if the result must be writ...
Definition: Contrast.h:190
This file defines a class for a Contrast Wizard page.
std::vector< double > m_squareCMaxInput
The contrast maximum input greyscale value of each band.
Definition: Contrast.h:124
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
Definition: Contrast.cpp:299
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
std::vector< double > m_lCMaxInput
The contrast maximum input greyscale value of each band.
Definition: Contrast.h:104
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
Definition: Contrast.cpp:178
std::vector< double > m_sMASCMeanInput
The mean greyscale to be applied in each band.
Definition: Contrast.h:155
void onMaxValueSelected(int value, int band)
This file has the RasterNavigatorWidget class.
std::string m_createdOutRasterDSType
Output raster data source type (as described in te::raster::RasterFactory ), leave empty if the resul...
Definition: Contrast.h:194
te::rst::Raster const * m_inRasterPtr
Input raster.
Definition: Contrast.h:89
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Definition: Utils.cpp:481
Contrast output parameters.
Definition: Contrast.h:184
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::map< std::string, std::string > m_createdOutRasterInfo
The necessary information to create the raster (as described in te::raster::RasterFactory), leave empty if the result must be written to the raster pointed m_outRasterPtr.
Definition: Contrast.h:196
virtual int getBandDataType(std::size_t i) const =0
Returns the data type in a particular band (or dimension).
Contrast enhancement.
Definition: Contrast.h:57
std::vector< double > m_squareCMinInput
The contrast minimum input greyscale value of each band.
Definition: Contrast.h:122