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 ======================================================================-====*/
19 #ifndef _VVTOOLRESAMPLE_H
20 #define _VVTOOLRESAMPLE_H
22 #include "ui_vvToolResample.h"
23 #include "clitkCommon.h"
24 #include "clitkImageResampleGenericFilter.h"
26 #include "vvSlicerManager.h"
27 #include "vvToolWidgetBase.h"
28 #include "vvToolBase.h"
30 #include <QtDesigner/QDesignerExportWidget>
31 #include <QTreeWidget>
33 //------------------------------------------------------------------------------
34 class vvToolResample :
35 public vvToolWidgetBase,
36 public vvToolBase<vvToolResample>,
37 private Ui::vvToolResample {
42 // constructor - destructor
43 vvToolResample(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
46 vvImage::Pointer GetOutput() {
49 std::string GetOutputFileName();
50 static void Initialize();
54 // void SetImagesList(QTreeWidget * tree);
55 void UpdateControlSizeAndSpacing();
56 void ComputeNewSizeFromSpacing();
57 void ComputeNewSizeFromScale();
58 void ComputeNewSizeFromIso();
59 void ComputeNewSpacingFromSize();
60 void ComputeNewSpacingFromScale();
61 void ComputeNewSpacingFromIso();
62 void UpdateInterpolation();
63 void UpdateGaussianFilter();
64 void InputIsSelected(vvSlicerManager* m);
67 Ui::vvToolResample ui;
68 vvImage::Pointer mOutput;
69 clitk::ImageResampleGenericFilter::Pointer mFilter;
71 vvSlicerManager* mCurrentSlicerManager;
72 vvImage::Pointer mCurrentImage;
75 std::vector<int> mInputOrigin;
76 std::vector<int> mInputSize;
77 std::vector<double> mInputSpacing;
78 std::vector<int> mOutputSize;
79 std::vector<double> mOutputSpacing;
84 QString mInputFileName;
86 QString mInputFileFormat;
88 QString ComponentType;
90 QStringList OutputListFormat;
92 void UpdateInputInfo();
93 void UpdateOutputInfo();
94 void UpdateOutputFormat();
95 void FillSizeEdit(std::vector<int> size);
96 void FillSpacingEdit(std::vector<double> spacing);
97 void UpdateOutputSizeAndSpacing();
99 QString GetSizeInBytes(std::vector<int> & size);
100 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
101 QString GetVectorIntAsString(std::vector<int> vectorInt);
103 }; // end class vvToolResample
104 //------------------------------------------------------------------------------