Skip to content
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
12 changes: 6 additions & 6 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
artifact: 'build/inviwo-v*.dmg'

- system: linux
os: 'ubuntu-24.04'
os: 'ubuntu-26.04'
targets: 'all'
installer: 'inviwo-installer-linux'
artifact: 'build/inviwo-v*.AppImage'
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
pull-requests: write
env:
LLVM_VERSION: 19
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
timeout-minutes: 320
steps:

Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
name: "Test Installer Linux"
needs: build

runs-on: ubuntu-latest
runs-on: ubuntu-26.04
steps:
- name: "Download artifact"
uses: actions/download-artifact@v7
Expand Down Expand Up @@ -668,7 +668,7 @@ jobs:

create-changelog:
name: "Create Changelog"
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
steps:
- name: "Generate Changelog"
id: changelog
Expand Down Expand Up @@ -696,7 +696,7 @@ jobs:
if: github.ref == 'refs/heads/master'
needs: [build, test-installer-windows, test-installer-macos, test-installer-linux, regression]

runs-on: ubuntu-latest
runs-on: ubuntu-26.04
steps:
- name: "Clone Inviwo"
uses: actions/checkout@v6
Expand Down Expand Up @@ -739,7 +739,7 @@ jobs:
name: "Update latest release"
if: github.ref == 'refs/heads/master'
needs: [build, test-installer-windows, test-installer-macos, test-installer-linux, regression, create-changelog]
runs-on: ubuntu-latest
runs-on: ubuntu-26.04

steps:
- name: "Download installer"
Expand Down
6 changes: 3 additions & 3 deletions medvis/dicom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ivw_group("Source Files" ${SOURCE_FILES})
ivw_create_module(${SOURCE_FILES} ${HEADER_FILES})

find_package(TIFF REQUIRED)
find_package(gdcm CONFIG REQUIRED)
find_package(GDCM CONFIG REQUIRED)

target_link_libraries(inviwo-module-dicom
PUBLIC
Expand All @@ -48,8 +48,8 @@ target_link_libraries(inviwo-module-dicom
PRIVATE
TIFF::TIFF
)
target_include_directories(inviwo-module-dicom PUBLIC gdcm)
ivw_vcpkg_install(gdcm MODULE DICOM)
target_include_directories(inviwo-module-dicom PUBLIC GDCM)
ivw_vcpkg_install(GDCM MODULE DICOM)

#--------------------------------------------------------------------
ivw_make_package(InviwoDICOMModule inviwo-module-dicom)
40 changes: 18 additions & 22 deletions medvis/dicom/src/datastructures/dicomdirtypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void Image::updateInfo(const gdcm::DataSet& dataset) {
// Pixel Spacing https://dicom.innolitics.com/ciods/ct-image/image-plane/00280030
gdcm::Attribute<0x0028, 0x0030> pixelSpacingAttr{{1.0, 1.0}};
pixelSpacingAttr.Set(dataset);
pixelSpacing = gdcmutil::toGlmVec<3>(pixelSpacingAttr.GetValues());
pixelSpacing = dvec3{gdcmutil::toGlmVec<2>(pixelSpacingAttr.GetValues()), 0.0};

updateZpos();
}
Expand Down Expand Up @@ -185,20 +185,19 @@ void Series::updateImageInformation(const std::filesystem::path& dicompath) {
auto sanityCheck = [&](const ImageMetaData& ref, const ImageMetaData& img) {
if (ref.dims != img.dims) {
throw DataReaderException(
fmt::format(
"image sizes differ in DICOM series '{}', expected {} but found {} ('{}')",
desc, toString(ref.dims), toString(img.dims), dicompath),
IVW_CONTEXT);
SourceContext{},
"image sizes differ in DICOM series '{}', expected {} but found {} ('{}')", desc,
toString(ref.dims), toString(img.dims), dicompath);
}
if (ref.pixelformat != img.pixelformat) {
throw DataReaderException(
fmt::format("pixel formats differ in DICOM series '{}' ('{}')", desc, dicompath),
IVW_CONTEXT);
throw DataReaderException(SourceContext{},
"pixel formats differ in DICOM series '{}' ('{}')", desc,
dicompath);
}
if (!ref.photometric.IsSameColorSpace(img.photometric)) {
throw DataReaderException(
fmt::format("photometric info differ in DICOM series '{}' ('{}')", desc, dicompath),
IVW_CONTEXT);
throw DataReaderException(SourceContext{},
"photometric info differ in DICOM series '{}' ('{}')", desc,
dicompath);
}
const double dicomDelta = 1.0e-4;
if (std::abs(ref.slope - img.slope) > dicomDelta ||
Expand Down Expand Up @@ -232,10 +231,9 @@ void Series::updateImageInformation(const std::filesystem::path& dicompath) {
continue;
}
if (!imageReader.Read()) {
throw DataReaderException(
fmt::format("could not read image '{}' in DICOM series '{}' ('{}')", imgInfo.path,
desc, dicompath),
IVW_CONTEXT);
throw DataReaderException(SourceContext{},
"could not read image '{}' in DICOM series '{}' ('{}')",
imgInfo.path, desc, dicompath);
}

imgInfo.updateInfo(imageReader);
Expand All @@ -249,19 +247,17 @@ void Series::updateImageInformation(const std::filesystem::path& dicompath) {
}

if (warnSlopeIntercept) {
LogWarn(
fmt::format("varying slopes/intercepts in DICOM series '{}' ('{}')", desc, dicompath));
log::warn("varying slopes/intercepts in DICOM series '{}' ('{}')", desc, dicompath);
}
if (warnPixelSpacing) {
LogWarn(fmt::format("pixel spacings differ in DICOM series '{}', expected {} ('{}')", desc,
toString(refImage.pixelSpacing), dicompath));
log::warn("pixel spacings differ in DICOM series '{}', expected {} ('{}')", desc,
toString(refImage.pixelSpacing), dicompath);
}
if (warnOrientation) {
LogWarn(
fmt::format("image orientations differ in DICOM series '{}' ('{}')", desc, dicompath));
log::warn("image orientations differ in DICOM series '{}' ('{}')", desc, dicompath);
}
if (warnOrigin) {
LogWarn(fmt::format("origins differ in DICOM series '{}' ('{}')", desc, dicompath));
log::warn("origins differ in DICOM series '{}' ('{}')", desc, dicompath);
}

util::erase_remove_if(images, [](dicomdir::Image& image) { return image.empty(); });
Expand Down
16 changes: 7 additions & 9 deletions medvis/dicom/src/errorlogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include <string>
#include <exception>
#include <ios>
#include <streambuf>
#include <ostream>
#include <iostream>
Expand Down Expand Up @@ -78,21 +77,20 @@ class StreambufLineout : public std::streambuf {
if (ch == '\n') {
if (!buffer.empty()) {
// at the end of a line we want to pass the message to Inviwo's logging system
inviwo::LogCentral::getPtr()->log("Gdcm Volume Importer", loglevel,
LogAudience::User, "<GDCM library>", "", 0,
buffer);
LogCentral::getPtr()->log("Gdcm Volume Importer", loglevel, LogAudience::User,
"<GDCM library>", "", 0, buffer);
}
buffer.clear();
} else if (!Traits::eq_int_type(ch, Traits::eof())) {
buffer.push_back(static_cast<CharT>(ch));
}
} catch (std::exception& ex) {
} catch (const std::exception& ex) {
// error while logging, print what we've got so far
inviwo::LogCentral::getPtr()->log("Gdcm Volume Importer", loglevel, LogAudience::User,
"<GDCM library>", "", 0, buffer);
LogCentral::getPtr()->log("Gdcm Volume Importer", loglevel, LogAudience::User,
"<GDCM library>", "", 0, buffer);
buffer.clear();
// and tell the user what hargspened
LogError("Exception while logging Gdcm: " << ex.what());
// and tell the user what happened
log::error("Exception while logging Gdcm: {}", ex.what());
// return traits::eof on failure
return Traits::eof();
}
Expand Down
Loading
Loading