1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
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"
23 #include "vvSlicerManager.h"
25 #include <QtDesigner/QDesignerExportWidget>
26 #include <QTreeWidget>
28 //====================================================================
29 class vvResamplerDialog : public QDialog, private Ui::vvResamplerDialog {
34 // constructor - destructor
35 vvResamplerDialog(QWidget * parent=0, Qt::WindowFlags f=0);
36 void SetSlicerManagers(std::vector<vvSlicerManager*> & m,int current_image_index);
39 vvImage::Pointer GetOutput() {
42 bool GetDisplayResult() {
43 return display_result->checkState() > 0;
45 std::string GetOutputFileName();
48 // void SetImagesList(QTreeWidget * tree);
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();
62 Ui::vvResamplerDialog ui;
63 std::vector<vvSlicerManager*> mSlicerManagers;
64 vvImage::Pointer mOutput;
66 vvImage::Pointer mCurrentImage;
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;
78 QString mInputFileName;
80 QString mInputFileFormat;
82 QString ComponentType;
84 QStringList OutputListFormat;
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();
94 QString GetSizeInBytes(std::vector<int> & size);
95 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
96 QString GetVectorIntAsString(std::vector<int> vectorInt);
98 }; // end class vvResamplerDialog
99 //====================================================================
101 #endif /* end #define _VVRESAMPLERDIALOG_H */