Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building against DCMTK >= 3.6.7 #1224

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Libs/DICOM/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/ctkDICOMDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMImageTest1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMItemViewTest1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading