Skip to content

Commit

Permalink
Merge pull request #4601 from thewtex/gdcm-version-check
Browse files Browse the repository at this point in the history
COMP: Add GDCM system version check for SetSecondaryCaptureImagePlaneModule
  • Loading branch information
thewtex authored Apr 21, 2024
2 parents f383fe0 + f4e9b0b commit 596ed5f
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 596ed5f

Please sign in to comment.