ctkXnatScan.cpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*=============================================================================
  2. Library: XNAT/Core
  3. Copyright (c) University College London,
  4. Centre for Medical Image Computing
  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. #include "ctkXnatScan.h"
  16. #include "ctkXnatConstants.h"
  17. #include "ctkXnatDefaultSchemaTypes.h"
  18. #include "ctkXnatObject.h"
  19. #include "ctkXnatObjectPrivate.h"
  20. #include "ctkXnatScanFolder.h"
  21. #include "ctkXnatSession.h"
  22. //----------------------------------------------------------------------------
  23. class ctkXnatScanPrivate : public ctkXnatObjectPrivate
  24. {
  25. public:
  26. ctkXnatScanPrivate()
  27. : ctkXnatObjectPrivate()
  28. {
  29. }
  30. void reset()
  31. {
  32. uri.clear();
  33. }
  34. QString uri;
  35. };
  36. //----------------------------------------------------------------------------
  37. ctkXnatScan::ctkXnatScan(ctkXnatObject* parent, const QString& schemaType)
  38. : ctkXnatObject(*new ctkXnatScanPrivate(), parent, schemaType)
  39. {
  40. }
  41. //----------------------------------------------------------------------------
  42. ctkXnatScan::~ctkXnatScan()
  43. {
  44. }
  45. //----------------------------------------------------------------------------
  46. void ctkXnatScan::setQuality(const QString &quality)
  47. {
  48. setProperty(ctkXnatObjectFields::QUALITY, quality);
  49. }
  50. //----------------------------------------------------------------------------
  51. QString ctkXnatScan::quality() const
  52. {
  53. return property(ctkXnatObjectFields::QUALITY);
  54. }
  55. //----------------------------------------------------------------------------
  56. void ctkXnatScan::setSeriesDescription(const QString &seriesDescription)
  57. {
  58. setProperty(ctkXnatObjectFields::SERIES_DESCRIPTION, seriesDescription);
  59. }
  60. //----------------------------------------------------------------------------
  61. QString ctkXnatScan::seriesDescription() const
  62. {
  63. return property(ctkXnatObjectFields::SERIES_DESCRIPTION);
  64. }
  65. //----------------------------------------------------------------------------
  66. void ctkXnatScan::setType(const QString &type)
  67. {
  68. setProperty(ctkXnatObjectFields::TYPE, type);
  69. }
  70. //----------------------------------------------------------------------------
  71. QString ctkXnatScan::type() const
  72. {
  73. return property(ctkXnatObjectFields::TYPE);
  74. }
  75. //----------------------------------------------------------------------------
  76. QString ctkXnatScan::resourceUri() const
  77. {
  78. return QString("%1/%2").arg(parent()->resourceUri(), this->id());
  79. }
  80. //----------------------------------------------------------------------------
  81. void ctkXnatScan::reset()
  82. {
  83. ctkXnatObject::reset();
  84. }
  85. //----------------------------------------------------------------------------
  86. void ctkXnatScan::fetchImpl()
  87. {
  88. this->fetchResources();
  89. }