Vespucci  1.0.0
metaanalysisdialog.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 "metaanalysisdialog.h"
21 #include "ui_metaanalysisdialog.h"
25 #include "GUI/Analysis/plsdialog.h"
28 #include "GUI/Analysis/vcadialog.h"
30 
32  QSharedPointer<VespucciWorkspace> ws,
33  const QStringList &data_keys) :
34  QDialog(parent),
35  ui(new Ui::MetaAnalysisDialog),
36  workspace_(ws),
37  data_keys_(data_keys)
38 {
39  ui->setupUi(this);
40 }
41 
43 {
44  delete ui;
45  delete matrix_selection_dialog_;//should be deleted anyway?
46 }
47 
48 void MetaAnalysisDialog::on_buttonBox_accepted()
49 {
50  QString analysis_description = ui->typeComboBox->currentText();
51  bool transpose = ui->transposeCheckBox->isChecked();
52  QSharedPointer<MatrixAnalyzer> analyzer(new MatrixAnalyzer(workspace_, data_keys_, transpose));
53 
54  try{
55  if (analysis_description == "Univariate Analysis"){
56  UnivariateDialog *dialog = new UnivariateDialog(this, workspace_, analyzer);
57  dialog->setAttribute(Qt::WA_DeleteOnClose);
58  dialog->show();
59  }
60  else if (analysis_description == "Band Ratio Analysis"){
61  BandRatioDialog *dialog = new BandRatioDialog(this, workspace_, analyzer);
62  dialog->setAttribute(Qt::WA_DeleteOnClose);
63  dialog->show();
64  }
65  else if (analysis_description == "Principal Component Analysis"){
66  PrincipalComponentsDialog *dialog = new PrincipalComponentsDialog(this, workspace_, analyzer);
67  dialog->setAttribute(Qt::WA_DeleteOnClose);
68  dialog->show();
69  }
70  else if (analysis_description == "Principal Component Analysis (mlpack)"){
71  PrincipalComponentsDialog *dialog = new PrincipalComponentsDialog(this, workspace_, analyzer);
72  dialog->setAttribute(Qt::WA_DeleteOnClose);
73  dialog->show();
74  }
75  else if (analysis_description == "Vertex Component Analysis"){
76  VCADialog *dialog = new VCADialog(this, workspace_, analyzer);
77  dialog->setAttribute(Qt::WA_DeleteOnClose);
78  dialog->show();
79  }
80  else if (analysis_description == "Partial Least Squares (Classification)"){
81  PLSDialog *dialog = new PLSDialog(this, workspace_, analyzer);
82  dialog->setAttribute(Qt::WA_DeleteOnClose);
83  dialog->show();
84  }
85  else if (analysis_description == "k-Means Clustering"){
86  KMeansDialog *dialog = new KMeansDialog(this, workspace_, analyzer);
87  dialog->setAttribute(Qt::WA_DeleteOnClose);
88  dialog->show();
89  }
90  else if (analysis_description == "Hierarchical Clustering"){
91  AHCADialog *dialog = new AHCADialog(this, workspace_, analyzer);
92  dialog->setAttribute(Qt::WA_DeleteOnClose);
93  dialog->show();
94  }
95  }catch (exception e){
96  workspace_->main_window()->DisplayExceptionWarning(e);
97  }
98 
99  close();
100 }
101 
102 void MetaAnalysisDialog::on_buttonBox_rejected()
103 {
104  close();
105 }
MetaAnalysisDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, const QStringList &data_keys)
The BandRatioDialog class The dialog that allows the user to create a band-ratio map.
Definition: ahcadialog.h:26
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