# List of Readers

**URL:** https://discourse.vtk.org/t/list-of-readers/184
**Category:** Support
**Created:** [January 31, 2019, 10:56pm UTC](https://discourse.vtk.org/t/list-of-readers/184 "2019-01-31T22:56:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [January 31, 2019, 10:56pm UTC](https://discourse.vtk.org/t/list-of-readers/184/1 "2019-01-31T22:56:11Z")

</div>

I’ve been thinking it would be beneficial to compile a list of readers in the VTK library and their respective, typical file extensions. I think this would be awesome to include in the docs somewhere… perhaps on the lorensen GitHub site?

Does anyone know of any lists like this that currently exist? I’ve found the [ParaView list](https://www.paraview.org/Wiki/ParaView/Users_Guide/List_of_readers) but PV’s reader names aren’t exactly the same as the VTK side and this list seems a bit dated ( last modified on 26 January 2016, at 13:06).

I am willing to compile this list as I am hoping to create a dictionary based on file extensions for [`vtki`](https://github.com/akaszynski/vtki) since many readers can be used in Python with the same routine:

```python
reader = vtk.vtkMyFavoriteReader()
reader.SetFileName(filename)
reader.Update()
output = reader.GetOutputDataObject(0)

```

---

<div class="post-metadata">

### Author: ![jhlegarreta](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jhlegarreta/32/27_2.png) [@jhlegarreta](https://discourse.vtk.org/u/jhlegarreta)
#### Post date: [February 1, 2019, 2:15am UTC](https://discourse.vtk.org/t/list-of-readers/184/2 "2019-02-01T02:15:18Z")

</div>

Hi Bane,  
indeed, they do exist:  
[https://vtk.org/Wiki/VTK/FAQ#What\_image\_file\_formats\_can\_VTK\_read\_and\_write.3F](https://vtk.org/Wiki/VTK/FAQ#What_image_file_formats_can_VTK_read_and_write.3F)  
and  
[https://vtk.org/Wiki/VTK/FAQ#What\_3D\_file\_formats\_can\_VTK\_import\_and\_export.3F](https://vtk.org/Wiki/VTK/FAQ#What_3D_file_formats_can_VTK_import_and_export.3F)

HTH,  
JON HAITZ

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [February 1, 2019, 2:48am UTC](https://discourse.vtk.org/t/list-of-readers/184/3 "2019-02-01T02:48:17Z")

</div>

That page will need to be updated to reflect changes in the vtk module API.

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [February 25, 2019, 12:48am UTC](https://discourse.vtk.org/t/list-of-readers/184/4 "2019-02-25T00:48:34Z")

</div>

I’ve created a big list of readers for [`vtki`](http://docs.vtki.org/en/latest/) in [this pull request](https://github.com/akaszynski/vtki/pull/100). This PR sets up a common way to read any supported file with a VTK reader chosen by the file extension.

Please take a look at the dictionary mapping the extensions to the proper VTK reader classes in `vtki/readers.py` and either let me know if something is incorrect or create a pull request to add new ones!

In `vtki`, any VTK reader can now be used with the following code which will return a `vtki` wrapped VTK data object. Note that `vtki` simply provides a layer of wrappings on top of the VTK object so the returned object could be passed to _any_ VTK Python routine.

```python
import vtki
filename = 'path/to/my/file.ext'
data = vtki.read(filename)

```

Perhaps you need some flexibility with what the reader performs and need to call several setters/options on the reader - then simply pass a dictionary of function names and parameters to pass:

```python
import vtki
filename = 'path/to/my/file.ext'
data = vtki.read(filename, attrs={'DebugOn':None, 'SetScalarsName':'foo'})

```

---

<div class="post-metadata">

### Author: ![lorensen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lorensen/32/20_2.png) [@lorensen](https://discourse.vtk.org/u/lorensen)
#### Post date: [February 25, 2019, 11:37pm UTC](https://discourse.vtk.org/t/list-of-readers/184/5 "2019-02-25T23:37:21Z")

</div>

The VTKExamples [https://lorensen.github.io/VTKExamples/site/](https://lorensen.github.io/VTKExamples/site/) show how  
to do this in C++. See these examples:

[https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadAllPolyDataTypes/](https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadAllPolyDataTypes/)

and

[https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadAllPolyDataTypesDemo/](https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadAllPolyDataTypesDemo/)

Bill
