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::sliceNumberChanged
void sliceNumberChanged(int sliceNum)
ctkQImageView::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
ctkQImageView::intensityWindowChanged
void intensityWindowChanged(double intensityWindow)
ctkQImageView::intensityLevelChanged
void intensityLevelChanged(double intensityLevel)
ctkQImageView::yCenter
double yCenter(void)
ctkQImageView::ySpacingChanged
void ySpacingChanged(double ySpacing)
ctkQImageView::ySpacing
double ySpacing(void)
ctkQImageView::intensityLevel
double intensityLevel(void) const
ctkQImageView::positionValueChanged
void positionValueChanged(double positionValue)
ctkQImageView::setInvertImage
void setInvertImage(bool invert)
ctkQImageView::xCenter
double xCenter(void)
ctkQImageView::sliceThickness
double sliceThickness(void)
ctkQImageView::intensityWindow
double intensityWindow(void) const
ctkQImageView::clearImages
void clearImages(void)
ctkQImageView::flipYAxis
bool flipYAxis(void) const
ctkQImageView::positionValue
double positionValue(void)
ctkQImageView::setPosition
void setPosition(double x, double y)
ctkQImageView::Superclass
QWidget Superclass
Superclass typedef.
Definition: ctkQImageView.h:45
ctkQImageView::transposeXY
bool transposeXY(void) const
ctkQImageView::sliceSpacing
double sliceSpacing(void)
ctkQImageView::numberOfSlicesChanged
void numberOfSlicesChanged(int numberOfSlices)
ctkQImageView::xSpacing
double xSpacing(void)
ctkQImageView::ctkQImageView
ctkQImageView(QWidget *parent=0)
Constructor.
ctkQImageView::slicePositionChanged
void slicePositionChanged(double slicePosition)
ctkQImageView::flipXAxis
bool flipXAxis(void) const
ctkQImageView::flipYAxisChanged
void flipYAxisChanged(bool flipYAxis)
ctkQImageView::yCenterChanged
void yCenterChanged(double y)
ctkQImageView::yPositionChanged
void yPositionChanged(double yPosition)
ctkQImageView::setTransposeXY
void setTransposeXY(bool transpose)
ctkQImageView::xSpacingChanged
void xSpacingChanged(double xSpacing)
ctkQImageView::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
ctkQImageView::sliceNumber
int sliceNumber(void) const
ctkQImageView::xPosition
double xPosition(void)
ctkQImageView::addImage
void addImage(const QImage &image)
ctkQImageView::invertImageChanged
void invertImageChanged(bool invert)
ctkQImageView
Definition: ctkQImageView.h:38
ctkQImageView::setCenter
void setCenter(double x, double y)
ctkQImageView::slicePosition
double slicePosition(void)
ctkQImageView::yPosition
double yPosition(void)
ctkQImageView::xCenterChanged
void xCenterChanged(double x)
ctkQImageView::setIntensityWindowLevel
void setIntensityWindowLevel(double iwWindow, double iwLevel)
ctkQImageView::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
ctkQImageView::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
ctkQImageView::enterEvent
virtual void enterEvent(QEvent *event)
ctkQImageView::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
ctkQImageView::ctkQImageView
ctkQImageView(ctkQImageViewPrivate &pvt, QWidget *parent=0)
protected constructor to derive private implementations
ctkQImageView::invertImage
bool invertImage(void) const
ctkQImageView::xPositionChanged
void xPositionChanged(double xPosition)
ctkQImageView::reset
void reset()
ctkQImageView::leaveEvent
virtual void leaveEvent(QEvent *event)
ctkQImageView::flipXAxisChanged
void flipXAxisChanged(bool flipXAxis)
ctkQImageView::numberOfSlices
int numberOfSlices(void) const
ctkPimpl.h
ctkQImageView::sliceThicknessChanged
void sliceThicknessChanged(double sliceThickness)
ctkQImageView::update
virtual void update(bool zoomChanged=false, bool sizeChanged=false)
ctkQImageView::setZoom
void setZoom(double factor)
ctkQImageView::transposeXYChanged
void transposeXYChanged(bool transposeXY)
ctkQImageView::setFlipXAxis
void setFlipXAxis(bool flip)
ctkQImageView::~ctkQImageView
virtual ~ctkQImageView(void)
Destructor.
ctkQImageView::setFlipYAxis
void setFlipYAxis(bool flip)
ctkQImageView::zoom
double zoom(void)
ctkQImageView::zoomChanged
void zoomChanged(double factor)
ctkQImageView::setSliceNumber
void setSliceNumber(int slicenum)