]> Creatis software - clitk.git/blob - vv/vvMidPosition.h
Initial revision
[clitk.git] / vv / vvMidPosition.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Joel Schaerer (joel.schaerer@insa-lyon.fr)
6  Program:   vv
7
8 Copyright (C) 2008
9 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
10 CREATIS-LRMN http://www.creatis.insa-lyon.fr
11
12 This program is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, version 3 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 =========================================================================*/
25 #ifndef vvMidPosition_h
26 #define vvMidPosition_h
27
28 #include <string>
29 #include <QThread>
30 #include <QProgressDialog>
31 #include "vvImage.h"
32 #include "vvSlicerManager.h"
33
34 class vvMidPosition : public QThread
35 {
36 public:
37     vvMidPosition();
38
39     ///Call this to trigger the computation in a separate thread and wait until it's done
40     void Update();
41     vvSlicerManager * slicer_manager;
42     ///True if there is an error during the computation
43     bool error;
44     std::string error_message;
45     vvImage::Pointer output;
46     int reference_image_index;
47 protected:
48     void run();
49     ///This is called everytime the main thread wakes up, and updates a progress bar
50     void update_progress();
51     QProgressDialog p_bar;
52     ///Counter for the progress bar. We should use a mutex, but it turns out it isn't needed
53     int progress;
54 };
55
56 #endif