Skip to content

Commit f545dd8

Browse files
committed
ENH: Enable SecondaryCaptureImagePlaneModel in GDCM
This enables support for reading image orientation patient and image position patient from DICOM secondary capture images. This addresses needs such as reading Visible Human DICOM color images in 3D Slicer: NA-MIC/ProjectWeek#875 and reading highdicom derived secondary capture DICOM in ITK-Snap: ImagingDataCommons/highdicom#247 Update the RGB tests' baseline that were using a .png baseline because they now output spatial metadata.
1 parent 193a2ed commit f545dd8

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

Modules/IO/GDCM/src/itkGDCMImageIO.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ GDCMImageIO::Read(void * pointer)
286286
inputFileStream.close();
287287

288288
itkAssertInDebugAndIgnoreInReleaseMacro(gdcm::ImageHelper::GetForceRescaleInterceptSlope());
289+
// Secondary capture image orientation patient and image position patient support
290+
itkAssertInDebugAndIgnoreInReleaseMacro(gdcm::ImageHelper::GetSecondaryCaptureImagePlaneModule());
289291
gdcm::ImageReader reader;
290292
reader.SetFileName(m_FileName.c_str());
291293
if (!reader.Read())
@@ -454,6 +456,8 @@ GDCMImageIO::InternalReadImageInformation()
454456

455457
// In general this should be relatively safe to assume
456458
gdcm::ImageHelper::SetForceRescaleInterceptSlope(true);
459+
// Secondary capture image orientation patient and image position patient support
460+
gdcm::ImageHelper::SetSecondaryCaptureImagePlaneModule(true);
457461

458462
gdcm::ImageReader reader;
459463
reader.SetFileName(m_FileName.c_str());
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bafkreidhatfhe2gdne5k5pyw2rfvnuu3qmedytq7mrdjckmw6zrc5x3srq

Modules/IO/GDCM/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ function(AddComplianceTest fileName)
397397
--compareCoordinateTolerance
398398
0.001
399399
--compare
400-
DATA{Baseline/Lily.png}
400+
DATA{Baseline/Lily.mha}
401401
${ITK_TEST_OUTPUT_DIR}/itkGDCM_ComplianceTestRGB_${fileName}.mha
402402
itkGDCMImageReadWriteTest
403403
DATA{Input/Lily/${fileName}.dcm}

Modules/IO/ImageBase/src/itkIOConfigure.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#cmakedefine ITK_SUPPORTS_WCHAR_T_FILENAME_CSTYLEIO
2222
#cmakedefine ITK_SUPPORTS_WCHAR_T_FILENAME_IOSTREAMS_CONSTRUCTORS
2323
#cmakedefine ITK_SUPPORTS_FDSTREAM_HPP
24+
#cmakedefine ITK_USE_SYSTEM_GDCM
2425

2526
/*
2627
* Enable the pre-registration of factories for specific image file formats

0 commit comments

Comments
 (0)