ctkDICOMIndexer.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 __ctkDICOMIndexer_h
  15. #define __ctkDICOMIndexer_h
  16. // Qt includes
  17. #include <QSqlDatabase>
  18. #include "ctkDICOMCoreExport.h"
  19. #include "ctkDICOMDatabase.h"
  20. class ctkDICOMIndexerPrivate;
  21. class ctkDICOMAbstractThumbnailGenerator;
  22. /**
  23. \brief Indexes DICOM images located in local directory into an Sql database
  24. */
  25. class CTK_DICOM_CORE_EXPORT ctkDICOMIndexer
  26. {
  27. public:
  28. explicit ctkDICOMIndexer();
  29. virtual ~ctkDICOMIndexer();
  30. /**
  31. \brief Adds directory to database and optionally copies files to
  32. destinationDirectory.
  33. Scan the directory using Dcmtk and populate the database with all the
  34. DICOM images accordingly.
  35. */
  36. void addDirectory(ctkDICOMDatabase& database, const QString& directoryName,
  37. const QString& destinationDirectoryName = "",
  38. bool createHierarchy = true, bool createThumbnails = true);
  39. void refreshDatabase(ctkDICOMDatabase& database, const QString& directoryName);
  40. ///
  41. /// set thumbnail generator object
  42. void setThumbnailGenerator(ctkDICOMAbstractThumbnailGenerator* generator);
  43. ///
  44. /// get thumbnail genrator object
  45. ctkDICOMAbstractThumbnailGenerator* thumbnailGenerator();
  46. protected:
  47. QScopedPointer<ctkDICOMIndexerPrivate> d_ptr;
  48. private:
  49. Q_DECLARE_PRIVATE(ctkDICOMIndexer);
  50. Q_DISABLE_COPY(ctkDICOMIndexer);
  51. };
  52. #endif