[Insight-developers] Very strange interaction between some itk image io and vtk io

Richard Beare richard.beare at gmail.com
Fri Jul 18 07:45:20 EDT 2008


Hi,
I've come across some extremely strange behaviour that seems to result
from a combination of vtk and itk io libraries. I originally came
across the problem when one executable, that didn't use vtk, was part
of a larger project that included some executables that did use vtk,
resulting in all executables being linked against vtkIO libraries even
though some didn't require it.

This behaviour has been observed on OSX 10.5, with vtk 5.3 (cvs) and
itk 3.6. I'll attempt to confirm on linux soon.

The problem is that nifti and analyse images (haven't confirmed with
all formats yet, but the problem does NOT occur with tif) written
using itk are corrupted in a strange way. The output is such that the
image is split in two along a vertical line, and each half of the
image is swapped. A surprising result, as you can imagine. I've been
viewing the result images with fslview.

My code and cmake file is attached. The code is a simple read and
write in various formats. I haven't observed ant dependence on pixel
type yet, and I have observed a similar result in 3D. The code I'm
sending was tested with the cthead image from the standard itk
distribution.

I can make the problem come and go by commenting out vtkIO in the
Libraries section.

Any ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readWrite.cxx
Type: application/octet-stream
Size: 637 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20080718/696c31fb/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20080718/696c31fb/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IJMacros.txt
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20080718/696c31fb/attachment-0001.txt>


More information about the Insight-developers mailing list