Skip to content

Commit ac1ebe6

Browse files
authored
Merge pull request #4521 from thewtex/gdcm-sc-image-metadata
GDCM Secondary Capture spatial metadata
2 parents 4d75072 + 8eb077a commit ac1ebe6

30 files changed

+292
-61
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ CMakeLists.txt whitespace=tab-in-indent,no-lf-at-eof our-cmake-style
5252
Modules/Numerics/FEM/src/dsrc2c.c hooks-max-size=260000
5353
Modules/ThirdParty/** hooks-max-size=300000 hooks.style=
5454
Modules/ThirdParty/ZLIB/src/itkzlib-ng/crc32_braid_tbl.h hooks-max-size=700000
55+
Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary/privatedicts.xml hooks-max-size=400000
5556
Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx hooks-max-size=120000
5657
Documentation/docs/releases/* hooks-max-size=300000
5758

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bafybeiai2acs4g7k6aeneziwgi3tw2i33idmnzclpyh4mt4dqvgktca7gu

Modules/IO/DCMTK/test/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ itk_add_test(
182182
DATA{${ITK_DATA_ROOT}/Input/RGBDicomTest.dcm}
183183
${ITK_TEST_OUTPUT_DIR}/itkDCMTKColorImage.png)
184184

185+
itk_add_test(
186+
NAME
187+
itkDCMTKRGBImageIOColorImageSpatialMetadataTest
188+
COMMAND
189+
ITKIODCMTKTestDriver
190+
--compare
191+
DATA{Baseline/itkDCMTKColorImageSpatialMetadata.nrrd}
192+
${ITK_TEST_OUTPUT_DIR}/itkDCMTKColorImageSpatialMetadata.nrrd
193+
itkDCMTKRGBImageIOTest
194+
DATA{Input/visible-male-rgb-slice.dcm}
195+
${ITK_TEST_OUTPUT_DIR}/itkDCMTKColorImageSpatialMetadata.nrrd)
196+
185197
itk_add_test(
186198
NAME
187199
ITKDCMTKLoggerTest
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bafybeiadtxwvshbmde3aywkzlzcudcoxypafxrshabby6gmdmtawapjzre

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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bafybeib67xvtf44xwu4rxapchxqjflfutheq3wja47qvniz4gdwrqkqujy

Modules/IO/GDCM/test/CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,19 @@ itk_add_test(
278278
${ITK_TEST_OUTPUT_DIR}/itkGDCMImageReadWriteTest_RGB.mha
279279
rgb)
280280

281+
itk_add_test(
282+
NAME
283+
itkGDCMImageReadWriteTest_SC_RGB
284+
COMMAND
285+
ITKIOGDCMTestDriver
286+
--compare
287+
DATA{Baseline/itkGDCMImageReadWriteTest_SC_RGB.nrrd}
288+
${ITK_TEST_OUTPUT_DIR}/itkGDCMImageReadWriteTest_SC_RGB.nrrd
289+
itkGDCMImageReadWriteTest
290+
DATA{Input/visible-male-rgb-slice.dcm}
291+
${ITK_TEST_OUTPUT_DIR}/itkGDCMImageReadWriteTest_SC_RGB.nrrd
292+
rgb)
293+
281294
itk_add_test(
282295
NAME
283296
itkGDCM_ComplianceTestRGB_JPEG2000ICT
@@ -397,7 +410,7 @@ function(AddComplianceTest fileName)
397410
--compareCoordinateTolerance
398411
0.001
399412
--compare
400-
DATA{Baseline/Lily.png}
413+
DATA{Baseline/Lily.mha}
401414
${ITK_TEST_OUTPUT_DIR}/itkGDCM_ComplianceTestRGB_${fileName}.mha
402415
itkGDCMImageReadWriteTest
403416
DATA{Input/Lily/${fileName}.dcm}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bafybeiadtxwvshbmde3aywkzlzcudcoxypafxrshabby6gmdmtawapjzre

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)