MNE-CPP  beta 1.0
main.cpp
1 //=============================================================================================================
37 //*************************************************************************************************************
38 //=============================================================================================================
39 // INCLUDES
40 //=============================================================================================================
41 
42 #include <disp3D/brainview.h>
43 
44 
45 //*************************************************************************************************************
46 //=============================================================================================================
47 // QT INCLUDES
48 //=============================================================================================================
49 
50 #include <QGuiApplication>
51 
52 
53 //*************************************************************************************************************
54 //=============================================================================================================
55 // USED NAMESPACES
56 //=============================================================================================================
57 
58 using namespace FSLIB;
59 using namespace DISP3DLIB;
60 
61 
62 //*************************************************************************************************************
63 //=============================================================================================================
64 // MAIN
65 //=============================================================================================================
66 
67 //=============================================================================================================
76 int main(int argc, char *argv[])
77 {
78  QGuiApplication a(argc, argv);
79 
80  QStringList args = QCoreApplication::arguments();
81  int w_pos = args.indexOf("-width");
82  int h_pos = args.indexOf("-height");
83  int w, h;
84  if (w_pos >= 0 && h_pos >= 0)
85  {
86  bool ok = true;
87  w = args.at(w_pos + 1).toInt(&ok);
88  if (!ok)
89  {
90  qWarning() << "Could not parse width argument:" << args;
91  return 1;
92  }
93  h = args.at(h_pos + 1).toInt(&ok);
94  if (!ok)
95  {
96  qWarning() << "Could not parse height argument:" << args;
97  return 1;
98  }
99  }
100 
101  //
102  // pial
103  //
104  BrainView t_pialBrainView("sample", 2, "pial", "./MNE-sample-data/subjects");
105 
106  if (t_pialBrainView.stereoType() != QGLView::RedCyanAnaglyph)
107  t_pialBrainView.camera()->setEyeSeparation(0.3f);
108 
109  if (w_pos >= 0 && h_pos >= 0)
110  t_pialBrainView.resize(w, h);
111  else
112  t_pialBrainView.resize(800, 600);
113 
114  t_pialBrainView.setTitle(QString("Pial surface"));
115  t_pialBrainView.show();
116 
117  //
118  // inflated
119  //
120  BrainView t_inflatedBrainView("sample", 2, "inflated", "./MNE-sample-data/subjects");
121 
122  if (t_inflatedBrainView.stereoType() != QGLView::RedCyanAnaglyph)
123  t_inflatedBrainView.camera()->setEyeSeparation(0.3f);
124  if (w_pos >= 0 && h_pos >= 0)
125  t_inflatedBrainView.resize(w, h);
126  else
127  t_inflatedBrainView.resize(800, 600);
128 
129  t_inflatedBrainView.setTitle(QString("Inflated surface"));
130  t_inflatedBrainView.show();
131 
132  //
133  // orig
134  //
135  BrainView t_originBrainView("sample", 2, "orig", "./MNE-sample-data/subjects");
136 
137  if (t_originBrainView.stereoType() != QGLView::RedCyanAnaglyph)
138  t_originBrainView.camera()->setEyeSeparation(0.3f);
139  if (w_pos >= 0 && h_pos >= 0)
140  t_originBrainView.resize(w, h);
141  else
142  t_originBrainView.resize(800, 600);
143 
144  t_originBrainView.setTitle(QString("Orig surface"));
145  t_originBrainView.show();
146 
147  //
148  // white
149  //
150  BrainView t_whiteBrainView("sample", 2, "white", "./MNE-sample-data/subjects");
151 
152  if (t_whiteBrainView.stereoType() != QGLView::RedCyanAnaglyph)
153  t_whiteBrainView.camera()->setEyeSeparation(0.3f);
154  if (w_pos >= 0 && h_pos >= 0)
155  t_whiteBrainView.resize(w, h);
156  else
157  t_whiteBrainView.resize(800, 600);
158 
159  t_whiteBrainView.setTitle(QString("White surface"));
160  t_whiteBrainView.show();
161 
162  return a.exec();
163 }
FreeSurfer surface visualisation.
Definition: brainview.h:106