[vtkusers] MetaImage 'Offset' (vs 'Position') tag

Frederic Perez fredericpcx at yahoo.es
Thu Nov 4 09:14:52 EST 2004


Hello insight-users,

I've been succesfully generating and using MetaImage files
in Insight. At present I am also reading MetaImage files 
using VTK 4.4, with the aid of the vtkMetaImageReader 
class created by Andy Cedilnik (thank you very much).

I have noticed that the origin of the input image (more
concretely, the origin of the related vtkImageData) is 
set to (0, 0, 0) although the Insight generated files 
specify the origin to be, for example, 
"Offset = -176.5 5.01561 -1539.5" (in the header file).
This is also the case when reading the Insight generated 
MetaImage files into ParaView. This is annoying for example
when reading two files corresponding to the right and 
left lungs---they clash even though their respective 
origins differ.

After learning a bit about the MetaImage format
http://caddlab.rad.unc.edu/software/MetaIO/MetaIO-Introduction.htm
and browsing the VTK's vtkMetaImageReader.cxx source file
I have found that Insight uses the tag "Offset" while
VTK uses the tag "Position" to specify the origin of the 
volume data. Substituting "Offset" by "Position" seems 
to fix the problem, both for the vtkMetaImageReader and
for ParaView. One can edit the header files manually or
execute a perl command to get the substitution done, for
example. However, maybe it would be better to do the 
changes in the Insight code itself since the tag "Offset" 
does not seem to exist (am I wrong?) in 
http://caddlab.rad.unc.edu/software/MetaIO/MetaIO-Introduction.htm
(maybe that page is not updated?!)

Hope this helps,

Frederic Perez



		
______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es



More information about the vtkusers mailing list