ctkDICOMDatasetView.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDICOMDatasetView_h
  15. #define __ctkDICOMDatasetView_h
  16. /// Qt includes
  17. #include <QWidget>
  18. #include <QImage>
  19. #include <QModelIndex>
  20. /// CTK includes
  21. #include "ctkQImageView.h"
  22. #include "ctkPimpl.h"
  23. #include "ctkDICOMImage.h"
  24. #include "ctkDICOMWidgetsExport.h"
  25. class ctkDICOMDatasetViewPrivate;
  26. ///
  27. /// ctkDICOMDatasetView is the base class of image viewer widgets.
  28. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMDatasetView
  29. : public ctkQImageView
  30. {
  31. Q_OBJECT
  32. public:
  33. /// Superclass typedef
  34. typedef ctkQImageView Superclass;
  35. /// Constructor
  36. ctkDICOMDatasetView( QWidget * parent = 0 );
  37. /// Destructor
  38. virtual ~ctkDICOMDatasetView( void );
  39. void setDatabaseDirectory(const QString& directory);
  40. QModelIndex currentImageIndex();
  41. signals:
  42. void requestNextImage();
  43. void requestPreviousImage();
  44. public slots:
  45. void addImage( const ctkDICOMImage & image );
  46. void addImage( const QImage & image );
  47. void onModelSelected(const QModelIndex& index);
  48. virtual void update( bool zoomChanged=false, bool sizeChanged=false );
  49. protected:
  50. /// protected constructor to derive private implementations
  51. ctkDICOMDatasetView( ctkDICOMDatasetViewPrivate & pvt,
  52. QWidget* parent=0 );
  53. /// re-implemented QWidget event functions
  54. virtual void mousePressEvent( QMouseEvent * event );
  55. virtual void mouseMoveEvent( QMouseEvent * event );
  56. private:
  57. QScopedPointer< ctkDICOMDatasetViewPrivate > d_ptr;
  58. Q_DECLARE_PRIVATE( ctkDICOMDatasetView );
  59. Q_DISABLE_COPY( ctkDICOMDatasetView );
  60. };
  61. #endif