]> Creatis software - clitk.git/blob - vv/vvToolCropImage.h
- add "convert to" in context menu
[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://oncora1.lyon.fnclcc.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 #include <QtDesigner/QDesignerExportWidget>
21 #include <QDialog>
22
23 #include "vvToolBase.h"
24 #include "vvToolWidgetBase.h"
25 #include "vvMainWindowBase.h"
26 #include "ui_vvToolCropImage.h"
27
28 //------------------------------------------------------------------------------
29 class vvToolCropImage:
30   public vvToolWidgetBase,
31   public vvToolBase<vvToolCropImage>, 
32   private Ui::vvToolCropImage 
33 {
34   Q_OBJECT
35     public:
36   vvToolCropImage(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
37   ~vvToolCropImage();
38
39   virtual void InputIsSelected(vvSlicerManager *m);
40
41 public slots:
42   virtual void apply();
43   virtual bool close();
44   virtual void reject();
45   void sliderXMinValueChanged(int s);
46   void sliderXMaxValueChanged(int s);
47   void sliderYMinValueChanged(int s);
48   void sliderYMaxValueChanged(int s);
49   void sliderZMinValueChanged(int s);
50   void sliderZMaxValueChanged(int s);
51   // void sliderTMinValueChanged(int s);
52   // void sliderTMaxValueChanged(int s);
53   void autoCropValueChanged(double v);
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
70 }; // end class vvToolCropImage
71 //------------------------------------------------------------------------------
72
73 #endif
74