142 QSettings settings(
"MNECPP");
144 settings.setValue(
m_sSettingsPath + QString(
"/ArtifactSettingsView/doArtifactThresholdReduction"), m_bDoArtifactThresholdReduction);
146 settings.beginGroup(
m_sSettingsPath + QString(
"/ArtifactSettingsView/artifactThresholdsFirst"));
147 QMap<QString, double>::const_iterator itrFirst = m_mapThresholdsFirst.constBegin();
148 while (itrFirst != m_mapThresholdsFirst.constEnd()) {
149 settings.setValue(itrFirst.key(), itrFirst.value());
154 settings.beginGroup(
m_sSettingsPath + QString(
"/ArtifactSettingsView/artifactThresholdsSecond"));
155 QMap<QString, int>::const_iterator itrSecond = m_mapThresholdsSecond.constBegin();
156 while (itrSecond != m_mapThresholdsSecond.constEnd()) {
157 settings.setValue(itrSecond.key(), itrSecond.value());
172 QSettings settings(
"MNECPP");
174 m_bDoArtifactThresholdReduction = settings.value(
m_sSettingsPath + QString(
"/ArtifactSettingsView/doArtifactThresholdReduction"),
false).toBool();
176 if(m_bDoArtifactThresholdReduction) {
177 m_mapThresholds[
"Active"] = 1.0;
179 m_mapThresholds[
"Active"] = 0.0;
182 m_mapThresholdsFirst[
"grad"] = 1.0;
183 m_mapThresholdsFirst[
"mag"] = 1.0;
184 m_mapThresholdsFirst[
"eeg"] = 1.0;
185 m_mapThresholdsFirst[
"ecg"] = 1.0;
186 m_mapThresholdsFirst[
"emg"] = 1.0;
187 m_mapThresholdsFirst[
"eog"] = 1.0;
189 m_mapThresholdsSecond[
"grad"] = -1;
190 m_mapThresholdsSecond[
"mag"] = -1;
191 m_mapThresholdsSecond[
"eeg"] = -1;
192 m_mapThresholdsSecond[
"ecg"] = -1;
193 m_mapThresholdsSecond[
"emg"] = -1;
194 m_mapThresholdsSecond[
"eog"] = -1;
196 settings.beginGroup(
m_sSettingsPath + QString(
"/ArtifactSettingsView/artifactThresholdsFirst"));
197 QStringList keys = settings.childKeys();
198 foreach (QString key, keys) {
199 m_mapThresholdsFirst.insert(key, settings.value(key, 1.0).toDouble());
203 settings.beginGroup(
m_sSettingsPath + QString(
"/ArtifactSettingsView/artifactThresholdsSecond"));
204 keys = settings.childKeys();
205 foreach (QString key, keys) {
206 m_mapThresholdsSecond.insert(key, settings.value(key, -1).toInt());
239 if(QLayout* layout = this->layout()) {
243 QGridLayout* pGroupBoxArtifactRejection =
new QGridLayout();
244 this->setLayout(pGroupBoxArtifactRejection);
247 if(!m_fiffChInfoList.isEmpty()) {
248 QStringList channelTypes;
251 for(
int i = 0; i < m_fiffChInfoList.size(); ++i) {
252 kind = m_fiffChInfoList.at(i).kind;
253 unit = m_fiffChInfoList.at(i).unit;
255 if(kind == FIFFV_MEG_CH && unit == FIFF_UNIT_T_M && !channelTypes.contains(
"grad")) {
256 channelTypes <<
"grad";
258 if(kind == FIFFV_MEG_CH && unit == FIFF_UNIT_T && !channelTypes.contains(
"mag")) {
259 channelTypes <<
"mag";
261 if(kind == FIFFV_EEG_CH && !channelTypes.contains(
"eeg", Qt::CaseInsensitive)) {
262 channelTypes <<
"eeg";
264 if(kind == FIFFV_EOG_CH && !channelTypes.contains(
"eog", Qt::CaseInsensitive)) {
265 channelTypes <<
"eog";
267 if(kind == FIFFV_EMG_CH && !channelTypes.contains(
"emg", Qt::CaseInsensitive)) {
268 channelTypes <<
"emg";
270 if(kind == FIFFV_ECG_CH && !channelTypes.contains(
"ecg", Qt::CaseInsensitive)) {
271 channelTypes <<
"ecg";
275 if(!channelTypes.isEmpty()) {
276 m_pArtifactRejectionCheckBox =
new QCheckBox(
"Activate artifact rejection");
277 pGroupBoxArtifactRejection->addWidget(m_pArtifactRejectionCheckBox,0,0,1,2);
278 m_pArtifactRejectionCheckBox->setChecked(m_bDoArtifactThresholdReduction);
279 connect(m_pArtifactRejectionCheckBox.data(), &QCheckBox::clicked,
280 this, &ArtifactSettingsView::onChangeArtifactThreshold);
282 for(
int i = 0; i < channelTypes.size(); ++i) {
283 QLabel* pLabel =
new QLabel(channelTypes.at(i));
284 pGroupBoxArtifactRejection->addWidget(pLabel,i+1,0);
286 QDoubleSpinBox* pDoubleSpinBox =
new QDoubleSpinBox();
287 pDoubleSpinBox->setPrefix(
"+/-");
288 pDoubleSpinBox->setMinimum(0.0);
289 pDoubleSpinBox->setMaximum(100000.0);
290 pDoubleSpinBox->setValue(m_mapThresholdsFirst[channelTypes.at(i)]);
291 pGroupBoxArtifactRejection->addWidget(pDoubleSpinBox,i+1,1);
292 connect(pDoubleSpinBox,
static_cast<void (QDoubleSpinBox::*)(
double)
>(&QDoubleSpinBox::valueChanged),
293 this, &ArtifactSettingsView::onChangeArtifactThreshold);
294 m_mapChThresholdsDoubleSpinBoxes[channelTypes.at(i)] = pDoubleSpinBox;
296 QSpinBox* pSpinBox =
new QSpinBox();
297 pSpinBox->setPrefix(
"e");
298 pSpinBox->setMaximum(0);
299 pSpinBox->setMinimum(-10000);
300 pSpinBox->setValue(m_mapThresholdsSecond[channelTypes.at(i)]);
301 pGroupBoxArtifactRejection->addWidget(pSpinBox,i+1,2);
302 connect(pSpinBox,
static_cast<void (QSpinBox::*)(
int)
>(&QSpinBox::valueChanged),
303 this, &ArtifactSettingsView::onChangeArtifactThreshold);
304 m_mapChThresholdsSpinBoxes[channelTypes.at(i)] = pSpinBox;