forked from adrienkaiser/DTIAtlasBuilder
-
Notifications
You must be signed in to change notification settings - Fork 3
/
DTIAtlasBuilder.cxx
executable file
·40 lines (31 loc) · 1.3 KB
/
DTIAtlasBuilder.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <string>
#include <QApplication>
#include <QString>
#include <QFile>
#include <QResource>
#include "GUI.h"
#include "DTIAtlasBuilderCLP.h" //generated when ccmake
int main(int argc, char* argv[])
{
PARSE_ARGS; //thanks to this line, we can use the variables entered in command line as variables of the program
//string ParamFile, string ConfigFile, string CSVFile, bool Overwrite, bool noGUI
QApplication app(argc, argv);
std::string commandDirectory = app.applicationDirPath().toStdString();//itksys::SystemTools::GetFilenamePath(itksys::SystemTools::GetRealPath( argv[0] ));
std::cout << "Executable : " << commandDirectory <<std::endl;
GUI AtlasGUI(ParamFile, ConfigFile, CSVFile, Overwrite, noGUI, false, commandDirectory); // argv[0] is the command that the user has ran -> to search the config file in the same directory
/* Launch App */
if(noGUI) return AtlasGUI.Compute();
else
{
QResource::registerResource(app.applicationDirPath()+"/Stylesheet/darkstylesheet.rcc");
QString ssfilename= app.applicationDirPath()+"/Stylesheet/darkstylesheet.qss";
QFile file(ssfilename);
file.open(QFile::ReadOnly);
QString stylesheet = QLatin1String(file.readAll());
app.setStyleSheet(stylesheet);
AtlasGUI.show();
return app.exec();
}
return -1;
}