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://www.centreleonberard.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
23 //#include "clitkImageResampleGenericFilter.h"
24 #include "clitkResampleImageGenericFilter.h"
27 #include "ui_vvToolResample.h"
29 #include "vvSlicerManager.h"
30 #include "vvToolWidgetBase.h"
31 #include "vvToolBase.h"
34 #include <QtDesigner/QDesignerExportWidget>
35 #include <QTreeWidget>
37 //------------------------------------------------------------------------------
38 class vvToolResample :
39 public vvToolWidgetBase,
40 public vvToolBase<vvToolResample>,
41 private Ui::vvToolResample {
46 // constructor - destructor
47 vvToolResample(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
50 vvImage::Pointer GetOutput() {
53 std::string GetOutputFileName();
54 static void Initialize();
58 // 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 InputIsSelected(vvSlicerManager* m);
71 Ui::vvToolResample ui;
72 vvImage::Pointer mOutput;
73 clitk::ResampleImageGenericFilter::Pointer mFilter;
75 // vvSlicerManager* mCurrentSlicerManager;
76 vvImage::Pointer mCurrentImage;
79 std::vector<int> mInputOrigin;
80 std::vector<int> mInputSize;
81 std::vector<double> mInputSpacing;
82 std::vector<int> mOutputSize;
83 std::vector<double> mOutputSpacing;
88 QString mInputFileName;
90 QString mInputFileFormat;
92 QString ComponentType;
94 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 vvToolResample
108 //------------------------------------------------------------------------------