Manually creating a planegeometry an initializing an mitk::Image with it will result into an image with a geometry for which the IsImageGeometry flag is false.
Code snippet:
mitk::PlaneGeometry::Pointer planegeometry = mitk::PlaneGeometry::New(); planegeometry->InitializeStandardPlane(100, 100, right, bottom, &spacing); planegeometry->SetOrigin(origin); //initialize image imgMem->Initialize(pt, 40, *planegeometry);
This was found when creating test images for the ImageToItk test. The MITK_ASSERT_EQUAL( imgMem, imgAfterCast ) was failing because the geometry of the imgMem is marked as non-ImageGeometry.