]> Creatis software - clitk.git/blob - vv/vvToolCropImage.h
Remove experimental condition for .gif
[clitk.git] / vv / vvToolCropImage.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef VVTOOLCROPIMAGE_H
19 #define VVTOOLCROPIMAGE_H
20
21 //qt
22 #include <QtGlobal>
23 #include <QtDesigner/QDesignerExportWidget>
24 #include <QDialog>
25 #include <QSlider>
26 // vv
27 #include "vvToolBase.h"
28 #include "vvToolWidgetBase.h"
29 #include "vvMainWindowBase.h"
30 #include "ui_vvToolCropImage.h"
31 //vtk
32 #include <vtkTransform.h>
33
34 //------------------------------------------------------------------------------
35 class vvToolCropImage:
36   public vvToolWidgetBase,
37   public vvToolBase<vvToolCropImage>, 
38   private Ui::vvToolCropImage 
39 {
40   Q_OBJECT
41     public:
42   vvToolCropImage(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
43   ~vvToolCropImage();
44
45   virtual void InputIsSelected(vvSlicerManager *m);
46
47 public slots:
48   virtual void apply();
49   virtual bool close();
50   virtual void reject();
51   void autoCropValueChanged(double v);
52   void sliderValueChanged(int id);
53
54
55   //-----------------------------------------------------
56   static void Initialize() {
57     SetToolName("Crop");
58     SetToolMenuName("Crop");
59     SetToolIconFilename(":/common/icons/crop.png");
60     SetToolTip("Crop image.");
61   }
62
63  protected:
64   Ui::vvToolCropImage ui;
65   int * mReducedExtent;
66   int * mInitialExtent;
67   int mExtentSize;
68   void UpdateExtent();
69   virtual void closeEvent(QCloseEvent *event);
70
71   std::vector<QSlider*> mSliders;
72   vtkSmartPointer<vtkMatrix4x4> mConcatenedTransform;
73 }; // end class vvToolCropImage
74 //------------------------------------------------------------------------------
75
76 #endif
77