Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::TestDICOMLoading Class Reference

Utility class for testing DICOM file loading and comparing loaded image properties. More...

#include <mitkTestDICOMLoading.h>

Public Types

typedef std::list< Image::Pointer > ImageList
 List of loaded image pointers. More...
 

Public Member Functions

 TestDICOMLoading ()
 
ImageList LoadFiles (const StringList &files)
 Load DICOM files and return the resulting images. More...
 
Image::Pointer DecorateVerifyCachedImage (const StringList &files, mitk::Image::Pointer cachedImage)
 Verify a cached image by decorating it with DICOM properties. More...
 
Image::Pointer DecorateVerifyCachedImage (const StringList &files, DICOMTagCache *tagCache, mitk::Image::Pointer cachedImage)
 Verify a cached image using a specific tag cache. More...
 
std::string DumpImageInformation (const Image *image)
 Dump relevant image information to a string for later comparison. More...
 
bool CompareImageInformationDumps (const std::string &reference, const std::string &test)
 Compare two image information dumps for equality. More...
 

Detailed Description

Utility class for testing DICOM file loading and comparing loaded image properties.

Provides methods to load DICOM files, dump image metadata to a string representation, and compare two metadata dumps for equality. Used in MITK's DICOM-related test suites to verify that DICOM loading produces expected results.

See also
DICOMFileReader

Definition at line 31 of file mitkTestDICOMLoading.h.

Member Typedef Documentation

◆ ImageList

typedef std::list<Image::Pointer> mitk::TestDICOMLoading::ImageList

List of loaded image pointers.

Definition at line 35 of file mitkTestDICOMLoading.h.

Constructor & Destructor Documentation

◆ TestDICOMLoading()

mitk::TestDICOMLoading::TestDICOMLoading ( )

Member Function Documentation

◆ CompareImageInformationDumps()

bool mitk::TestDICOMLoading::CompareImageInformationDumps ( const std::string &  reference,
const std::string &  test 
)

Compare two image information dumps for equality.

Performs a field-by-field comparison of two dumps produced by DumpImageInformation(), with tolerance for floating-point values.

Parameters
[in]referenceThe reference dump string.
[in]testThe test dump string to compare against the reference.
Returns
true if the dumps are sufficiently equal, false otherwise.
See also
DumpImageInformation

◆ DecorateVerifyCachedImage() [1/2]

Image::Pointer mitk::TestDICOMLoading::DecorateVerifyCachedImage ( const StringList &  files,
DICOMTagCache *  tagCache,
mitk::Image::Pointer  cachedImage 
)

Verify a cached image using a specific tag cache.

Parameters
[in]filesThe original file list.
[in]tagCacheThe DICOM tag cache to use for property lookup.
[in]cachedImageThe cached image to verify and decorate.
Returns
The decorated image.

◆ DecorateVerifyCachedImage() [2/2]

Image::Pointer mitk::TestDICOMLoading::DecorateVerifyCachedImage ( const StringList &  files,
mitk::Image::Pointer  cachedImage 
)

Verify a cached image by decorating it with DICOM properties.

Parameters
[in]filesThe original file list used to produce the cached image.
[in]cachedImageThe cached image to verify and decorate.
Returns
The decorated image.

◆ DumpImageInformation()

std::string mitk::TestDICOMLoading::DumpImageInformation ( const Image *  image)

Dump relevant image information to a string for later comparison.

Serializes geometry, pixel type, dimensions, and key DICOM properties of the image into a human-readable string format.

Parameters
[in]imageThe image to dump information for.
Returns
A string containing the serialized image information.
See also
CompareImageInformationDumps

◆ LoadFiles()

ImageList mitk::TestDICOMLoading::LoadFiles ( const StringList &  files)

Load DICOM files and return the resulting images.

Uses the internal DICOMFileReader to load the given files and returns a list of loaded Image objects.

Parameters
[in]filesList of file paths to load.
Returns
A list of loaded images (may be empty if loading fails).

The documentation for this class was generated from the following file: