Page MenuHomePhabricator

mitkUSImageLoggingFilterTest tries to write JPEG images with inavlid pixel types
Closed, ResolvedPublic

Description

The mitkUSImageLoggingFilterTest seems to try to write image files to JPEG using incompatible pixel types. This error appeared with the new reader writer system. I have no idea yet why it seemed to work before. Maybe another ITK ImageIO class was used for writing. However, this points to a potential problem and should be fixed.

Temporarily disabling the test in the build system.

  1. test: mitkUSImageLoggingFilterTestSuite::TestJpgFileExtension (E)

uncaught exception of type mitk::Exception

  • /home/mbiuser/d c/MITK/Core/Code/IO/mitkIOUtil.cpp:830:

Exception occurred when writing to /tmp/2014100703091959673_Image_0.jpg:
/home/mbiuser/d c/MITK/Core/Code/Internal/mitkItkImageIO.cpp:476:
/home/mbiuser/d c/MITK-sb-R-c/ITK-src/Modules/IO/JPEG/src/itkJPEGImageIO.cxx:458:
itk::ERROR: JPEGImageIO(0x9cc3e10): JPEG supports unsigned char/int only

Event Timeline

User wildes has pushed new remote branch:

bug-18180-TestFixForJPEGWriterInUSImageLoggingFilterTest

In TestJpgFileExtension, SaveImages calles the function JPEGImageIO::Write(...).
This function works only with unsigned int or char. However, the test image created in mitkUSImageLoggingFilter is created as a random float.

The test can be easily fixed by changing the test image to an unsigned char. This is also the image type for common US images.

@Alfred: Is there any case, where an image needs to be a float image?

Otherwise, the pushed branch will fix this bug.

[6e627e]: Merge branch 'bug-18180-TestFixForJPEGWriterInUSImageLoggingFilterTest

Merged commits:

2014-11-12 14:29:48 Esther Wild [d286f1]
Changed Test image from float to unsigned char.

Saving image as JPEG does only work with char.