]> Creatis software - clitk.git/blob - vv/vvResamplerDialog.h
added the new headers
[clitk.git] / vv / vvResamplerDialog.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #ifndef _VVRESAMPLERDIALOG_H
19 #define _VVRESAMPLERDIALOG_H
20 #include "ui_vvResamplerDialog.h"
21 #include "clitkCommon.h"
22 #include "vvImage.h"
23 #include "vvSlicerManager.h"
24
25 #include <QtDesigner/QDesignerExportWidget>
26 #include <QTreeWidget>
27
28 //====================================================================
29 class vvResamplerDialog :  public QDialog, private Ui::vvResamplerDialog {
30
31     Q_OBJECT
32
33 public:
34     // constructor - destructor
35     vvResamplerDialog(QWidget * parent=0, Qt::WindowFlags f=0);
36     void SetSlicerManagers(std::vector<vvSlicerManager*> & m,int current_image_index);
37
38     // Get output result
39     vvImage::Pointer GetOutput() {
40         return mOutput;
41     }
42     bool GetDisplayResult() {
43         return display_result->checkState() > 0;
44     }
45     std::string GetOutputFileName();
46
47 public slots:
48 //  void SetImagesList(QTreeWidget * tree);
49     void Resample();
50     void UpdateControlSizeAndSpacing();
51     void ComputeNewSizeFromSpacing();
52     void ComputeNewSizeFromScale();
53     void ComputeNewSizeFromIso();
54     void ComputeNewSpacingFromSize();
55     void ComputeNewSpacingFromScale();
56     void ComputeNewSpacingFromIso();
57     void UpdateInterpolation();
58     void UpdateGaussianFilter();
59     void UpdateCurrentInputImage();
60
61 protected:
62     Ui::vvResamplerDialog ui;
63     std::vector<vvSlicerManager*> mSlicerManagers;
64     vvImage::Pointer mOutput;
65
66     vvImage::Pointer mCurrentImage;
67     int mCurrentIndex;
68
69     std::vector<int> mInputOrigin;
70     std::vector<int> mInputSize;
71     std::vector<double> mInputSpacing;
72     std::vector<int> mOutputSize;
73     std::vector<double> mOutputSpacing;
74     int mDimension;
75
76     QString mLastError;
77
78     QString mInputFileName;
79
80     QString mInputFileFormat;
81     QString mPixelType;
82     QString ComponentType;
83
84     QStringList OutputListFormat;
85
86     void Init();
87     void UpdateInputInfo();
88     void UpdateOutputInfo();
89     void UpdateOutputFormat();
90     void FillSizeEdit(std::vector<int> size);
91     void FillSpacingEdit(std::vector<double> spacing);
92     void UpdateOutputSizeAndSpacing();
93
94     QString GetSizeInBytes(std::vector<int> & size);
95     QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
96     QString GetVectorIntAsString(std::vector<int> vectorInt);
97
98 }; // end class vvResamplerDialog
99 //====================================================================
100
101 #endif /* end #define _VVRESAMPLERDIALOG_H */
102