]> Creatis software - creaMaracasVisu.git/blob - appli/QtVTKViewer/qtvtkviewer.cxx
1b531816e953d2b9e9704b0d67690561338823f1
[creaMaracasVisu.git] / appli / QtVTKViewer / qtvtkviewer.cxx
1
2 //----------------------------------------------------------------------
3 //              File:                   ann_sample.cpp
4 //              Programmer:             Sunil Arya and David Mount
5 //              Last modified:  03/04/98 (Release 0.1)
6 //              Description:    Sample program for ANN
7 //----------------------------------------------------------------------
8 // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
9 // David Mount.  All Rights Reserved.
10 //
11 // This software and related documentation is part of the Approximate
12 // Nearest Neighbor Library (ANN).  This software is provided under
13 // the provisions of the Lesser GNU Public License (LGPL).  See the
14 // file ../ReadMe.txt for further information.
15 //
16 // The University of Maryland (U.M.) and the authors make no
17 // representations about the suitability or fitness of this software for
18 // any purpose.  It is provided "as is" without express or implied
19 // warranty.
20 //----------------------------------------------------------------------
21
22 #include "qtvtkviewerwidget.h"
23 #include <QMainWindow>
24 #include <QApplication>
25
26
27
28
29 #include "iostream"
30
31
32 #include "OpenImageDialog.h"
33
34 using namespace std;
35 using namespace creaMaracasVisuKernel;
36
37
38 int main(int argc, char **argv)
39 {
40
41
42
43
44
45
46
47     vtkImageData* img = 0;
48
49     if (argc < 2){
50
51         OpenImageDialog open(true);
52         img = open.getImageData();
53
54         if(img == 0){
55             std::cout << "ERROR: Image filename missing. usage qtvtkviewer <image filename>"
56                       << std::endl ;
57             return EXIT_FAILURE;
58          }
59     }else{
60         std::string inputFilename = argv[1];
61     }
62
63
64     QApplication app(argc, argv);
65
66
67     QMainWindow* mainwindow = new QMainWindow();
68
69     QtVTKViewerWidget *viewer = new QtVTKViewerWidget(mainwindow);
70
71     mainwindow-> setCentralWidget(viewer);
72
73
74     mainwindow->show();
75
76     viewer->setImage(img);
77     //viewer->SetLookupTable((vtkLookupTable*)colortransfer);
78
79
80
81
82     return app.exec();
83 }
84