]> Creatis software - clitk.git/blob - vv/vvResamplerDialog.h
david is libClitkGGO needed? What is it?
[clitk.git] / vv / vvResamplerDialog.h
1 #ifndef _VVRESAMPLERDIALOG_H
2 #define _VVRESAMPLERDIALOG_H
3
4 /*=========================================================================
5
6 Program:   vv
7 Language:  C++
8 Author :   David Sarrut (david.sarrut@gmail.com)
9
10 Copyright (C) 2008
11 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
12 CREATIS-LRMN http://www.creatis.insa-lyon.fr
13
14 This program is free software: you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation, version 3 of the License.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26 =========================================================================*/
27
28
29 #include "ui_vvResamplerDialog.h"
30 #include "clitkCommon.h"
31 #include "vvImage.h"
32 #include "vvSlicerManager.h"
33
34 #include <QtDesigner/QDesignerExportWidget>
35 #include <QTreeWidget>
36
37 //====================================================================
38 class QDESIGNER_WIDGET_EXPORT vvResamplerDialog : public QDialog, private Ui::vvResamplerDialog {
39
40     Q_OBJECT
41
42 public:
43     // constructor - destructor
44     vvResamplerDialog(QWidget * parent=0, Qt::WindowFlags f=0);
45     void SetSlicerManagers(std::vector<vvSlicerManager*> & m,int current_image_index);
46
47     // Get output result
48     vvImage::Pointer GetOutput() {
49         return mOutput;
50     }
51     bool GetDisplayResult() {
52         return display_result->checkState() > 0;
53     }
54     std::string GetOutputFileName();
55
56 public slots:
57 //  void SetImagesList(QTreeWidget * tree);
58     void Resample();
59     void UpdateControlSizeAndSpacing();
60     void ComputeNewSizeFromSpacing();
61     void ComputeNewSizeFromScale();
62     void ComputeNewSizeFromIso();
63     void ComputeNewSpacingFromSize();
64     void ComputeNewSpacingFromScale();
65     void ComputeNewSpacingFromIso();
66     void UpdateInterpolation();
67     void UpdateGaussianFilter();
68     void UpdateCurrentInputImage();
69
70 protected:
71     Ui::vvResamplerDialog ui;
72     std::vector<vvSlicerManager*> mSlicerManagers;
73     vvImage::Pointer mOutput;
74
75     vvImage::Pointer mCurrentImage;
76     int mCurrentIndex;
77
78     std::vector<int> mInputOrigin;
79     std::vector<int> mInputSize;
80     std::vector<double> mInputSpacing;
81     std::vector<int> mOutputSize;
82     std::vector<double> mOutputSpacing;
83     int mDimension;
84
85     QString mLastError;
86
87     QString mInputFileName;
88
89     QString mInputFileFormat;
90     QString mPixelType;
91     QString ComponentType;
92
93     QStringList OutputListFormat;
94
95     void Init();
96     void UpdateInputInfo();
97     void UpdateOutputInfo();
98     void UpdateOutputFormat();
99     void FillSizeEdit(std::vector<int> size);
100     void FillSpacingEdit(std::vector<double> spacing);
101     void UpdateOutputSizeAndSpacing();
102
103     QString GetSizeInBytes(std::vector<int> & size);
104     QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
105     QString GetVectorIntAsString(std::vector<int> vectorInt);
106
107 }; // end class vvResamplerDialog
108 //====================================================================
109
110 #endif /* end #define _VVRESAMPLERDIALOG_H */
111