1 #ifndef _VVRESAMPLERDIALOG_H
2 #define _VVRESAMPLERDIALOG_H
4 /*=========================================================================
7 Module: $RCSfile: vvResamplerDialog.h,v $
9 Date: $Date: 2010/01/06 13:31:57 $
10 Version: $Revision: 1.1 $
11 Author : David Sarrut (david.sarrut@gmail.com)
14 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
15 CREATIS-LRMN http://www.creatis.insa-lyon.fr
17 This program is free software: you can redistribute it and/or modify
18 it under the terms of the GNU General Public License as published by
19 the Free Software Foundation, version 3 of the License.
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
26 You should have received a copy of the GNU General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 =========================================================================*/
32 #include "ui_vvResamplerDialog.h"
33 #include "clitkCommon.h"
35 #include "vvSlicerManager.h"
37 #include <QtDesigner/QDesignerExportWidget>
38 #include <QTreeWidget>
40 //====================================================================
41 class QDESIGNER_WIDGET_EXPORT vvResamplerDialog : public QDialog, private Ui::vvResamplerDialog {
46 // constructor - destructor
47 vvResamplerDialog(QWidget * parent=0, Qt::WindowFlags f=0);
48 void SetSlicerManagers(std::vector<vvSlicerManager*> & m,int current_image_index);
51 vvImage::Pointer GetOutput() {
54 bool GetDisplayResult() {
55 return display_result->checkState() > 0;
57 std::string GetOutputFileName();
60 // void SetImagesList(QTreeWidget * tree);
62 void UpdateControlSizeAndSpacing();
63 void ComputeNewSizeFromSpacing();
64 void ComputeNewSizeFromScale();
65 void ComputeNewSizeFromIso();
66 void ComputeNewSpacingFromSize();
67 void ComputeNewSpacingFromScale();
68 void ComputeNewSpacingFromIso();
69 void UpdateInterpolation();
70 void UpdateGaussianFilter();
71 void UpdateCurrentInputImage();
74 Ui::vvResamplerDialog ui;
75 std::vector<vvSlicerManager*> mSlicerManagers;
76 vvImage::Pointer mOutput;
78 vvImage::Pointer mCurrentImage;
81 std::vector<int> mInputOrigin;
82 std::vector<int> mInputSize;
83 std::vector<double> mInputSpacing;
84 std::vector<int> mOutputSize;
85 std::vector<double> mOutputSpacing;
90 QString mInputFileName;
92 QString mInputFileFormat;
94 QString ComponentType;
96 QStringList OutputListFormat;
99 void UpdateInputInfo();
100 void UpdateOutputInfo();
101 void UpdateOutputFormat();
102 void FillSizeEdit(std::vector<int> size);
103 void FillSpacingEdit(std::vector<double> spacing);
104 void UpdateOutputSizeAndSpacing();
106 QString GetSizeInBytes(std::vector<int> & size);
107 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
108 QString GetVectorIntAsString(std::vector<int> vectorInt);
110 }; // end class vvResamplerDialog
111 //====================================================================
113 #endif /* end #define _VVRESAMPLERDIALOG_H */