Page MenuHomePhabricator

mitkImagePixelReadAccessor cannot be instanciated due to typos
Closed, ResolvedPublic

Description

Two Problems:

mitkImagePixelReadAccessor.h Line 90 and following:

"PixelAccessorType" is not defined. It should be "ImagePixelAccessorType". It's a Typo.

When you create a imagePixelReadAccessor, you will get the exception “Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal”, even though the pixeltypes are the same.

Problem is mitkImagePixelReadAccessor.h Line 80:

if(!( m_ReadAccessor.m_Image->GetPixelType() != mitk::MakePixelType<itk::Image<TPixel, VDimension> >()) )

{
  mitkThrow() << "Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal";
}

In the if-statement the != should actually be a ==. Also a Typo.

Event Timeline

New remote branch pushed: bug-13883-imageAccessor

Your fix looks good, although it was very well hidden in the patch that contained lots of formatting changes.. Would be preferrable if such changes are separated into a second commit.

[9a1b42]: Merge branch 'bug-13883-imageAccessor'

Merged commits:

2012-12-05 14:24:33 Bastian Graser [e3af41]
Corrected Typo and updated Test

[57e31e]: Merge branch 'bug-13883-imageAccessor'

Merged commits:

2012-12-06 16:04:55 Bastian Graser [96a0f3]
COMP typedef of base class not available on linux

[db342d]: Merge branch 'bug-13883-imageAccessor'

Merged commits:

2012-12-06 16:18:33 Bastian Graser [091e85]
COMP added typedef from base class to derived class