ctkDICOMAppWidget.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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.apache.org/licenses/LICENSE-2.0.txt
  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 __ctkDICOMAppWidget_h
  15. #define __ctkDICOMAppWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. #include "ctkDICOMWidgetsExport.h"
  19. class ctkDICOMAppWidgetPrivate;
  20. class ctkThumbnailLabel;
  21. class QModelIndex;
  22. class ctkDICOMDatabase;
  23. /// \ingroup DICOM_Widgets
  24. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QWidget
  25. {
  26. Q_OBJECT
  27. Q_PROPERTY(ctkDICOMDatabase* database READ database)
  28. Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
  29. Q_PROPERTY(bool searchWidgetPopUpMode READ searchWidgetPopUpMode WRITE setSearchWidgetPopUpMode)
  30. public:
  31. typedef QWidget Superclass;
  32. explicit ctkDICOMAppWidget(QWidget* parent=0);
  33. virtual ~ctkDICOMAppWidget();
  34. QString databaseDirectory() const;
  35. /// Setting search widget pop-up mode
  36. /// Default value is false. Setting it to true will make
  37. /// search widget to be displayed as pop-up widget
  38. void setSearchWidgetPopUpMode(bool flag);
  39. bool searchWidgetPopUpMode();
  40. ctkDICOMDatabase* database();
  41. public Q_SLOTS:
  42. void setDatabaseDirectory(const QString& directory);
  43. void onAddToDatabase();
  44. void openImportDialog();
  45. void openExportDialog();
  46. void openQueryDialog();
  47. void onRemoveAction();
  48. void suspendModel();
  49. void resumeModel();
  50. void resetModel();
  51. void onProgress(int);
  52. Q_SIGNALS:
  53. /// Emited when directory is changed
  54. void databaseDirectoryChanged(const QString&);
  55. /// Emited when query/retrieve operation has happened
  56. void queryRetrieveFinished();
  57. protected:
  58. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  59. protected Q_SLOTS:
  60. void onImportDirectory(QString directory);
  61. void onModelSelected(const QModelIndex& index);
  62. /// To be called when a thumbnail in thumbnail list widget is selected
  63. void onThumbnailSelected(const ctkThumbnailLabel& widget);
  64. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  65. void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
  66. /// To be called when previous and next buttons are clicked
  67. void onNextImage();
  68. void onPreviousImage();
  69. void onNextSeries();
  70. void onPreviousSeries();
  71. void onNextStudy();
  72. void onPreviousStudy();
  73. /// To be called when dialog finishes
  74. void onQueryRetrieveFinished();
  75. /// To be called when an entry of the tree list is collapsed
  76. void onTreeCollapsed(const QModelIndex& index);
  77. /// To be called when an entry of the tree list is expanded
  78. void onTreeExpanded(const QModelIndex& index);
  79. /// To be called when auto-play checkbox state changed
  80. void onAutoPlayCheckboxStateChanged(int state);
  81. /// Called by timer for auto-play functionality
  82. void onAutoPlayTimer();
  83. /// To be called when the value of thumbnail size slider bar is changed
  84. void onThumbnailWidthSliderValueChanged(int val);
  85. /// To be called when search parameters in query widget changed
  86. void onSearchParameterChanged();
  87. /// To be called after image preview displayed an image
  88. void onImagePreviewDisplayed(int imageID, int count);
  89. private Q_SLOTS:
  90. void onSearchPopUpButtonClicked();
  91. void onSearchWidgetTopLevelChanged(bool topLevel);
  92. private:
  93. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  94. Q_DISABLE_COPY(ctkDICOMAppWidget);
  95. };
  96. #endif