# Deep copy of polydata seems broken

**URL:** <https://discourse.vtk.org/t/deep-copy-of-polydata-seems-broken/7018>\
**Category:** Development\
**Created:** [October 29, 2021, 2:13pm UTC](https://discourse.vtk.org/t/deep-copy-of-polydata-seems-broken/7018 "2021-10-29T14:13:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterneher](https://discourse.vtk.org/user_avatar/discourse.vtk.org/peterneher/32/4141_2.png) [@peterneher](https://discourse.vtk.org/u/peterneher)\
**Post date:** [October 29, 2021, 2:13pm UTC](https://discourse.vtk.org/t/deep-copy-of-polydata-seems-broken/7018/1 "2021-10-29T14:13:28Z")

</div>

Hi everyone,

in out project we recently upgraded from VTK 8 to 9. Following this I discovered an issue with copying polydata at this location in my code: [MITK-Diffusion/mitkFiberBundle.cpp at master · MIC-DKFZ/MITK-Diffusion · GitHub](https://github.com/MIC-DKFZ/MITK-Diffusion/blob/master/Modules/DiffusionCore/IODataStructures/mitkFiberBundle.cpp#L495)

I am doing the following:

```auto
poldata-target->DeepCopy(poldata-source)

```

before the deep copy, poldata-source-\>GetNumberOfLines() is \> 0, after the deep copy it is 0. So the copy seems to change the source. Using CopyStructure seems to be a workaround, but I would be happy to know if I am doing something wrong or if this is indeed a bug.

Cheers,  
Peter
