CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkQImageView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkQImageView_h
22 #define __ctkQImageView_h
23 
25 #include <QWidget>
26 #include <QImage>
27 
29 #include "ctkPimpl.h"
30 #include "ctkWidgetsExport.h"
31 
32 class ctkQImageViewPrivate;
33 
37 class CTK_WIDGETS_EXPORT ctkQImageView: public QWidget
38 {
39 
40  Q_OBJECT
41 
42 public:
43 
45  typedef QWidget Superclass;
46 
48  ctkQImageView( QWidget* parent = 0 );
49 
51  virtual ~ctkQImageView( void );
52 
53  double xSpacing( void );
54  double ySpacing( void );
55  double sliceSpacing( void );
56  double sliceThickness( void );
57 
58  double xPosition( void );
59  double yPosition( void );
60  double slicePosition( void );
61  double positionValue( void );
62 
63  double xCenter( void );
64  double yCenter( void );
65 
66  int sliceNumber( void ) const;
67  int numberOfSlices( void ) const;
68 
69  double intensityWindow( void ) const;
70  double intensityLevel( void ) const;
71 
72  bool invertImage( void ) const;
73 
74  bool flipXAxis( void ) const;
75  bool flipYAxis( void ) const;
76  bool transposeXY( void ) const;
77 
78  double zoom( void );
79 
80 public Q_SLOTS:
81 
82  void addImage( const QImage & image );
83  void clearImages( void );
84 
85  void setSliceNumber( int slicenum );
86 
87  void setIntensityWindowLevel( double iwWindow, double iwLevel );
88 
89  void setInvertImage( bool invert );
90  void setFlipXAxis( bool flip );
91  void setFlipYAxis( bool flip );
92  void setTransposeXY( bool transpose );
93 
94  virtual void keyPressEvent( QKeyEvent * event );
95  virtual void mousePressEvent( QMouseEvent * event );
96  virtual void mouseReleaseEvent( QMouseEvent * event );
97  virtual void mouseMoveEvent( QMouseEvent * event );
98  virtual void enterEvent( QEvent * event );
99  virtual void leaveEvent( QEvent * event );
100 
101  void setCenter( double x, double y );
102  void setPosition( double x, double y );
103 
104  void setZoom( double factor );
105 
106  void reset();
107 
108  virtual void update( bool zoomChanged=false, bool sizeChanged=false );
109 
110 Q_SIGNALS:
111 
112  void xSpacingChanged( double xSpacing );
113  void ySpacingChanged( double ySpacing );
114  void sliceThicknessChanged( double sliceThickness );
115 
116  void xPositionChanged( double xPosition );
117  void yPositionChanged( double yPosition );
118  void slicePositionChanged( double slicePosition );
119  void positionValueChanged( double positionValue );
120 
121  void sliceNumberChanged( int sliceNum );
122 
123  void zoomChanged( double factor );
124  void xCenterChanged( double x );
125  void yCenterChanged( double y );
126 
127  void numberOfSlicesChanged( int numberOfSlices );
128 
129  void invertImageChanged( bool invert );
130 
131  void flipXAxisChanged( bool flipXAxis );
132  void flipYAxisChanged( bool flipYAxis );
133  void transposeXYChanged( bool transposeXY );
134 
135  void intensityWindowChanged( double intensityWindow );
136  void intensityLevelChanged( double intensityLevel );
137 
138 protected:
139 
140  virtual void resizeEvent( QResizeEvent* event );
141 
143  ctkQImageView( ctkQImageViewPrivate & pvt,
144  QWidget* parent=0 );
145 
146 private:
147 
148  QScopedPointer< ctkQImageViewPrivate > d_ptr;
149 
150  Q_DECLARE_PRIVATE( ctkQImageView );
151 
152  Q_DISABLE_COPY( ctkQImageView );
153 
154 };
155 
156 #endif
ctkQImageView::Superclass
QWidget Superclass
Superclass typedef.
Definition: ctkQImageView.h:45
ctkQImageView
Definition: ctkQImageView.h:37
ctkPimpl.h