]> Creatis software - clitk.git/blob - vv/vvToolCropImage.h
changes in license header
[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 <QtDesigner/QDesignerExportWidget>
23 #include <QDialog>
24
25 // vv
26 #include "vvToolBase.h"
27 #include "vvToolWidgetBase.h"
28 #include "vvMainWindowBase.h"
29 #include "ui_vvToolCropImage.h"
30
31 //------------------------------------------------------------------------------
32 class vvToolCropImage:
33   public vvToolWidgetBase,
34   public vvToolBase<vvToolCropImage>, 
35   private Ui::vvToolCropImage 
36 {
37   Q_OBJECT
38     public:
39   vvToolCropImage(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
40   ~vvToolCropImage();
41
42   virtual void InputIsSelected(vvSlicerManager *m);
43
44 public slots:
45   virtual void apply();
46   virtual bool close();
47   virtual void reject();
48   void sliderXMinValueChanged(int s);
49   void sliderXMaxValueChanged(int s);
50   void sliderYMinValueChanged(int s);
51   void sliderYMaxValueChanged(int s);
52   void sliderZMinValueChanged(int s);
53   void sliderZMaxValueChanged(int s);
54   void sliderTMinValueChanged(int s);
55   void sliderTMaxValueChanged(int s);
56   void autoCropValueChanged(double v);
57
58   //-----------------------------------------------------
59   static void Initialize() {
60     SetToolName("Crop");
61     SetToolMenuName("Crop");
62     SetToolIconFilename(":/common/icons/crop.png");
63     SetToolTip("Crop image.");
64   }
65
66  protected:
67   Ui::vvToolCropImage ui;
68   int * mReducedExtent;
69   int * mInitialExtent;
70   int mExtentSize;
71   void UpdateExtent();
72   virtual void closeEvent(QCloseEvent *event);
73
74 }; // end class vvToolCropImage
75 //------------------------------------------------------------------------------
76
77 #endif
78