VTI specification

Dear all,

I was wondering if there is any official specification of the VTK XML file formats, particularly for the VTI image format.
The reason I’m asking are the attributes of the <ImageData> tag. For VTK9, it contains a Direction attribute which is missing for VTK8:

<ImageData WholeExtent="0 16 0 16 0 16" Origin="0 0 0" Spacing="1.0 1.0 1.0" Direction="1 0 0 0 1 0 0 0 1">

vs

<ImageData WholeExtent="0 16 0 16 0 16" Origin="0 0 0" Spacing="1.0 1.0 1.0">

I think it is obvious that WholeExtend, Origin, and Spacing are mandatory. Direction seems to allow deviation from default ordering of x,y,z (that’s how I understand 1 0 0 0 1 0 0 0 1).

My general question is now:

  • How can I know which attributes are mandatory in XML files, potentially in dependence of the version string (which is 0.1 in files from VTK8 and VTK9)?

The specific question is then:

  • Is a <ImageData> tag without Direction valid now and in future?

Note: I’m using the python bindings in case that it matters.

A few years late, but I have the exact same question. I couldn’t see anything in the vtk documentation or paraviews documentation about this at all.

I’m not even sure how to use it or why I might need to. Any good examples showing why/how to use?

Hopefully some answers by now.

The .vti extension is mentioned here a few paragraphs in: VTK File Formats - VTK documentation.

Later in that section, there is a description of the VTI spec.

Thanks, but I’ve read that several times and don’t see anything about Direction and whether it’s old and removed or new and should be included in all future files.

Here’s all I can see about VTI:

<VTKFile type="ImageData" ...>
  <ImageData WholeExtent="x1 x2 y1 y2 z1 z2"
   Origin="x0 y0 z0" Spacing="dx dy dz">
   <Piece Extent="x1 x2 y1 y2 z1 z2">
      <PointData>...</PointData>
      <CellData>...</CellData>
   </Piece>
   </ImageData>
</VTKFile>

WholeExtent, Origin and Spacing are included and relatively well defined. Does the omission of Direction mean it’s no longer supported/required?

I’m sorry, I didn’t read enough of the discussion above to fully understand your question. Direction is new and it’s omission from the docs is just because the docs haven’t been updated.

Thanks for clarifying. Is there an example somehwere of how you might use the option? Is it for rotating the grid?

I’ll keep an eye out for the documentation update in the future anyway.

Yes.

More background info is here: https://gitlab.kitware.com/vtk/vtk/-/issues/17480