Page MenuHomePhabricator

VolumeMapperVtkSmart3D illegaly changes spacing of every mitk::Image's vtkImageData to (1, 1, 1)
Closed, ResolvedPublic

Assigned To
Authored By
kislinsk
Jan 11 2018, 10:56 AM
Referenced Files
F940476: BreakableFlickeringIsabellinewheatear.webm
Jan 11 2018, 11:06 AM
Tokens
"Party Time" token, awarded by thomass."Manufacturing Defect?" token, awarded by goch."The World Burns" token, awarded by kislinsk.

Description

It's early January and we already have a promising candidate for the nastiest bug of the year. @goch and I basically wasted a man week in figuring out, why the heck "Create Polygon Model" creates wrongly scaled surfaces for images with spacings other than (1, 1, 1), but after running the segmentation 3D interpolation on the image it magically works.

Turned out the magic code line after which the surface creation works is something like image->SetVolume(image->GetData()). It took a while to figure out that while everything is the same as before the spacing of the image's vtkImageData is now correct again. The spacing is also correct when loading the image into MITK.

The always-active, sneaky VolumeMapperVtkSmart3D however const cast the hell out the image shortly afterwards to illegaly change the spacing of the vtkImageData and only of the vtkImageData. What a mess...

I added a vtkImageChangeInformation filter to VolumeMapperVtkSmart3D instead.