diff --git a/Documentation/Doxygen/DICOMLoadingTests.dox b/Documentation/Doxygen/DICOMLoadingTests.dox new file mode 100644 index 0000000000..02e701d432 --- /dev/null +++ b/Documentation/Doxygen/DICOMLoadingTests.dox @@ -0,0 +1,93 @@ +/** + +\page PageDICOMLoadingTests DICOM loading tests + +\section PageDICOMLoadingTests_intro Introduction + +Reading DICOM data into mitk::Images is a complicated business since DICOM and MITK have very different ideas of images. + +DicomSeriesReader brings DICOM and MITK as close together as possible by offering methods to load DICOM CT and MR images +into mitk::Images, optionally grouping slices to 3D+t images. + +Since there are so many possible sources for mistakes with any change to this loading process, testing the many +assumptions implemented in DicomSeriesReader is worthwhile. This document describes what kind of tests are implemented +and what how. + +\section PageDICOMLoadingTests_testing_procedure Test design + +The general idea for DICOM loaing tests is to run a set of known DICOM files through DicomSeriesReader's methods +GetSeries() and LoadDicomSeries() to generate mitk::Images. These images are then compared to expected image properties, +such as the number of individual mitk::Images, positions, orientations, spacings, etc. + +Stored expectations look like this (should be self-explanatory): +\verbatim +-- Image 1 +Pixeltype: s +BitsPerPixel: 16 +Dimension: 4 +Dimensions: 64 64 6 1 +Geometry: + Matrix: 5.25 0 0 0 5.2468 0.139598 0 -0.183222 3.99757 + Offset: -159.672 -309.974 -69.0122 + Center: 0 0 0 + Translation: -159.672 -309.974 -69.0122 + Scale: 1 1 1 + Origin: -159.672 -309.974 -69.0122 + Spacing: 5.25 5.25 4 + TimeBounds: 0 1 + +-- Image 2 +Pixeltype: s +BitsPerPixel: 16 +Dimension: 4 +Dimensions: 64 64 41 1 +Geometry: + Matrix: 5.25 0 0 0 5.25 0 0 0 4 + Offset: -160.672 -311.672 -285 + Center: 0 0 0 + Translation: -160.672 -311.672 -285 + Scale: 1 1 1 + Origin: -160.672 -311.672 -285 + Spacing: 5.25 5.25 4 + TimeBounds: 0 1 +\endverbatim + +Two simple applications are used to simplify this process: + - DumpDICOMMitkImage reads a list of files into mitk::Images and dumps a textual representation (as above) to standard output + - VerifyDICOMMitkImageDump reads a list of files into mitk::Images and compares them against a stored dump of image properties (generated by DumpDICOMMitkImage) + +\section PageDICOMLoadingTests_testcaseimplementation Test case implementation + +Individual test cases are stored in the MITK-Data repository and constructed by Core/Code/Testing/DICOMTesting/Testing/CMakeLists.txt + +The CMake file parses given directories for subdirectories containing specific test cases. Each directory contains two files: + - File "input": lists DICOM files that should be loaded for this test case + - File "expected.dump": contains the image properties in the above mentioned dump format + +Each test case is translated into a CTest test which evaluates the return value of a call to VerifyDICOMMitkImageDump. + +\section PageDICOMLoadingTests_testcases Implemented test cases + +From test set TinyCTAbdomen (see description.txt in this directory for details on test images): + + - singleslice : just a single slice (should work and contain meaningful spacing) + - two_slices : two slices, spacing should be calculated correctly + - all : load a "normal" series as a single 3D block + - 3D_and_T : load a small set of slices with multiple time-steps + - diff_orientation : load a set of files containing two differently oriented image blocks + - diff_orientation_gaps : load a set of files containing two differently oriented image blocks, each missing slices, so blocks must be split + - diff_spacing : load a set of files containint two set of slices with different spacings + - gap : load slices that cannot form a single 3D block, because single slices are missing + - gaps : slices missing in differnt locations, so multiple splits needed + - unsorted_gaps : as before, just file names are unsorted + - single_negative_spacing : from reported bug related to single MR images with misleading spacing information + - tilted_gantry : slice origins do not align along first slice normal (happens with tilted gantries) + + +\section PageDICOMLoadingTests_related_tests Related tests + +mitkDICOMLocaleTest : Verifies that DicomSeriesReader is able to parse float values with German locales (previous to this test, some implementation details would not recognize 0.15 as a float if the system had a German configuration) + +mitkDicomSeriesReaderTest : seems not to be called anymore?? + +*/