1 #ifndef _VVRESAMPLERDIALOG_H
2 #define _VVRESAMPLERDIALOG_H
4 /*=========================================================================
8 Author : David Sarrut (david.sarrut@gmail.com)
11 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
12 CREATIS-LRMN http://www.creatis.insa-lyon.fr
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.
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.
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/>.
26 =========================================================================*/
29 #include "ui_vvResamplerDialog.h"
30 #include "clitkCommon.h"
32 #include "vvSlicerManager.h"
34 #include <QtDesigner/QDesignerExportWidget>
35 #include <QTreeWidget>
37 //====================================================================
38 class QDESIGNER_WIDGET_EXPORT vvResamplerDialog : public QDialog, private Ui::vvResamplerDialog {
43 // constructor - destructor
44 vvResamplerDialog(QWidget * parent=0, Qt::WindowFlags f=0);
45 void SetSlicerManagers(std::vector<vvSlicerManager*> & m,int current_image_index);
48 vvImage::Pointer GetOutput() {
51 bool GetDisplayResult() {
52 return display_result->checkState() > 0;
54 std::string GetOutputFileName();
57 // void SetImagesList(QTreeWidget * tree);
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();
71 Ui::vvResamplerDialog ui;
72 std::vector<vvSlicerManager*> mSlicerManagers;
73 vvImage::Pointer mOutput;
75 vvImage::Pointer mCurrentImage;
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;
87 QString mInputFileName;
89 QString mInputFileFormat;
91 QString ComponentType;
93 QStringList OutputListFormat;
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();
103 QString GetSizeInBytes(std::vector<int> & size);
104 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
105 QString GetVectorIntAsString(std::vector<int> vectorInt);
107 }; // end class vvResamplerDialog
108 //====================================================================
110 #endif /* end #define _VVRESAMPLERDIALOG_H */