ctkDicomAvailableDataHelper.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKDICOMAVAILABLEDATAHELPER_H
  16. #define CTKDICOMAVAILABLEDATAHELPER_H
  17. // Qt includes
  18. #include <QObject>
  19. #include <QString>
  20. #include <QUuid>
  21. // CTK includes
  22. #include <org_commontk_dah_core_Export.h>
  23. #include <ctkDicomAppHostingTypes.h>
  24. class ctkDicomObjectLocatorCache;
  25. class ctkDICOMItem;
  26. namespace ctkDicomAvailableDataHelper {
  27. //----------------------------------------------------------------------------
  28. class ctkDicomAvailableDataAccessorPrivate;
  29. class org_commontk_dah_core_EXPORT ctkDicomAvailableDataAccessor : public QObject
  30. {
  31. public:
  32. ctkDicomAvailableDataAccessor(ctkDicomAppHosting::AvailableData& ad);
  33. virtual ~ctkDicomAvailableDataAccessor();
  34. /**
  35. * Method used to retrieve information about a specific patient, giving a patient struct with the ID field already
  36. * defined.
  37. * \return the struct with patient information if patient is present inside available data, otherwise return NULL.
  38. */
  39. ctkDicomAppHosting::Patient* getPatient(const ctkDicomAppHosting::Patient& patient) const;
  40. /**
  41. * Method used to retrieve information about a specific study, giving Study UID.
  42. * \return the struct with study information if study is present inside available data, otherwise return NULL.
  43. */
  44. ctkDicomAppHosting::Study* getStudy(const QString& studyUID) const;
  45. /**
  46. * Method used to retrieve information about a specific series, giving series UID.
  47. * \return the struct with series information if series is present inside available data, otherwise return NULL.
  48. */
  49. ctkDicomAppHosting::Series* getSeries(const QString& seriesUID) const;
  50. void find(const ctkDicomAppHosting::Patient& patient,
  51. const QString& studyUID,
  52. const QString& seriesUID,
  53. ctkDicomAppHosting::Patient*& patientResult,
  54. ctkDicomAppHosting::Study*& studyResult,
  55. ctkDicomAppHosting::Series*& seriesResult) const;
  56. protected:
  57. QScopedPointer<ctkDicomAvailableDataAccessorPrivate> d_ptr;
  58. private:
  59. Q_DECLARE_PRIVATE(ctkDicomAvailableDataAccessor);
  60. };
  61. //----------------------------------------------------------------------------
  62. bool org_commontk_dah_core_EXPORT addToAvailableData(ctkDicomAppHosting::AvailableData& data,
  63. ctkDicomObjectLocatorCache* objectLocatorCache,
  64. const ctkDICOMItem& dataset,
  65. long length,
  66. long offset,
  67. const QString& uri);
  68. //----------------------------------------------------------------------------
  69. bool org_commontk_dah_core_EXPORT addToAvailableData(ctkDicomAppHosting::AvailableData& data,
  70. ctkDicomObjectLocatorCache* objectLocatorCache,
  71. const QString& filename);
  72. //----------------------------------------------------------------------------
  73. bool org_commontk_dah_core_EXPORT addNonDICOMToAvailableData(ctkDicomAppHosting::AvailableData& data,
  74. ctkDicomObjectLocatorCache* objectLocatorCache,
  75. const ctkDICOMItem& dataset,
  76. long length,
  77. long offset,
  78. const QString& uri);
  79. //----------------------------------------------------------------------------
  80. bool org_commontk_dah_core_EXPORT appendToAvailableData(ctkDicomAppHosting::AvailableData& dest,
  81. const ctkDicomAppHosting::AvailableData& src);
  82. //----------------------------------------------------------------------------
  83. /**
  84. * \brief Build list of all UUIDs of data available for patient.
  85. *
  86. * Result can be used to retrieve data by calling ctkDicomExchangeInterface::getData.
  87. *
  88. * \return alls UUIDs of data for patient inside available data, otherwise empty.
  89. */
  90. QList<QUuid> org_commontk_dah_core_EXPORT getAllUuids(const ctkDicomAppHosting::Patient& patient);
  91. //----------------------------------------------------------------------------
  92. /**
  93. * \brief Build list of all UUIDs of available data.
  94. *
  95. * Result can be used to retrieve data by calling ctkDicomExchangeInterface::getData.
  96. *
  97. * \return alls UUIDs of all data inside available data, otherwise empty.
  98. */
  99. QList<QUuid> org_commontk_dah_core_EXPORT getAllUuids(const ctkDicomAppHosting::AvailableData& availableData);
  100. } //end namespace ctkDicomAvailableDataHelper
  101. #endif // CTKDICOMAVAILABLEDATAHELPER_H