2 #include "ui_booleanizedialog.h" 11 dataset_ = workspace_->GetDataset(dataset_key);
13 ui->minDoubleSpinBox->setValue(dataset_->spectra_ptr()->min());
14 ui->maxDoubleSpinBox->setValue(dataset_->spectra_ptr()->max());
24 void BooleanizeDialog::on_behaviorComboBox_currentIndexChanged(
const QString &arg1)
26 if (arg1 ==
"Set Values out of Range to Maximum (clamp)")
27 ui->oneifyCheckBox->setEnabled(
false);
29 ui->oneifyCheckBox->setEnabled(
true);
34 void BooleanizeDialog::on_buttonBox_accepted()
36 double min =
std::min(ui->minDoubleSpinBox->value(), ui->maxDoubleSpinBox->value());
37 double max =
std::max(ui->minDoubleSpinBox->value(), ui->maxDoubleSpinBox->value());
38 bool oneify = ui->oneifyCheckBox->isChecked();
40 if (ui->behaviorComboBox->currentText() ==
"Set Values out of Range to Maximum (clamp)")
41 dataset_->Clamp(min, max);
42 else if (ui->behaviorComboBox->currentText() ==
"Set Values out of Range to Zero")
43 dataset_->Booleanize(min, max,
true, oneify);
45 dataset_->Booleanize(min, max,
false, oneify);
49 void BooleanizeDialog::on_buttonBox_rejected()
VESPUCCI_EXPORT arma::uword max(arma::uword a, arma::uword b)
Vespucci::Math::max.
VESPUCCI_EXPORT arma::uword min(arma::uword a, arma::uword b)
Vespucci::Math::min.
BooleanizeDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, const QString &dataset_key)