Skip to content

WIP: ENH: Increase itk::DCMTKFileReader class coverage#2796

Closed
jhlegarreta wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
jhlegarreta:AddDCMTKReaderGetDicomTagsTest
Closed

WIP: ENH: Increase itk::DCMTKFileReader class coverage#2796
jhlegarreta wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
jhlegarreta:AddDCMTKReaderGetDicomTagsTest

Conversation

@jhlegarreta
Copy link
Copy Markdown
Member

Add a new test to the IODCMTK module to increase the coverage of the
itk::DCMTKFileReader::GetElement* methods.

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Added license to new files (if any)

@github-actions github-actions Bot added area:IO Issues affecting the IO module type:Coverage Code coverage impacts type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct labels Oct 9, 2021
@jhlegarreta
Copy link
Copy Markdown
Member Author

jhlegarreta commented Oct 10, 2021

A few notes:

  • I know the module gets less use than GDCM, but if it is in the toolkit, it should get some more testing.
  • I could not compile the DCTMK test module:
Build started...
1>------ Build started: Project: ITKIODCMTKTestDriver, Configuration: Debug x64 ------
1>itkDCMTKGetDicomTagsTest.cxx
1>C:\SDKs\ITK\itk-head\ITK\Modules\IO\DCMTK\include\itkDCMTKFileReader.h(27,10): fatal error C1083:
Cannot open include file: 'dcmtk/dcmdata/dcdict.h': No such file or directory
1>Done building project "ITKIODCMTKTestDriver.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Using the built-in DCMTK (i.e. not a system DCMTK) I cannot see where the error stems from. I do see the file on my build tree in \itk-head-Bin\Modules\ThirdParty\DCMTK\ITKDCMTK_ExtProject\dcmdata\include\dcmtk\dcmdata\dcdict.h

I submitted an experimental build to see if that helps other folks to try to reproduce the issue:
https://open.cdash.org/build/7503588

Thus, I could not compile and run the test to see its errors.

Not sure if the CIs have the module flag set to On so they may come up green.

  • Not sure if the test name is the most appropriate one. Suggestions are welcome.
  • I did not found non-empty tags in the used DICOM data to exercise other methods like, GetElementCSorOB, etc. Adding another test that uses another set of DICOM data could allow querying such elements/exercising those methods. Best would be to make the test quantitative for that.
  • @thewtex In order to make the test quantitative, I'm wondering whether we have CMake-enabled ways to compare a potential txt output file with the read tags to a baseline with the expected tags. If not, do you have some suggestion?

@jhlegarreta jhlegarreta changed the title ENH: Increase itk::DCMTKFileReader class coverage WIP: ENH: Increase itk::DCMTKFileReader class coverage Oct 10, 2021
@jhlegarreta jhlegarreta marked this pull request as draft October 10, 2021 01:19
Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the test quantitative would be good, but that can be a follow-up commit. This is good as-is.

@jhlegarreta
Copy link
Copy Markdown
Member Author

Making the test quantitative would be good, but that can be a follow-up commit. This is good as-is.

Sounds reasonable. Note that I have not been able to compile the module, and hence nor I have tested it, and I would not merge this until it gets tested.

The CI builds did not set the module to ON, and thus, even if they have come green, it might well be the case that the test does not compile/pass:

2021-10-10T01:29:38.0772539Z 595: //Request building ITKIODCMTK (non-remote)
2021-10-10T01:29:38.0773102Z 595: Module_ITKIODCMTK:BOOL=OFF

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Oct 11, 2021

I will test it locally and report back.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Oct 11, 2021

It fails to compile for me too:

7>itkDCMTKGetDicomTagsTest.cxx
7>C:\Dev\ITK-git\Modules\IO\DCMTK\include\itkDCMTKFileReader.h(27,10): fatal error C1083: Cannot open include file: 'dcmtk/dcmdata/dcdict.h': No such file or directory

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Oct 11, 2021

The offending file is located in C:\Dev\ITK-2019\Modules\ThirdParty\DCMTK\ITKDCMTK_ExtProject\dcmdata\include\dcmtk\dcmdata\dcdict.h, and the only mention of DCMTK in additional include directories is C:\Dev\ITK-git\Modules\IO\DCMTK\include.

@jhlegarreta
Copy link
Copy Markdown
Member Author

and the only mention of DCMTK in additional include directories is C:\Dev\ITK-git\Modules\IO\DCMTK\include

Meaning that including the directory is missing in the CMakeLists.txt file?

I did try to add it manually to my MSVC properties, but it did not solve the problem. But maybe I did not do it appropriately.

Also, Brad's AWS build tests the module, so it would be weird that this should not happen on Linux:
https://open.cdash.org/build/7505424/notes

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Oct 11, 2021

ITKDCMTK_INCLUDE_DIRS seems to have appropriate dirs, being C:/Dev/ITK-2019/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/dcmdata/include;.... Manually adding the first entry to Visual Studio project ITKIODCMTKTestDriver, changes the error to:

5>------ Build started: Project: ITKIODCMTKTestDriver, Configuration: RelWithDebInfo x64 ------
5>itkDCMTKGetDicomTagsTest.cxx
5>C:\Dev\ITK-2019\Modules\ThirdParty\DCMTK\ITKDCMTK_ExtProject\dcmdata\include\dcmtk/dcmdata/dcdict.h(26,10): fatal error C1083: Cannot open include file: 'dcmtk/config/osconfig.h': No such file or directory
5>itkDCMTKImageIOTest.cxx
5>itkDCMTKImageIONoPreambleTest.cxx
5>Generating Code...
5>Done building project "ITKIODCMTKTestDriver.vcxproj" -- FAILED.

Adding the entire content of ITKDCMTK_INCLUDE_DIRS to VS project gets it "building":

2>------ Build started: Project: ITKIODCMTKTestDriver, Configuration: RelWithDebInfo x64 ------
2>ITKIODCMTKTestDriver.cxx
2>itkDCMTKGetDicomTagsTest.cxx
2>C:\Dev\ITK-2019\Modules\ThirdParty\DCMTK\ITKDCMTK_ExtProject-build\config\include\dcmtk/config/arith.h(1,1): warning C4335: Mac file format detected: please convert the source file to either DOS or UNIX format
2>C:\Dev\ITK-git\Modules\IO\DCMTK\include\itkDCMTKFileReader.h(307,1): error C2440: 'static_cast': cannot convert from 'T' to 'TType'
2>        with
2>        [
2>            T=Float64
2>        ]
2>        and
2>        [
2>            TType=std::string
2>        ]
2>C:\Dev\ITK-git\Modules\IO\DCMTK\include\itkDCMTKFileReader.h(307,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
2>C:\Dev\ITK-git\Modules\IO\DCMTK\test\itkDCMTKGetDicomTagsTest.cxx(92): message : see reference to function template instantiation 'int itk::DCMTKFileReader::GetElementDS<std::string>(const unsigned short,const unsigned short,unsigned short,TType *,const bool) const' being compiled
2>        with
2>        [
2>            TType=std::string
2>        ]
2>itkDCMTKImageIOTest.cxx
2>itkDCMTKRGBImageIOTest.cxx
2>itkDCMTKSeriesReadImageWrite.cxx
2>itkDCMTKSeriesStreamReadImageWrite.cxx
2>itkDCMTKImageIOOrthoDirTest.cxx
2>itkDCMTKMultiFrame4DTest.cxx
2>itkDCMTKLoggerTest.cxx
2>itkDCMTKImageIOSlopeInterceptTest.cxx
2>itkDCMTKImageIOMultiFrameImageTest.cxx
2>itkDCMTKImageIONoPreambleTest.cxx
2>Generating Code...
2>Done building project "ITKIODCMTKTestDriver.vcxproj" -- FAILED.

I don't know where the fix needs to be applied, but it is almost certainly somewhere in ITK's DCMTK-related CMake code.

@jhlegarreta jhlegarreta added the status:Blocked Blocked by some other issue which needs to be resolved first or by some other cause label Oct 15, 2021
@stale
Copy link
Copy Markdown

stale Bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale Bot added the status:Use_Milestone_Backlog Use "Backlog" milestone instead of label for issues without a fixed deadline label Apr 16, 2022
@jhlegarreta
Copy link
Copy Markdown
Member Author

This is still relevant stale bot. I am willing to take up this as soon as #2817 gets resolved.

@stale stale Bot removed the status:Use_Milestone_Backlog Use "Backlog" milestone instead of label for issues without a fixed deadline label Apr 16, 2022
Comment thread Modules/IO/DCMTK/test/itkDCMTKGetDicomTagsTest.cxx Outdated
// Acquisition Duration
group = 0x0019;
element = 0x105a;
// Expect 1304791694
Copy link
Copy Markdown
Member

@issakomi issakomi Nov 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, my viewer and also dcmdump show
(0019,105a) FL 414273984 # 4, 1 AcquisitionDuration
not 1304791694. Somehow strange values for float, there may be an issue in the file.

Copy link
Copy Markdown
Member Author

@jhlegarreta jhlegarreta Nov 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, my viewer and also dcmdump show
(0019,105a) FL 414273984 # 4, 1 AcquisitionDuration
not 1304791694. Somehow strange values for float, there may be an issue in the file.

Not sure where I got the value from :-S. I probably used an online viewer, which might not be fully trustworthy.

I am not able to build the module locally, so I was relying on an online tool rather than installing locally some library/tool. But I am willing to fix it if anybody can point me to a dependable tool that I could use to potentially get the accurate values for more tags.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also applicable to all private tags in the test, it is correct to access private tags (odd group) using private creator, not just by group and element.

Can you elaborate on this? If there is a better way to access the tags, I may have a look to also add them (?).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular tag is also known for DCMTK (is in private dictionary), so it is OK.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to build the module locally, so I was relying on an online tool rather than installing locally some library/tool.

I have no problem with Linux build and internal DCMTK. I remember with external and at least static libraries there were problems too, something with missing libraries (they were there, but not found).

P.S.
I have to admit I am not experienced with DCMTK, actually I am testing it for PACS stuff, it seems to be clean and well maintained library.

Comment thread Modules/IO/DCMTK/test/itkDCMTKGetDicomTagsTest.cxx Outdated
@jhlegarreta jhlegarreta force-pushed the AddDCMTKReaderGetDicomTagsTest branch from 38bea5f to 73c450e Compare November 5, 2022 16:43
@github-actions github-actions Bot removed the type:Enhancement Improvement of existing methods or implementation label Nov 5, 2022
@jhlegarreta
Copy link
Copy Markdown
Member Author

jhlegarreta commented Nov 6, 2022

Making the test quantitative would be good, but that can be a follow-up commit. This is good as-is.

I may give a go at this. If the module is turned on by the CIs, they'll tell about the tag contents. I'd think of two ways to make this quantitative:

  • Write the expected tag values to a text file, provide it as the input to the test, read each line and compare each value with the value read from the DICOM files.
  • Write the values read from the DICOM files to a text file, provide a text file with the expected tag values as a baseline to CMake, and let it do the comparison job.

If the latter is possible, it involves less code, and allows for improvements (e.g. reading/comparing more tags) without minimal changes to the test code.

@dzenanz Wondering whether the CMake compare is able to compare two text files (i.e. without using the content links).

@issakomi
Copy link
Copy Markdown
Member

issakomi commented Nov 6, 2022

DCMTK has own tests, BTW, there are some macros too e.g. OFCHECK_EQUAL
https://github.com/DCMTK/dcmtk/tree/master/dcmdata/tests

@jhlegarreta
Copy link
Copy Markdown
Member Author

DCMTK has own tests

👍 Here we are trying to make sure that ITK's DCMTK IO object reads what it is supposed to read.

BTW, there are some macros too e.g. OFCHECK_EQUAL
https://github.com/DCMTK/dcmtk/tree/master/dcmdata/tests

👍 Thanks Mihail.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Nov 7, 2022

CMake can compare files (syntax), but only binary comparison. It should work in this case, and it is less work to set up than read the file and compare ourselves. The downside is that error message will be "file are different", rather than more meaningful messages we can craft in the custom code. If you have time, you can go the custom comparison route. Otherwise let CMake compare the outputs.

P.S. I don't know how easy or hard it is to turn CMake -E compare_files into a test.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Nov 7, 2022

Slicer should be able to read DICOM tags.

@jhlegarreta
Copy link
Copy Markdown
Member Author

P.S. I don't know how easy or hard it is to turn CMake -E compare_files into a test.

Yes, that one I had found yesterday, but did not find out whether our compare argument does also accept text files.

@issakomi
Copy link
Copy Markdown
Member

issakomi commented Nov 8, 2022

FYI, some parts are too bad for testing and coverage, e.g. this function.
It takes Bits Allocated (0x0028, 0x0100) with wrong name SamplesPerPixel and assumes that if Bits Allocated is 8 or 16 it means that the image is scalar, otherwise RGB or VECTOR, it is wrong. RGB image has of course Bits Allocated 8 or 16 too and Samples per Pixel (0x0028,0x0002) 3. And e.g. 32 bits dose (RT) image is not a vector. Also Photometric Interpretation should be checked. There were some very very old ACR-NEMA images with bitsallocated 24 for RGB, extremely rare.

IOPixelEnum
DCMTKFileReader::GetImagePixelType() const
{
  unsigned short SamplesPerPixel;
  if (this->GetElementUS(0x0028, 0x0100, SamplesPerPixel, false) != EXIT_SUCCESS)
  {
    return IOPixelEnum::UNKNOWNPIXELTYPE;
  }
  IOPixelEnum pixelType;
  switch (SamplesPerPixel)
  {
    case 8:
    case 16:
      pixelType = IOPixelEnum::SCALAR;
      break;
    case 24:
      pixelType = IOPixelEnum::RGB;
      break;
    default:
      pixelType = IOPixelEnum::VECTOR;
  }
  return pixelType;
}

Edit:
this function is unused, pixel type is processed in ReadImageInformation (also with issues, but much better)

@jhlegarreta
Copy link
Copy Markdown
Member Author

@issakomi Thanks for the investigation. I'd be more than happy to add more test cases to test the relevant methods if the appropriate DICOM data can be shared.

@issakomi
Copy link
Copy Markdown
Member

issakomi commented Nov 8, 2022

@issakomi Thanks for the investigation. I'd be more than happy to add more test cases to test the relevant methods if the appropriate DICOM data can be shared.

I think i have mentioned a bug, better say forgotten garbage in DCMTKFileReader class.
There are many test files for GDCM tests. But i think they should be better tested manually first to get some knowledge of the class, e.g. we don't know does PALETTE_COLOR works or not.

The test is here, it is complete minimal standalone test. Not intended to be included in test suite.

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkDCMTKImageIO.h"
#include "itkDCMTKFileReader.h"
#include <iostream>

int main(int, char **)
{
  auto imageIO = itk::DCMTKImageIO::New();
  imageIO->SetFileName("../data/raw-RGB.dcm");
  try
  {
    imageIO->ReadImageInformation();
  }
  catch (const itk::ExceptionObject & ex)
  {
    std::cout << ex.GetDescription() << std::endl;
  }
  itk::IOPixelEnum pixel_type1 = imageIO->GetPixelType();
  std::cout << "DCMTKImageIO reported Pixel Type  "
    << imageIO->GetPixelTypeAsString(pixel_type1)
    << std::endl;

  // GetImagePixelType() is unused garbage
  itk::DCMTKFileReader dcmtkFileReader;
  dcmtkFileReader.SetFileName("../data/raw-RGB.dcm");
  dcmtkFileReader.LoadFile();
  itk::IOPixelEnum pixel_type2 = dcmtkFileReader.GetImagePixelType();
  std::cout << "DCMTKFileReader reported Pixel Type  "
    << imageIO->GetPixelTypeAsString(pixel_type2)
    << std::endl;
  return 0;
}
DCMTKImageIO reported Pixel Type  rgb
DCMTKFileReader reported Pixel Type  scalar

Sorry, but i am out and will not do any more work on DCMTK in the near future.

@jhlegarreta jhlegarreta force-pushed the AddDCMTKReaderGetDicomTagsTest branch from 73c450e to f3f3979 Compare November 9, 2022 00:55
}

// Image Pixel Type
IOPixelEnum pixelType = fileReader.GetImagePixelType();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetImagePixelType() is obviously too bad and should be fixed or even better removed from the class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ideal thing would be to fix it. If itk::DCMTKImageIO (maybe through itk::ImageIOBase) or the itk::DCMTKImageIO::ReadImageInformation are doing a better job in this, then part of the code might be valid for here (haven't looked). If we do not find a way to fix it, then it should be deprecated (and yet be tested so that at least its behavior is consistent) prior to being removed.

Copy link
Copy Markdown
Member

@issakomi issakomi Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

itk::DCMTKImageIO::ReadImageInformation is in fact OK, not ideal too, i don't like that SamplesPerPixel=4 is assumed to be RGBA, in fact it could be e.g. CMYK. But is really not important, currently there are no DICOM files with SamplesPerPixel=4 (CMYK, ARGB), they were deprecated long long ago. So in 99.999% ReadImageInformation works fine. There are more to test (manually first), e.g. how DCMKT handles YBR images, PALETTE_COLOR. Maybe later.

Copy link
Copy Markdown
Member

@issakomi issakomi Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and yet be tested so that at least its behavior is consistent) prior to being removed

test are always good, but not including known completely broken stuff into test suite, sorry. The test text files can not match too, sorry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all this insight. Will see when I get the time to push this, as I am still being blocked by #2817 to be able to properly do this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now blocked by #3820.

Comment thread Modules/IO/DCMTK/test/itkDCMTKGetDicomTagsTest.cxx
@jhlegarreta jhlegarreta force-pushed the AddDCMTKReaderGetDicomTagsTest branch from f3f3979 to 172680e Compare November 10, 2022 00:46
Add a new test to the `IODCMTK` module to increase the coverage of the
`itk::DCMTKFileReader::GetElement*` methods.
@hjmjohnson
Copy link
Copy Markdown
Member

Closing as superseded by #6189, which carries this work forward to a buildable, runnable state on current upstream/main.

The new PR addresses everything in this thread:

  • The 3.5-year-old blocker (Including itkDCMTKFileReader.h in a test file produces a compiler error #3820) is fixed in commit 1 of ENH: Add itkDCMTKGetDicomTagsTest, fix #3820 (supersedes #2796) #6189: a narrowly-scoped target_include_directories() on ITKIODCMTKTestDriver that pulls in the DCMTK ExternalProject's include dirs without changing the IODCMTK module's public DEPENDS surface. Tests can now #include "itkDCMTKFileReader.h" directly.
  • All of @issakomi's specific concerns are addressed:
    • The unsigned short = "????" compile error → rewritten
    • The 1304791694 wrong-by-transcription value → corrected to actual 414273984.0 (verified against the on-disk fixture with pydicom before authoring)
    • PhotometricInterpretation now read as CS string "MONOCHROME2" instead of unsigned short
    • The buggy GetImagePixelType() test was dropped per @malaterre's earlier feedback that the method itself is questionable
  • Structural problems (3 duplicate itk_add_test names, comma-list-to-argv[1] mismatch, wholesale gersemi reformat) → all resolved
  • Test now passes locally on macOS in 3.59s — pre-commit run --all-files exits 0

The two test invocations targeting RGBDicomSeries/raw-RGB.dcm and RTDoseDicomSeries/32bitDoseRTImage.dcm are dropped because those fixtures were never published to ITKTestingData. The Input/DicomSeries/Image0075.dcm invocation is preserved and exercises 13 distinct GetElement* accessors.

@jhlegarreta — your authorship of the original test concept is preserved via Co-Authored-By: trailers on the new commits. Thanks for opening this in 2021 even when the build couldn't yet support it. @issakomi — your review feedback shaped the corrected test; thank you.

Closing this PR; please follow the discussion on #6189.

@hjmjohnson hjmjohnson closed this May 2, 2026
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request May 2, 2026
…wareConsortium#3820)

The ITK module ITKIODCMTK declares ITKDCMTK as PRIVATE_DEPENDS so the
DCMTK headers do not leak through the toolkit's public include
surface.  But the public header itkDCMTKFileReader.h transitively
#includes <dcmtk/dcmdata/dcdict.h>, so any test file that includes
itkDCMTKFileReader.h fails to compile with:

  fatal error: 'dcmtk/dcmdata/dcdict.h' file not found

This blocked PR InsightSoftwareConsortium#2796 from landing for over three years and is
tracked as issue InsightSoftwareConsortium#3820.

Add a narrowly-scoped target_include_directories() block in
Modules/IO/DCMTK/test/CMakeLists.txt that adds the DCMTK
ExternalProject's per-library include dirs and the generated
configuration header dir to ITKIODCMTKTestDriver only.  No change
to the public DEPENDS surface of the IODCMTK module --- only the
test driver target acquires the additional include paths.

When ITK is built with ITK_USE_SYSTEM_DCMTK=ON the system-installed
DCMTK headers are already on the default search path, so the block
is gated behind NOT ITK_USE_SYSTEM_DCMTK.
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request May 2, 2026
Add a test that exercises every well-formed VR-typed accessor on
itk::DCMTKFileReader against the existing fixture
Input/DicomSeries/Image0075.dcm:

  GetElementDA  StudyDate
  GetElementTM  StudyTime
  GetElementPN  PatientName
  GetElementCS  PatientSex, PhotometricInterpretation
  GetElementDS  PatientWeight
  GetElementIS  EchoNumber
  GetElementFL  AcquisitionDuration (private GE tag)
  GetElementSL  LocsPer3DSlab (private GE tag)
  GetElementUS  SamplesPerPixel, Rows, BitsAllocated
  GetElementUI  ScannerStudyEntityUID

Expected values were verified out-of-band with pydicom against the
on-disk fixture before authoring, fixing several wrong-by-transcription
expectations from the original PR InsightSoftwareConsortium#2796 (e.g. AcquisitionDuration was
recorded there as 1304791694, the integer reinterpretation of the float
bit pattern; the actual scanner-reported FL value is 414273984.0).

Each tag is asserted in-process via ITK_TEST_EXPECT_EQUAL; the test
also writes one tag-value-per-line to argv[2] for diagnostic inspection.
The in-process assertions are the source of truth for correctness, so
no --compare baseline file is needed.

The fixture is the single slice Image0075.dcm rather than the
DicomSeries regex; the test reads exactly one file via SetFileName,
not a series.  Two further test invocations proposed by PR InsightSoftwareConsortium#2796
(against RGBDicomSeries/raw-RGB.dcm and
RTDoseDicomSeries/32bitDoseRTImage.dcm) are dropped for now because
those fixtures were never published to ITKTestingData.

Supersedes PR InsightSoftwareConsortium#2796.

Co-Authored-By: jhlegarreta <jon.haitz.legarreta@gmail.com>
@jhlegarreta jhlegarreta deleted the AddDCMTKReaderGetDicomTagsTest branch May 3, 2026 07:57
hjmjohnson added a commit that referenced this pull request May 3, 2026
ENH: Add itkDCMTKGetDicomTagsTest, fix #3820 (supersedes #2796)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module status:Blocked Blocked by some other issue which needs to be resolved first or by some other cause type:Coverage Code coverage impacts type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants