ctkDICOMObjectListWidget.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Brigham and Women's Hospital (BWH).
  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 __ctkDICOMObjectListWidget_h
  15. #define __ctkDICOMObjectListWidget_h
  16. // Qt includes
  17. #include <QItemSelection>
  18. #include <QWidget>
  19. #include "ctkDICOMWidgetsExport.h"
  20. class ctkDICOMObjectListWidgetPrivate;
  21. /// \ingroup DICOM_Widgets
  22. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMObjectListWidget : public QWidget
  23. {
  24. Q_OBJECT
  25. Q_PROPERTY(QString currentFile READ currentFile WRITE setCurrentFile)
  26. Q_PROPERTY(QStringList fileList READ fileList WRITE setFileList)
  27. Q_PROPERTY(QString filterExpression READ filterExpression WRITE setFilterExpression)
  28. public:
  29. typedef QWidget Superclass;
  30. explicit ctkDICOMObjectListWidget(QWidget* parent=0);
  31. virtual ~ctkDICOMObjectListWidget();
  32. QString currentFile();
  33. QStringList fileList();
  34. /// Filter displayed metadata based on content in Tag, Attribute, and Value columns.
  35. /// Simple search : enter any text to show only those items that contains the text.
  36. /// Use ? and * wildcards to represent any single character or sequence of characters.
  37. /// Regular expression search: Enter regexp: followed by a regular expression.
  38. /// For example, show 3 specific tags, enter : regexp : 0010, 0010 | 0010, 0020 | 0010, 0030
  39. QString filterExpression();
  40. /// Get metadata tree as plain text
  41. QString metadataAsText(bool allFiles = false);
  42. /// Open DICOM tag definition in a web browser
  43. void openLookupUrl(QString tag);
  44. protected:
  45. QScopedPointer<ctkDICOMObjectListWidgetPrivate> d_ptr;
  46. private:
  47. Q_DECLARE_PRIVATE(ctkDICOMObjectListWidget);
  48. Q_DISABLE_COPY(ctkDICOMObjectListWidget);
  49. Q_SIGNALS:
  50. void doubleClicked(const QModelIndex&);
  51. public Q_SLOTS:
  52. void setCurrentFile(const QString& newFileName);
  53. void setFileList(const QStringList& fileList);
  54. void setFilterExpression(const QString& expr);
  55. protected Q_SLOTS:
  56. void itemDoubleClicked(const QModelIndex&);
  57. void onFilterChanged();
  58. void updateWidget();
  59. void copyPath();
  60. void copyMetadata();
  61. void copyAllFilesMetadata();
  62. };
  63. #endif