Hi Paul,

Paul Morrow wrote:
> I am having trouble viewing non-x-components of a vtk file. The (ascii) 
> vtk file was converted from an omf file (via winovf2vtk) generated by 
> the oommf micromagnetic program developed at nist.
> I can select and view multiple components in the VTK data reader of the 
> earlier version of MayaVi (v1.5), but MayaVi2 only provides the single 
> option for the 'x-component' in the drop-down box of the 'point scalar 
> name', so I cannot select a different vector component to plot. 
> I have attached two vtk files: test42x_0.vtk contains all scalar (x, y, 
> and z) components of the magnetization, while test42xMy_0 contains only 
> the y-component. I have also attached a screenshot of the output for 
> both MayaVi_1.5 and MayaVi2.

Ahh, this is a bug in mayavi2's reader for classic VTK files.  I'll fix 
it as soon as I clean up the trunk or make a branch for the fix.

For now you have two possible solutions.

  1. Convert your VTK file to an XML one using the vtk2xml.py script 
that ships with VTK.  If you can't find that its here:

http://www.aero.iitb.ac.in/~prabhu/software/code/mayavi/vtk2xml.py

  Just run it on your VTK file and it will generate an XML file that is 
compressed, so you'll save space as well.  When you use this file you 
should be able to choose between multiple scalars.

  2. Click on the "Reader" button of the VTK file reader UI and select 
"read all scalars" on the UI.  Then drag the reader to the shell and 
type this: dragged.update_data() on the shell.  That will read all the 
scalars.

HTH.

cheers,
prabhu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to