Vespucci  1.0.0
multianalysisdialog.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2014-2016 Wright State University - All Rights Reserved
3  Daniel P. Foose - Maintainer/Lead Developer
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #include "multianalysisdialog.h"
21 #include "ui_multianalysisdialog.h"
24 #include "GUI/Analysis/plsdialog.h"
27 #include "GUI/Analysis/vcadialog.h"
30 
31 MultiAnalysisDialog::MultiAnalysisDialog(QWidget *parent, QSharedPointer<VespucciWorkspace> ws) :
32  QDialog(parent),
33  ui(new Ui::MultiAnalysisDialog),
34  workspace_(ws)
35 {
36  ui->setupUi(this);
37  ui->datasetListWidget->addItems(workspace_->dataset_names());
38 }
39 
41 {
42  delete ui;
43 }
44 
45 void MultiAnalysisDialog::on_buttonBox_accepted()
46 {
47  QList<QListWidgetItem*> selected_items = ui->datasetListWidget->selectedItems();
48  QStringList dataset_keys;
49  for (auto item: selected_items) dataset_keys.append(item->text());
50  QString analysis_description = ui->typeComboBox->currentText();
51  QSharedPointer<MultiAnalyzer> analyzer(new MultiAnalyzer(workspace_, dataset_keys));
52 
53  try{
54  if (analysis_description == "Univariate Analysis"){
55  UnivariateDialog *dialog = new UnivariateDialog(this, workspace_, analyzer);
56  dialog->setAttribute(Qt::WA_DeleteOnClose);
57  dialog->show();
58  }
59  else if (analysis_description == "Band Ratio Analysis"){
60  BandRatioDialog *dialog = new BandRatioDialog(this, workspace_, analyzer);
61  dialog->setAttribute(Qt::WA_DeleteOnClose);
62  dialog->show();
63  }
64  else if (analysis_description == "Principal Component Analysis"){
65  PrincipalComponentsDialog *dialog = new PrincipalComponentsDialog(this, workspace_, analyzer);
66  dialog->setAttribute(Qt::WA_DeleteOnClose);
67  dialog->show();
68  }
69  else if (analysis_description == "Principal Component Analysis (mlpack)"){
70  PrincipalComponentsDialog *dialog = new PrincipalComponentsDialog(this, workspace_, analyzer);
71  dialog->setAttribute(Qt::WA_DeleteOnClose);
72  dialog->show();
73  }
74  else if (analysis_description == "Vertex Component Analysis"){
75  VCADialog *dialog = new VCADialog(this, workspace_, analyzer);
76  dialog->setAttribute(Qt::WA_DeleteOnClose);
77  dialog->show();
78  }
79  else if (analysis_description == "Partial Least Squares (Classification)"){
80  PLSDialog *dialog = new PLSDialog(this, workspace_, analyzer);
81  dialog->setAttribute(Qt::WA_DeleteOnClose);
82  dialog->show();
83  }
84  else if (analysis_description == "k-Means Clustering"){
85  KMeansDialog *dialog = new KMeansDialog(this, workspace_, analyzer);
86  dialog->setAttribute(Qt::WA_DeleteOnClose);
87  dialog->show();
88  }
89  else if (analysis_description == "Hierarchical Clustering"){
90  AHCADialog *dialog = new AHCADialog(this, workspace_, analyzer);
91  dialog->setAttribute(Qt::WA_DeleteOnClose);
92  dialog->show();
93  }
94  else if (analysis_description == "SNV Normalization"){
95  bool ok;
96  double offset = QInputDialog::getDouble(this, "Enter Offset", "Offset",
97  0, -2147483647, 2147483647, 4, &ok);
98 
99  if (ok){
100  analyzer->SNVNormalize(offset);
101  }
102  }
103  else if (analysis_description == "QUIC-SVD Denoise"){
104  bool ok;
105  double epsilon = QInputDialog::getDouble(this, "Enter Error Tolerance Fraction",
106  "Fraction", 0.03, 0.00001, 0.99999, 4, &ok);
107  if (ok){
108  analyzer->QUIC_SVD(epsilon);
109  }
110  }
111  }catch(exception e){
112  workspace_->main_window()->DisplayExceptionWarning(e);
113  }
114 }
The MultiAnalyzer class This class handles the execution of multivariate analysis across multiple dat...
Definition: multianalyzer.h:33
The BandRatioDialog class The dialog that allows the user to create a band-ratio map.
Definition: ahcadialog.h:26
MultiAnalysisDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws)
The PLSDialog class Dialog that allows the user to perform PLS determinant analysis.
Definition: plsdialog.h:33
The UnivariateDialog class Class allowing user to create univariate images.
The PrincipalComponentsDialog class Dialog for performing principal components analysis.
The KMeansDialog class Allows the user to create a k-means clustering map.
Definition: kmeansdialog.h:33
The VCADialog class A dialog that allows the user to perform vertex components analysis.
Definition: vcadialog.h:32