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::ImageResampleGenericFilter::Pointer mFilter;
74 clitk::ResampleImageGenericFilter::Pointer mFilter;
76 vvSlicerManager* mCurrentSlicerManager;
77 vvImage::Pointer mCurrentImage;
80 std::vector<int> mInputOrigin;
81 std::vector<int> mInputSize;
82 std::vector<double> mInputSpacing;
83 std::vector<int> mOutputSize;
84 std::vector<double> mOutputSpacing;
89 QString mInputFileName;
91 QString mInputFileFormat;
93 QString ComponentType;
95 QStringList OutputListFormat;
97 void UpdateInputInfo();
98 void UpdateOutputInfo();
99 void UpdateOutputFormat();
100 void FillSizeEdit(std::vector<int> size);
101 void FillSpacingEdit(std::vector<double> spacing);
102 void UpdateOutputSizeAndSpacing();
104 QString GetSizeInBytes(std::vector<int> & size);
105 QString GetVectorDoubleAsString(std::vector<double> vectorDouble);
106 QString GetVectorIntAsString(std::vector<int> vectorInt);
108 }; // end class vvToolResample
109 //------------------------------------------------------------------------------