Skip to content

Commit

Permalink
COMP: Add GDCM system version check for SetSecondaryCaptureImagePlane…
Browse files Browse the repository at this point in the history
…Module

This has not been released in GDCM, yet. Avoid build errors for a system
GDCM. There will be a difference in behavior, which will be flagged with
failing tests.

Co-authored-by: Mihail Isakov <[email protected]>
  • Loading branch information
thewtex and issakomi committed Apr 20, 2024
1 parent f383fe0 commit f4e9b0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Modules/IO/GDCM/src/itkGDCMImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,12 @@ GDCMImageIO::Read(void * pointer)
inputFileStream.close();

itkAssertInDebugAndIgnoreInReleaseMacro(gdcm::ImageHelper::GetForceRescaleInterceptSlope());
// Only available in newer versions
#if (!defined(ITK_USE_SYSTEM_GDCM) || \
((GDCM_MAJOR_VERSION == 3 && GDCM_MINOR_VERSION == 0 && GDCM_BUILD_VERSION > 23) || GDCM_MAJOR_VERSION > 3))
// Secondary capture image orientation patient and image position patient support
itkAssertInDebugAndIgnoreInReleaseMacro(gdcm::ImageHelper::GetSecondaryCaptureImagePlaneModule());
#endif
gdcm::ImageReader reader;
reader.SetFileName(m_FileName.c_str());
if (!reader.Read())
Expand Down Expand Up @@ -450,8 +454,12 @@ GDCMImageIO::InternalReadImageInformation()

// In general this should be relatively safe to assume
gdcm::ImageHelper::SetForceRescaleInterceptSlope(true);
// Only available in newer versions
#if (!defined(ITK_USE_SYSTEM_GDCM) || \
((GDCM_MAJOR_VERSION == 3 && GDCM_MINOR_VERSION == 0 && GDCM_BUILD_VERSION > 23) || GDCM_MAJOR_VERSION > 3))
// Secondary capture image orientation patient and image position patient support
gdcm::ImageHelper::SetSecondaryCaptureImagePlaneModule(true);
#endif

gdcm::ImageReader reader;
reader.SetFileName(m_FileName.c_str());
Expand Down

0 comments on commit f4e9b0b

Please sign in to comment.