[vtkusers] VTK File with Multiple Wariables ASCII to Binary Problem

Gerard Gorman g.gorman at imperial.ac.uk
Tue Aug 19 11:18:47 EDT 2003


Basically what's happening is that when you do a GetOutput() only the 
active SCALAR, VECTOR and TENSOR get passed back from 
vtkStructuredGridReader/vtkStructuredGridWriter. Try printing out 
fileIn.GetOutput()

My own experience is that vtkXML...GridReader/vtkXML...GridWriter are 
much handier because it classifies all non-active SCALARS/./. as arrays 
and everything gets passed along nicely.

cheers
g

Chris Hood wrote:
>   I've created a VTK file with mutilple variables in ASCII format that 
> my VTK program reads fine, but when I try to convert it to binary format 
> to improve the speed, it only creates a file with the point locations 
> and the first variable. How do I get all the variables in there? Is this 
> a vtk bug that'll be fixed in a future version? I'll put a copy of the 
> function I'm using below.
>   I'm using vtk with java on xp.
> 
> 
>    void BianryConversion(String filename) {
>       vtkStructuredGridReader fileIn = new vtkStructuredGridReader();
>       fileIn.SetFileName(filename);
>     //vtkStructuredGrid data = fileIn.GetOutput();
>       vtkStructuredGridWriter fileOut = new vtkStructuredGridWriter();
>       fileOut.SetFileName(filename);
>       fileOut.SetFileTypeToBinary();
>       fileOut.SetInput(fileIn.GetOutput());
>       fileOut.Write();
>       }
> 
> 
> ____________________________________
> Chris Hood
> Graduate Student Research Assistant
> University of Colorado, Boulder
> Space Environment Center - NOAA
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 


-- 
----------------------------------------------------------
Gerard Gorman (PhD Student)
Applied Modelling and Computation Group
Earth Science and Engineering
Imperial College
Prince Consort Road		Tel. 00 44 +207 594 9323
London SW7 2BP			Fax. 00 44 +207 594 9321
U.K.                    o~o A good slogan beats a good solution.
-----------------------w-v-w------------------------------




More information about the vtkusers mailing list