ctkDICOMImage.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.txt
  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 __ctkDICOMImage_h
  16. #define __ctkDICOMImage_h
  17. // Qt includes
  18. #include <QObject>
  19. #include <QImage>
  20. #include "ctkDICOMWidgetsExport.h"
  21. class ctkDICOMImagePrivate;
  22. class DicomImage;
  23. /**
  24. \brief Wrapper around a DCMTK DicomImage.
  25. This class wraps a DicomImage object and exposes it as a Qt class.
  26. */
  27. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMImage : public QObject
  28. {
  29. Q_OBJECT
  30. Q_PROPERTY(unsigned long frameCount READ frameCount);
  31. public:
  32. /** \brief Construct a ctkDICOMImage
  33. The dicomImage pointer must remain valid during all the life of
  34. the constructed ctkDICOMImage.
  35. */
  36. explicit ctkDICOMImage(DicomImage* dicomImage, QObject* parent = 0);
  37. virtual ~ctkDICOMImage();
  38. /**
  39. \brief Returns the pointer on the dicom image given in the constructor.
  40. This is provided as a utility function. Do not delete the returned
  41. pointer.
  42. TBD: Return a "const DicomImage*" instead?
  43. */
  44. DicomImage* dicomImage() const;
  45. /**
  46. \brief Returns a specific frame of the dicom image
  47. */
  48. QImage frame(int frame = 0) const;
  49. /**
  50. \brief Returns the number of frames contained in the dicom image.
  51. \sa DicomImage::getFrameCount()
  52. Please note that this function does not return the number of frames
  53. stored in the DICOM file/dataset. It rather refers to the number of
  54. frames processed by this class.
  55. */
  56. unsigned long frameCount() const;
  57. protected:
  58. QScopedPointer<ctkDICOMImagePrivate> d_ptr;
  59. private:
  60. Q_DECLARE_PRIVATE(ctkDICOMImage);
  61. Q_DISABLE_COPY(ctkDICOMImage);
  62. };
  63. #endif