Page MenuHomePhabricator

Wrong dimension initialization in mitk::Image::Initialze()
Closed, ResolvedPublic

Description

In the initialization method
void mitk::Image::Initialize(const mitk::PixelType& type, const mitk::Geometry3D& geometry, unsigned int channels, int tDim )

the dimension of the image is set to 2 by default ( cf. line 803) and increased to 3 only if dimensio[2] is bigger 1 (line 804).
However, an image with z dimension one is a three dimensional image as well, therefor the if case should be >= 1 instead of > 1.

Event Timeline

According to MITK group meeting the prefered solution for this bug is to change the Initialize() method in the clone method to guarantee correct initialization of the image dimension.

[8fad91]: Merge branch 'bug-11058-Correct2DImageInit'

Merged commits:

2012-03-21 15:23:23 Sven Mersmann [945e10]
Changed the initialize method in the clone image method. Added test case to guarantee that the dimensionality of the clone image is equivalent to that of the source image


2012-03-21 14:45:24 Sven Mersmann [4b17df]
temp commit