Data array multi-component labelling

My problem is in the Paraview GUI:

Any vector components can be colored by Magnitude, or by components X, Y, Z. However, Is there a way to enforce this labelling to Ux, Uy, Uz (for example), instead of the spatial-centric notation X, Y,Z? (Similary with tensor components: Magnitude,XX, YY, ZZ, etc…)

Thanks in advance,

Jack

This can be done by setting the component name on the vtk data itself.
You could create a simple programmable filter that would rename the component.

Do you mean that the component names of vectors/tensors can be set in a VTK file directly? Any pointers to the format specification in that case?

No I mean programmatically, although that is doable on the file format itself:

https://kitware.github.io/vtk-examples/site/VTKFileFormats/

Thanks for the link, although I didn’t find anything about label names there. To clarify what I want: I want to put the label names (Ux, Uy, Uz) in the VTK file itself, is that possible?

I’m afraid this is not supported by .vtk files.

I see, thanks. Slightly tangential is there any interest in annotating 2nd order non-symmetric tensors with XX, YY, …, just like symmetric tensors? I could not find any discussion about this.

no idea what you mean, sounds unrelated to the discussion at hand. please open your own topic if needed.

To precise my thinking, this is not supported by .vtk file but very well supported by many other formats, like .vtu/vtp files.

I see. I was using VTK file as a collective term – I am mostly interested in .vtu, so maybe that could work then?

Actually supported by both .vtk and .vtu/vtp:
cname.vtu (2.4 KB)
cname.vtk (528 Bytes)
cname.vtp (3.4 KB)

vtk:

[glow@arch ~/tmp]$ cat cname.vtk 
# vtk DataFile Version 5.1
vtk output
ASCII
DATASET POLYDATA
POINTS 1 float
0 0 0 
METADATA
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 0 0 
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 0 0 

VERTICES 2 1
OFFSETS vtktypeint64
0 1 
CONNECTIVITY vtktypeint64
0 
POINT_DATA 1
FIELD FieldData 1
Vals 3 1 double
17 13 7 
METADATA
COMPONENT_NAMES

name

INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 22.5167 22.5167 
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 22.5167 22.5167 

vtp/vtu:

[glow@arch ~/tmp]$ cat cname.vtu 
<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <UnstructuredGrid>
    <Piece NumberOfPoints="1"                    NumberOfCells="1"                   >
      <PointData>
        <DataArray type="Float64" Name="Vals" NumberOfComponents="3" ComponentName1="name" format="appended" RangeMin="22.516660498"         RangeMax="22.516660498"         offset="0"                   >
          <InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
            <Value index="0">

1 Like

Perfect, just what I was looking for.