1 /*=========================================================================
5 Author : Pierre Seroul (pierre.seroul@gmail.com)
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 =========================================================================*/
26 #include <QApplication>
28 #include <QSplashScreen>
30 #include <QDesktopWidget>
32 #include "clitkCommon.h"
33 #include "vvMainWindow.h"
35 #include "vvConstants.h"
37 //------------------------------------------------------------------------------
38 int main( int argc, char** argv )
42 QApplication app( argc, argv );
43 Q_INIT_RESOURCE(vvIcons);
44 //QPixmap pixmap(":/splashscreen.PNG");
45 QSplashScreen *splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/new/prefix1/splashscreen.PNG")));
46 /*splash->showMessage("VV 1.0 developped by Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr and CREATIS-LRMN http://www.creatis.insa-lyon.fr",(Qt::AlignRight | Qt::AlignBottom));*/
48 QTimer::singleShot(2000, splash, SLOT(close()));
49 while (!splash->isHidden())
54 //Try to give the window a sensible default size
55 int width=QApplication::desktop()->width()*0.8;
56 int height=QApplication::desktop()->height()*0.9;
57 if (width> 1.5*height)
59 window.resize(width,height);
63 std::vector<std::string> filenames;
64 std::vector<std::pair<int ,std::string> > overlays;
65 std::vector<std::pair<int ,std::string> > vector_fields;
68 for (int i = 1; i < argc; i++)
70 std::string temp = argv[i];
73 assert(filenames.size()>=1);
74 vector_fields.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
77 else if (temp=="--overlay")
79 assert(filenames.size()>=1);
80 overlays.push_back(std::make_pair(filenames.size()-1,argv[i+1]));
81 i++; //skip overlay name
84 filenames.push_back(temp);
86 window.LoadImages(filenames,IMAGE);
87 for (std::vector<std::pair<int ,std::string> >::iterator i=overlays.begin();
88 i!=overlays.end();i++)
89 window.AddOverlayImage((*i).first,(*i).second.c_str());
90 for (std::vector<std::pair<int ,std::string> >::iterator i=vector_fields.begin();
91 i!=vector_fields.end();i++)
92 window.AddField((*i).second.c_str(), (*i).first);