vtkImageFlip broken on 32-bit Linux Release builds
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
We are getting incorrect results when using vtkImageFlip on optimized (Release) 32-bit Linux builds. When we use our vtkFreeSurferReader (which uses vtkImageFlip) to read in a MRI volume, we see noise in the image, banding in the slices, and the slices are ordered incorrectly. If we comment out the line with the vtkImageFlip, we have an upside down, but otherwise correct volume.
We have been able to replicate this problem consistently on these two machines:
Linux 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux Red Hat Enterprise Linux WS release 4 (Nahant) gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
Linux 2.6.15 #1 SMP PREEMPT Fri Feb 17 17:54:06 EST 2006 i686 unknown unknown GNU/Linux Slackware 10.2.0 gcc (GCC) 3.4.5
We are using the Slicer-2-6 tagged VTK.
Here is a tcl script that demonstrates the problem. The expected output is 3 windows with white circles. The first one has the circle in the lower left, and the other two have it in the lower right. The middle one should be corrupted on a platform with the bad flipper. I have attached a file with a screenshot of the incorrect behavior that we are seeing.
We have been unable to replicate this bug with a Debug build on either 32 or 64 bit Linux, and both Debug and Release builds on 64 bit Linux seem to work fine.
Test script
foreach inst {e vorig vflip vflipNoOpt flip flipNoOpt} { catch "$inst Delete" }
vtkImageEllipsoidSource e e SetCenter 75 75 0
vtkImageFlip flip vtkImageFlip flipNoOpt
set xpos 20 set ypos 20 foreach v {vorig vflip vflipNoOpt} { vtkImageViewer $v $v SetPosition $xpos $ypos incr xpos 350 $v SetColorWindow 255 $v SetColorLevel 128 $v Render }
vorig SetInput [e GetOutput]
foreach f {flip flipNoOpt} {
$f SetInput [e GetOutput]
$f SetFilteredAxis 0
v{f} SetInput [
f GetOutput]
}
flipNoOpt OptimizationOff
foreach v {vorig vflip vflipNoOpt} { $v Render }