MNE-CPP  beta 1.0
main.cpp
1 //=============================================================================================================
37 //*************************************************************************************************************
38 //=============================================================================================================
39 // INCLUDES
40 //=============================================================================================================
41 
42 #include <fs/label.h>
43 #include <fs/surface.h>
44 #include <fs/annotationset.h>
45 
46 #include <disp3D/labelview.h>
47 
48 #include <iostream>
49 
50 
51 //*************************************************************************************************************
52 //=============================================================================================================
53 // QT INCLUDES
54 //=============================================================================================================
55 
56 #include <QGuiApplication>
57 
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // USED NAMESPACES
62 //=============================================================================================================
63 
64 using namespace DISP3DLIB;
65 using namespace FSLIB;
66 
67 
68 //*************************************************************************************************************
69 //=============================================================================================================
70 // MAIN
71 //=============================================================================================================
72 
73 //=============================================================================================================
82 int main(int argc, char *argv[])
83 {
84  QGuiApplication a(argc, argv);
85 
86 
87  AnnotationSet t_annotSet("./MNE-sample-data/subjects/sample/label/lh.aparc.a2009s.annot","./MNE-sample-data/subjects/sample/label/rh.aparc.a2009s.annot");
88  SurfaceSet t_surfSet("./MNE-sample-data/subjects/sample/surf/lh.white", "./MNE-sample-data/subjects/sample/surf/rh.white");
89 
90  QList<Label> t_qListLabels;
91  QList<RowVector4i> t_qListRGBAs;
92 
93  t_annotSet.toLabels(t_surfSet, t_qListLabels, t_qListRGBAs);
94 
95  LabelView view(t_surfSet, t_qListLabels, t_qListRGBAs);
96 
97  if (view.stereoType() != QGLView::RedCyanAnaglyph)
98  view.camera()->setEyeSeparation(0.3f);
99  QStringList args = QCoreApplication::arguments();
100  int w_pos = args.indexOf("-width");
101  int h_pos = args.indexOf("-height");
102  if (w_pos >= 0 && h_pos >= 0)
103  {
104  bool ok = true;
105  int w = args.at(w_pos + 1).toInt(&ok);
106  if (!ok)
107  {
108  qWarning() << "Could not parse width argument:" << args;
109  return 1;
110  }
111  int h = args.at(h_pos + 1).toInt(&ok);
112  if (!ok)
113  {
114  qWarning() << "Could not parse height argument:" << args;
115  return 1;
116  }
117  view.resize(w, h);
118  }
119  else
120  {
121  view.resize(800, 600);
122  }
123  view.show();
124 
125  return a.exec();
126 }
3D stereoscopic labels
Definition: labelview.h:105
LabelView class declaration.
Annotation set.
Definition: annotationset.h:96
Surface class declaration.
AnnotationSet class declaration.
Label class declaration.
A hemisphere set of surfaces.
Definition: surfaceset.h:83