-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
72 lines (55 loc) · 2 KB
/
main.cpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "mainwindow.h"
#include <QApplication>
#include <QCoreApplication>
#include <QCommandLineParser>
#include <postprocessing/method.h>
Q_DECLARE_METATYPE(QStringList)
QString processingMethodToString(Method* t) {
return t->toString();
}
int main(int argc, char *argv[])
{
QFile file (QDir::homePath()+"/mivlog.txt");
file.remove();
QVector<QPair<QString,QString>> list;
//qRegisterMetaTypeStreamOperators<QStringList>("QStringList");
QMetaType::registerConverter<Method*, QString>(processingMethodToString);
QApplication::setDesktopSettingsAware(false);
QApplication app(argc, argv);
QApplication::setWindowIcon(QIcon(":/Images/icons/segmentation.png"));
QApplication::setApplicationName("MISe");
QApplication::setOrganizationName("LIDS");
QApplication::setOrganizationDomain("lids.ic.unicamp.br");
QApplication::setApplicationVersion("1.0");
QLocale::setDefault(QLocale::English);
setlocale(LC_NUMERIC, "en_US.UTF-8");
QCommandLineParser parser;
parser.setApplicationDescription("Multidimensional Image Segmentation");
parser.addHelpOption();
parser.addVersionOption();
parser.addOptions({
{{"i", "input-image"},
QApplication::translate("main", "Load input image."),
QApplication::translate("main", "image")},
{{"l", "label-image"},
QApplication::translate("main", "Load label image."),
QApplication::translate("main", "label")},
});
// Process the actual command line arguments given by the user
parser.process(app);
QString img_path = parser.value("input-image");
QString label_path = parser.value("label-image");
MainWindow w;
w.show();
if (!img_path.isNull())
w.loadImageFromCommandLine(QStringList(img_path));
if (!label_path.isNull())
w.loadLabelFromCommandLine(label_path);
return app.exec();
/*
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
*/
}