[Paraview] How to get back the first line of a VTK legacy file

Berk Geveci berk.geveci at kitware.com
Mon Mar 1 06:35:46 EST 2010


VTK legacy format is a bit confusing because it follows old VTK terminology.
You seem to be setting the FieldData for the cell data. You need to set
DataObject's FieldData. Here is an example:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
FIELD FieldData 1
aFieldArray 1 1 float
2
POINTS 5 float
0 0 0.5 0 0 -0.5 0.5 0 -2.18557e-08
-0.25 0.433013 -2.18557e-08 -0.25 -0.433013 -2.18557e-08
POLYGONS 6 24
3 2 3 0
3 3 4 0
3 4 2 0
3 2 1 3
3 3 1 4
3 4 1 2

POINT_DATA 5
SCALARS Elevation float
LOOKUP_TABLE default
0.675676 0.243243 0.621622 0.540541 0.216216



On Sun, Feb 28, 2010 at 6:11 AM, Fred Fred <stan1313 at hotmail.fr> wrote:

>  Hmm, I tried it without success:
>
> FIELD FieldData 1
> FEmethod 1 1 string
> Lagrange
>
> yieds to:
>
> ============================================
> ERROR: In /usr/local/ParaView3/VTK/Filtering/vtkDataSet.cxx, line 439
> vtkPolyData (0xae3eac0): Cell array FEmethod with 1 components, has only 1
> tuples but there are 4 cells
>
> ERROR: In /usr/local/ParaView3/VTK/Parallel/vtkPDataSetReader.cxx, line 921
> vtkPDataSetReader (0xa5d5c60): Attribute Mismatch.
>
> ERROR: In /usr/local/ParaView3/VTK/Filtering/vtkExecutive.cxx, line 757
> vtkCompositeDataPipeline (0xa5d6420): Algorithm
> vtkFileSeriesReader(0xa5a2600) returned failure for request: vtkInformation
> (0xae3e650)
>  Debug: Off
>  Modified Time: 97070
>  Reference Count: 1
>  Registered Events: (none)
>  Request: REQUEST_DATA
>  FROM_OUTPUT_PORT: 0
>  FORWARD_DIRECTION: 0
>  ALGORITHM_AFTER_FORWARD: 1
> ============================================
>
>
> while:
>
> FIELD FieldData 1
> FEmethod 1 4 string
> Lagrange Lagrange Lagrange Lagrange
>
> works!
>
> > Date: Tue, 23 Feb 2010 17:07:02 -0500
>
> > Subject: Re: [Paraview] How to get back the first line of a VTK legacy
> file
> > From: utkarsh.ayachit at kitware.com
> > To: stan1313 at hotmail.fr
> > CC: paraview at paraview.org
> >
> > Yes, in field data, the number of tuples doesn't have to match the
> > number of points or cells, so you can have arbitrary length arrays.
> >
> > Utkarsh
> >
> > On Tue, Feb 23, 2010 at 4:51 PM, Fred Fred <stan1313 at hotmail.fr> wrote:
> > > Does it mean that a field data array store only the variable once for
> all
> > > the dataset? I would like to avoir having the same value stored for
> each
> > > component.
> > >
> > >> Date: Tue, 23 Feb 2010 12:51:14 -0500
> > >> Subject: Re: [Paraview] How to get back the first line of a VTK legacy
> > >> file
> > >> From: utkarsh.ayachit at kitware.com
> > >> To: stan1313 at hotmail.fr
> > >> CC: paraview at paraview.org
> > >>
> > >> A possible alternative to put such additional parameters in a field
> data
> > >> array.
> > >>
> > >> On Tue, Feb 23, 2010 at 6:34 AM, Fred Fred <stan1313 at hotmail.fr>
> wrote:
> > >> > The first - not comment - line in a legacy VTK file is free for the
> user
> > >> > and
> > >> > can be used to mention, let us say, an approximation method to use
> with
> > >> > the
> > >> > data for instance, at least I would like to use it for this purpose.
> > >> > This line can be got back in a C++ code by using
> > >> > vtkDataReader::GetHeader().
> > >> > Is it possible to get ot from the VTK dataset instead? since a
> filter
> > >> > has
> > >> > only access to the data, not to the reader.
> > >> > Or is it another (better) way to encode general information in a
> > >> > dataset? I
> > >> > suppose vtkInformation can be used for this purpose but where does
> it
> > >> > appear
> > >> > in a file?
> > >> >
> > >> >
> > >> >
> > >> > ________________________________
> > >> > Vous cherchez l'intégrale des clips de Michael Jackson ? Bing !
> Trouvez
> > >> > !
> > >> > _______________________________________________
> > >> > Powered by www.kitware.com
> > >> >
> > >> > Visit other Kitware open-source projects at
> > >> > http://www.kitware.com/opensource/opensource.html
> > >> >
> > >> > Please keep messages on-topic and check the ParaView Wiki at:
> > >> > http://paraview.org/Wiki/ParaView
> > >> >
> > >> > Follow this link to subscribe/unsubscribe:
> > >> > http://www.paraview.org/mailman/listinfo/paraview
> > >> >
> > >> >
> > >
> > > ________________________________
> > > Vous cherchez l'intégrale des clips de Michael Jackson ? Bing ! Trouvez
> !
>
> ------------------------------
> Avec Internet Explorer, surfez en toute discrétion sur internet Cliquez
> ici ! <http://clk.atdmt.com/FRM/go/182932252/direct/01/>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100301/17a071fb/attachment.htm>


More information about the ParaView mailing list