Page MenuHomePhabricator

BasicImageProcessing: resampling of images fails when arbitary redefine the new spacing
Closed, ResolvedPublic

Description

When resampling an image to an arbitrary new spacing the operation fails (on some data sets?) with an access violation.

The violation is coused in mitk::LevelWindow::SetAuto() (QmitkBasicImageProcessingView.cpp : 1015) when the new result image is passed. By inspection the image seems to be invalid because of null pointers in geometries and channels. Accessing the image for determining the min and max values causes the error.

The problem seems to be rooted in (QmitkBasicImageProcessingView.cpp : 991-995). There the image is valid, but it is "lost" when it leaves the "switch"-scope (which seems logical, regarding the chosen memory management style for itk importing).
Adding a clone statement to the importing line (like the other operations do) seem to fix the problem (see attached patch).

Event Timeline

User metzger has pushed new remote branch:

bug-17908-BasicImageProcessingResampleFix

[7ac4d5]: Merge branch 'bug-17908-BasicImageProcessingResampleFix'

Merged commits:

2015-01-29 13:23:28 Jasmin Metzger [753d22]
Fix by R. Floca