[vtkusers] .vtr file example

Amy Squillacote amy.squillacote at kitware.com
Mon Mar 12 08:54:13 EDT 2007


Hi Peter,

Probably the easiest way to see what the XML format looks like for 
rectilinear grids is to read a vtkRectilinearGrid dataset into VTK, and 
then write it out using vtkXMLRectilinearGridWriter. Be sure to call 
SetDataModeToAscii. I did this with the cth.vtr dataset contained in 
VTKData (available from the VTK download website). The coordinates 
section of that file is shown below. It's similar to your 2nd guess at 
what the Coordinates section should look like; the main thing you missed 
is specifying that your data is ASCII. You will also need to specify a 
DataArray for the Z component, even though your data is 2D. It will only 
have 1 value -- the Z value at which your data is located.

    <Coordinates>
      <DataArray type="Float64" Name="Array 05148900" format="ascii" 
RangeMin="-
7.5" RangeMax="4">
        -7.5 -7.39062 -7.28125 -7.17188 -7.0625 -6.95312
        ...
      </DataArray>
      <DataArray type="Float64" Name="Array 05148A60" format="ascii" 
RangeMin="-
3" RangeMax="3">
        -3 -2.90625 -2.8125 -2.71875 -2.625 -2.53125
        ...
      </DataArray>
      <DataArray type="Float64" Name="Array 05148BC0" format="ascii" 
RangeMin="-
3" RangeMax="3">
        -3 -2.875 -2.75 -2.625 -2.5 -2.375
        ...
      </DataArray>
    </Coordinates>

- Amy

Peter Delmont wrote:
> Hello,
>
> Thanks for the reaction.  I have checked the description of the file 
> formats, but still a few things are unclear.  For example, how to give 
> in the coordinates?
> eq, in a 2D case on a domain [0,5]*[0,6], and a mesh defined by y=0, 
> y=1,y=3,y=5,on the x-axis and by x=0,x=2,x=6 on the y-axis, what 
> should the Coordinate DataArray`s look like?
>
> is it something like
> <Coordinates>
>   <DataArray 0 1 3 5 />
>   <DataArray 0 2 6/>
> <Coordinates/>
> ?
>
> Or is it
> is it something like
> <Coordinates>
>   <DataArray type="float16" name="x">
>     0 1 3 5
>   <DataArray/>
>   <DataArray type="float16" name="y">
> 0 2 6
>   <DataArray/>
> <Coordinates/>
> ?
>
> Or is it -most probably- something completely different?
>
> Thanks,
> Peter
>
> Quoting Amy Squillacote <amy.squillacote at kitware.com>:
>
>> Hi Peter,
>>
>> Have you looked at the description of the VTK file formats available
>> from VTK's web site (http://www.vtk.org/pdf/file-formats.pdf)?
>>
>> - Amy
>>
>> Peter Delmont wrote:
>>> Hello,
>>>
>>> I`m extending the output of a code, so the output could be a .vtr  
>>> file.  I still struggle with some questions and Seeing an ASCII  
>>> example of a .vtr file could hopefully help me faster than the  
>>> trial and error method.  Can anybody be so kind to send me an  
>>> example?  My main problem Is how to handle overlap.
>>>
>>> Regards,
>>> Peter
>>>
>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list.Please keep messages  
>>> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>> --Amy Squillacote
>> Kitware, Inc.
>> 28 Corporate Drive
>> Clifton Park, NY 12065
>> Phone: (518) 371-3971 x106
>
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>
> _______________________________________________
> This is the private VTK discussion list.Please keep messages on-topic. 
> Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>

-- 
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106




More information about the vtkusers mailing list