# vtkPolyData : add attribute/annotation

**URL:** https://discourse.vtk.org/t/vtkpolydata-add-attribute-annotation/10148
**Category:** Support
**Created:** [December 10, 2022, 6:51pm UTC](https://discourse.vtk.org/t/vtkpolydata-add-attribute-annotation/10148 "2022-12-10T18:51:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nicholas\_Yue](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicholas_yue/32/3751_2.png) [@Nicholas\_Yue](https://discourse.vtk.org/u/Nicholas_Yue)
#### Post date: [December 10, 2022, 6:51pm UTC](https://discourse.vtk.org/t/vtkpolydata-add-attribute-annotation/10148/1 "2022-12-10T18:51:17Z")

</div>

Hi,

I wish to record some meta data regarding the source information that goes into the creation of a given vtkPolyData (for versioning/history/tracking purpose)

Is there some way to add such sting/integer information as institution, author, date-time ?

Cheers

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [December 12, 2022, 8:16am UTC](https://discourse.vtk.org/t/vtkpolydata-add-attribute-annotation/10148/2 "2022-12-12T08:16:58Z")

</div>

Hi @Nicholas_Yue

Usually, FieldData are used for that purpose.

Best,

---

<div class="post-metadata">

### Author: ![Nicholas\_Yue](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicholas_yue/32/3751_2.png) [@Nicholas\_Yue](https://discourse.vtk.org/u/Nicholas_Yue)
#### Post date: [December 14, 2022, 6:33am UTC](https://discourse.vtk.org/t/vtkpolydata-add-attribute-annotation/10148/3 "2022-12-14T06:33:13Z")

</div>

Thank you @mwestphal, it worked.

```auto
vtkNew<vtkFieldData> source_geometry_fielddata;

vtkNew<vtkStringArray> source_geometry_filepath_array;
source_geometry_filepath_array->SetName("src_path");
source_geometry_filepath_array->SetNumberOfComponents(1);
source_geometry_filepath_array->InsertNextValue(vtk_file);
source_geometry_fielddata->AddArray(source_geometry_filepath_array);

std::string sha1;
if (computeFileSHA1(vtk_file, sha1)) {
	vtkNew<vtkStringArray> source_sha1_array;
	source_sha1_array->SetName("src_sha1");
	source_sha1_array->SetNumberOfComponents(1);
	source_sha1_array->InsertNextValue(sha1);
	source_geometry_fielddata->AddArray(source_sha1_array);
}

source->SetFieldData(source_geometry_fielddata);

```

and it shows up nicely in ParaView too  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/8fda525b7b5e48c3b17b511aafb9ed2074adffa0.png)
