# ImageData/PolyData XML writer: how save a lookup table associated to a cell data array

**URL:** https://discourse.vtk.org/t/imagedata-polydata-xml-writer-how-save-a-lookup-table-associated-to-a-cell-data-array/6302
**Category:** Support
**Created:** [August 6, 2021, 1:37am UTC](https://discourse.vtk.org/t/imagedata-polydata-xml-writer-how-save-a-lookup-table-associated-to-a-cell-data-array/6302 "2021-08-06T01:37:15Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![bva99](https://discourse.vtk.org/user_avatar/discourse.vtk.org/bva99/32/3745_2.png) [@bva99](https://discourse.vtk.org/u/bva99)
#### Post date: [August 6, 2021, 1:44pm UTC](https://discourse.vtk.org/t/imagedata-polydata-xml-writer-how-save-a-lookup-table-associated-to-a-cell-data-array/6302/2 "2021-08-06T13:44:17Z")

</div>

Following the suggestions [in this post](https://discourse.vtk.org/t/any-way-to-insert-comments-in-a-file-created-by-vtkxmlimagedatawriter/161), using the [/Utilities/SaveSceneToFieldData example](https://kitware.github.io/vtk-examples/site/Cxx/Utilities/SaveSceneToFieldData/), I’ve managed to write the lookuptable by getting it via `lut.GetTable()` and associating it to the `vtkImageData`'s `vtkFieldData`. The code is simply:

```auto
lut.GetTable().SetName("colorsArray")
myMesh.GetFieldData().AddArray(lut.GetTable())

```

But I still cannot make, for instance, ParaView, use this fielddata as the lookuptable to map the cell scalars.  
Interestingly, [an issue on this was opened in 2004](https://vtk.org/Bug/view.php?id=484), but never solved.

---

_[View the full topic](https://discourse.vtk.org/t/imagedata-polydata-xml-writer-how-save-a-lookup-table-associated-to-a-cell-data-array/6302)._
