# DeepCopy of DataSet does not copy cells.

**URL:** https://discourse.vtk.org/t/deepcopy-of-dataset-does-not-copy-cells/648
**Category:** Support
**Created:** [March 30, 2019, 10:04pm UTC](https://discourse.vtk.org/t/deepcopy-of-dataset-does-not-copy-cells/648 "2019-03-30T22:04:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vadimcn](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vadimcn/32/270_2.png) [@vadimcn](https://discourse.vtk.org/u/vadimcn)
#### Post date: [March 30, 2019, 10:04pm UTC](https://discourse.vtk.org/t/deepcopy-of-dataset-does-not-copy-cells/648/1 "2019-03-30T22:04:35Z")

</div>

Hi,  
I’m writing a ParaView filter in Python, and I need the output dataset to have the same topology and attributes as the input; only the point coordinates should to be modified. So I’m starting with this:

```
input = vtkDataSet.GetData(inInfoVec[0], 0)
output = vtkPolyData.GetData(outInfoVec, 0)
output.DeepCopy(input)

```

However, when I inspect the output afterwards, it looks like all points and their attributes get copied, all the cells are lost.

Is this the expected behavior of DeepCopy? And if so, what should I use to make a complete copy?

---

<div class="post-metadata">

### Author: ![andreasbuykx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andreasbuykx/32/8137_2.png) [@andreasbuykx](https://discourse.vtk.org/u/andreasbuykx)
#### Post date: [March 31, 2019, 7:17am UTC](https://discourse.vtk.org/t/deepcopy-of-dataset-does-not-copy-cells/648/2 "2019-03-31T07:17:31Z")

</div>

I suspect your input dataset is not a vtkPolyData. In that case the vtkPointSet::DeepCopy will be executed but no cells will be copied. You can use vtkGeometryFilter to convert the input to vtkPolyData

---

<div class="post-metadata">

### Author: ![vadimcn](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vadimcn/32/270_2.png) [@vadimcn](https://discourse.vtk.org/u/vadimcn)
#### Post date: [April 1, 2019, 6:18pm UTC](https://discourse.vtk.org/t/deepcopy-of-dataset-does-not-copy-cells/648/3 "2019-04-01T18:18:20Z")

</div>

> [@andreasbuykx](#):
>
> I suspect your input dataset is not a vtkPolyData.

Ah, you were right: the input dataset turned out to be a vtkUnstructuredGrid.  
Thanks!
