diff --git a/Libs/DICOM/Core/CMakeLists.txt b/Libs/DICOM/Core/CMakeLists.txt index 7ac2f12981..efaecb0613 100644 --- a/Libs/DICOM/Core/CMakeLists.txt +++ b/Libs/DICOM/Core/CMakeLists.txt @@ -172,6 +172,17 @@ set(KIT_resources # The following macro will read the target libraries from the file 'target_libraries.cmake' ctkFunctionGetTargetLibraries(KIT_target_libraries) +# Support namespaced DCMTK targets +set(_target_libraries) +foreach(target_library IN LISTS KIT_target_libraries) + if(TARGET DCMTK::${target_library}) + list(APPEND _target_libraries DCMTK::${target_library}) + else() + list(APPEND _target_libraries ${target_library}) + endif() +endforeach() +set(KIT_target_libraries ${_target_libraries}) + list(APPEND KIT_target_libraries Qt${CTK_QT_VERSION}::Sql Qt${CTK_QT_VERSION}::Svg) # create a dcm query/retrieve service config file that points to the build dir diff --git a/Libs/DICOM/Core/ctkDICOMDatabase.cpp b/Libs/DICOM/Core/ctkDICOMDatabase.cpp index d4f8a5af6d..f36349dd80 100644 --- a/Libs/DICOM/Core/ctkDICOMDatabase.cpp +++ b/Libs/DICOM/Core/ctkDICOMDatabase.cpp @@ -2433,7 +2433,7 @@ bool ctkDICOMDatabase::storeThumbnailFile(const QString &originalFilePath, } else { - DicomImage dcmImage(QDir::toNativeSeparators(originalFilePath).toUtf8()); + DicomImage dcmImage(QDir::toNativeSeparators(originalFilePath).toUtf8().data()); return d->ThumbnailGenerator->generateThumbnail(&dcmImage, thumbnailPath, backgroundColor); } } diff --git a/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp b/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp index 51d5bc1439..8b37f1389d 100644 --- a/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp +++ b/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp @@ -176,7 +176,7 @@ bool ctkDICOMThumbnailGenerator::generateThumbnail(DicomImage *dcmImage, QImage& /* create output buffer for DicomImage class */ QByteArray buffer; /* copy header to output buffer and resize it for pixel data */ - buffer.append(header.toUtf8()); + buffer.append(header.toUtf8().data()); buffer.resize(length); /* render pixel data to buffer */ @@ -211,14 +211,14 @@ bool ctkDICOMThumbnailGenerator::generateThumbnail(DicomImage *dcmImage, const Q //------------------------------------------------------------------------------ bool ctkDICOMThumbnailGenerator::generateThumbnail(const QString& dcmImagePath, QImage& image) { - DicomImage dcmImage(QDir::toNativeSeparators(dcmImagePath).toUtf8()); + DicomImage dcmImage(QDir::toNativeSeparators(dcmImagePath).toUtf8().data()); return this->generateThumbnail(&dcmImage, image); } //------------------------------------------------------------------------------ bool ctkDICOMThumbnailGenerator::generateThumbnail(const QString& dcmImagePath, const QString& thumbnailPath) { - DicomImage dcmImage(QDir::toNativeSeparators(dcmImagePath).toUtf8()); + DicomImage dcmImage(QDir::toNativeSeparators(dcmImagePath).toUtf8().data()); return this->generateThumbnail(&dcmImage, thumbnailPath); } diff --git a/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMImageTest1.cpp b/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMImageTest1.cpp index d16157dc34..4168a7be05 100644 --- a/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMImageTest1.cpp +++ b/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMImageTest1.cpp @@ -54,7 +54,7 @@ int ctkDICOMImageTest1( int argc, char * argv [] ) QString dicomFilePath(arguments.at(0)); - DicomImage dcmtkImage(QDir::toNativeSeparators(dicomFilePath).toUtf8()); + DicomImage dcmtkImage(QDir::toNativeSeparators(dicomFilePath).toUtf8().data()); ctkDICOMImage ctkImage(&dcmtkImage); QLabel qtImage; diff --git a/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMItemViewTest1.cpp b/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMItemViewTest1.cpp index 22ac42d3e3..190d1d19cd 100644 --- a/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMItemViewTest1.cpp +++ b/Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMItemViewTest1.cpp @@ -55,7 +55,7 @@ int ctkDICOMItemViewTest1( int argc, char * argv [] ) QString dicomFilePath(arguments.at(0)); - DicomImage img(QDir::toNativeSeparators(dicomFilePath).toUtf8()); + DicomImage img(QDir::toNativeSeparators(dicomFilePath).toUtf8().data()); QImage image; QImage image2(200, 200, QImage::Format_RGB32);