19 #include <QMessageBox>
35 QString contrastEnchacementLimits = mySettings.value(
"/Raster/defaultContrastEnhancementLimits",
"CumulativeCut" ).toString();
36 if ( contrastEnchacementLimits ==
"MinMax" )
37 mMinMaxRadioButton->setChecked(
true );
38 else if ( contrastEnchacementLimits ==
"StdDev" )
39 mStdDevRadioButton->setChecked(
true );
43 mCumulativeCutLowerDoubleSpinBox->setValue( myLower );
44 mCumulativeCutUpperDoubleSpinBox->setValue( myUpper );
46 mStdDevSpinBox->setValue( mySettings.value(
"/Raster/defaultStandardDeviation", 2.0 ).toDouble() );
53 void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked()
57 foreach (
int myBand, mBands )
60 QgsDebugMsg( QString(
"myBand = %1" ).arg( myBand ) );
65 double myMin = std::numeric_limits<double>::quiet_NaN();
66 double myMax = std::numeric_limits<double>::quiet_NaN();
69 if ( mCurrentExtentRadioButton->isChecked() )
81 if ( mEstimateRadioButton->isChecked() )
83 mySampleSize = 250000;
91 if ( mCumulativeCutRadioButton->isChecked() )
93 double myLower = mCumulativeCutLowerDoubleSpinBox->value() / 100.0;
94 double myUpper = mCumulativeCutUpperDoubleSpinBox->value() / 100.0;
98 else if ( mMinMaxRadioButton->isChecked() )
106 else if ( mStdDevRadioButton->isChecked() )
109 double myStdDev = mStdDevSpinBox->value();
110 myMin = myRasterBandStats.
mean - ( myStdDev * myRasterBandStats.
stdDev );
111 myMax = myRasterBandStats.
mean + ( myStdDev * myRasterBandStats.
stdDev );
116 QMessageBox::warning(
this,
tr(
"No option selected" ),
tr(
"Please select an option to load min/max values." ) );
120 emit
load( myBand, myMin, myMax, origin );