ctkDICOMAppWidget.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. /// \ingroup DICOM_Widgets
  23. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QWidget
  24. {
  25. Q_OBJECT
  26. Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
  27. Q_PROPERTY(bool searchWidgetPopUpMode READ searchWidgetPopUpMode WRITE setSearchWidgetPopUpMode)
  28. Q_PROPERTY(QStringList tagsToPrecache READ tagsToPrecache WRITE setTagsToPrecache)
  29. public:
  30. typedef QWidget Superclass;
  31. explicit ctkDICOMAppWidget(QWidget* parent=0);
  32. virtual ~ctkDICOMAppWidget();
  33. /// Directory being used to store the dicom database
  34. QString databaseDirectory() const;
  35. /// See ctkDICOMDatabase for description - these accessors
  36. /// delegate to the corresponding routines of the internal
  37. /// instance of the database.
  38. /// @see ctkDICOMDatabase
  39. void setTagsToPrecache(const QStringList tags);
  40. const QStringList tagsToPrecache();
  41. /// Updates schema of loaded database to match the one
  42. /// coded by the current version of ctkDICOMDatabase.
  43. /// Also provides a dialog box for progress
  44. void updateDatabaseSchemaIfNeeded();
  45. /// Setting search widget pop-up mode
  46. /// Default value is false. Setting it to true will make
  47. /// search widget to be displayed as pop-up widget
  48. void setSearchWidgetPopUpMode(bool flag);
  49. bool searchWidgetPopUpMode();
  50. public Q_SLOTS:
  51. void setDatabaseDirectory(const QString& directory);
  52. void onAddToDatabase();
  53. void openImportDialog();
  54. void openExportDialog();
  55. void openQueryDialog();
  56. void onRemoveAction();
  57. void suspendModel();
  58. void resumeModel();
  59. void resetModel();
  60. Q_SIGNALS:
  61. /// Emited when directory is changed
  62. void databaseDirectoryChanged(const QString&);
  63. /// Emited when query/retrieve operation has happened
  64. void queryRetrieveFinished();
  65. /// Emited when the directory import operation has completed
  66. void directoryImported();
  67. protected:
  68. QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
  69. protected Q_SLOTS:
  70. void onImportDirectory(QString directory);
  71. void onModelSelected(const QModelIndex& index);
  72. /// To be called when a thumbnail in thumbnail list widget is selected
  73. void onThumbnailSelected(const ctkThumbnailLabel& widget);
  74. /// To be called when a thumbnail in thumbnail list widget is double-clicked
  75. void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
  76. /// To be called when previous and next buttons are clicked
  77. void onNextImage();
  78. void onPreviousImage();
  79. void onNextSeries();
  80. void onPreviousSeries();
  81. void onNextStudy();
  82. void onPreviousStudy();
  83. /// To be called when dialog finishes
  84. void onQueryRetrieveFinished();
  85. /// To be called when an entry of the tree list is collapsed
  86. void onTreeCollapsed(const QModelIndex& index);
  87. /// To be called when an entry of the tree list is expanded
  88. void onTreeExpanded(const QModelIndex& index);
  89. /// To be called when auto-play checkbox state changed
  90. void onAutoPlayCheckboxStateChanged(int state);
  91. /// Called by timer for auto-play functionality
  92. void onAutoPlayTimer();
  93. /// To be called when the value of thumbnail size slider bar is changed
  94. void onThumbnailWidthSliderValueChanged(int val);
  95. /// To be called when search parameters in query widget changed
  96. void onSearchParameterChanged();
  97. /// To be called after image preview displayed an image
  98. void onImagePreviewDisplayed(int imageID, int count);
  99. private Q_SLOTS:
  100. void onSearchPopUpButtonClicked();
  101. void onSearchWidgetTopLevelChanged(bool topLevel);
  102. private:
  103. Q_DECLARE_PRIVATE(ctkDICOMAppWidget);
  104. Q_DISABLE_COPY(ctkDICOMAppWidget);
  105. };
  106. #endif