Page MenuHomePhabricator

Handling of negative spacings in mitk::Image::InitializeByItkImage (for single slices)
Closed, ResolvedPublic

Description

With some DICOM series, reading a single slice via of such a series via ITK will produce negative spacing values for the third dimension.

As the third dimension spacing cannot be determined correctly for a single slice, GDCM interprets a tag that is not really reliable. In some cases this leads to a reported spacing that is correct except for its sign (-0.3 instead of 0.3).

I suggest to check for this special case in InitializeByItkImage and not output the loud MITK_ERROR message. Insted the spacing should be inverted and only logged to MITK_DEBUG.

See attached patch.

Event Timeline

I agree with the fix but would prefer MITK_WARN as error level for the output.

[SVN revision 26566]
FIX (#5593): handle spacing initialization by single slice ITK images better (see code comment)

(In reply to comment #0)

Created attachment 706 [details]
Proposed changes

With some DICOM series, reading a single ...

A little clarification on that one: Affects only MRImageStorage files that have a tag (0018,0088) SpacingBetweenSlices with a negative value.

Fix is now regularly verified by tests of ticket #3700