# VTI file types for vtkjs volume reader

**URL:** https://discourse.paraview.org/t/vti-file-types-for-vtkjs-volume-reader/9315
**Category:** Web Support
**Created:** [March 31, 2022, 8:47am UTC](https://discourse.paraview.org/t/vti-file-types-for-vtkjs-volume-reader/9315 "2022-03-31T08:47:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![benoitpaillard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/benoitpaillard/32/958_2.png) [@benoitpaillard](https://discourse.paraview.org/u/benoitpaillard)
#### Post date: [March 31, 2022, 8:47am UTC](https://discourse.paraview.org/t/vti-file-types-for-vtkjs-volume-reader/9315/1 "2022-03-31T08:47:20Z")

</div>

Hi all,

I’m trying to change this example to read other volume files:

> **[GitHub - KitwareMedical/vtk.js-examples: These are a few examples for vtk.js](https://github.com/KitwareMedical/vtk.js-examples/)**
>
> These are a few examples for vtk.js. Contribute to KitwareMedical/vtk.js-examples development by creating an account on GitHub.

after cloning the repo, the volume viewer can be started with:  
npm run dev:volume

The data read is with the following line

```auto
reader
  .setUrl('https://kitware.github.io/vtk-js/data/volume/LIDC2.vti')
[...]

```

When I’m trying to change this to other data sources :

```auto
reader
  .setUrl('https://kitware.github.io/vtk-js-datasets/data/vti/LIDC2.vti')

```

I’m getting an error

I notice that the first version is npm folder structure with index.json, a binary file etc… while the second one is just a vti file, which is what I get from paraview when I output volume data.

Can you specify how to generate this ‘npm style’ vti data, or read vti files straight from paraview ?

thanks

---

<div class="post-metadata">

### Author: ![Forrest\_Li](https://discourse.paraview.org/user_avatar/discourse.paraview.org/forrest_li/32/1935_2.png) [@Forrest\_Li](https://discourse.paraview.org/u/Forrest_Li)
#### Post date: [March 31, 2022, 2:09pm UTC](https://discourse.paraview.org/t/vti-file-types-for-vtkjs-volume-reader/9315/2 "2022-03-31T14:09:55Z")

</div>

The former is a folder-style dataset, where the index.json file is used as a manifest to download the appropriate data arrays for the image data. If you want to switch to loading the `data/vti/LIDC2.vti` binary file, then you will need to use `fetch` or [`vtkHttpDataAccessReader.fetchBinary`](https://github.com/Kitware/vtk-js/blob/master/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.js#L31) to download the file, then use `vtkXMLImageDataReader` to read in the file. You can find an example of the reader here: [vtk-js/index.js at master · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/blob/master/Sources/IO/XML/XMLPolyDataWriter/example/index.js)
