# Updating data input for VolumeMapper without copying data

**URL:** https://discourse.vtk.org/t/updating-data-input-for-volumemapper-without-copying-data/3943
**Category:** Support
**Created:** [August 10, 2020, 11:41am UTC](https://discourse.vtk.org/t/updating-data-input-for-volumemapper-without-copying-data/3943 "2020-08-10T11:41:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![R.Engelken](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/8edcca/32.png) [@R.Engelken](https://discourse.vtk.org/u/R.Engelken)
#### Post date: [August 10, 2020, 11:41am UTC](https://discourse.vtk.org/t/updating-data-input-for-volumemapper-without-copying-data/3943/1 "2020-08-10T11:41:17Z")

</div>

Hello,

I use the following pipeline:

ImageData -\> SmartVolumeMapper -\> … with 1 scalar component

To prevent copying data I want to retrieve a pointer to the image data array and give it to another interface  
If I use ImageData-\>GetScalarPointer() I still have to use SmartVolumeMapper-\>SetInputData(ImageData), is that correct?  
If so, is there a way to prevent this additional copy (e.g. by using another data container or accessing the VolumeMapper?) What would be the right way to inform the pipeline that the data has changed?

Thanks for your help,  
Ralf.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [August 10, 2020, 7:31pm UTC](https://discourse.vtk.org/t/updating-data-input-for-volumemapper-without-copying-data/3943/2 "2020-08-10T19:31:05Z")

</div>

> [@R.Engelken](#):
>
> If I use ImageData-\>GetScalarPointer() I still have to use SmartVolumeMapper-\>SetInputData(ImageData), is that correct?

Yes.

> [@R.Engelken](#):
>
> If so, is there a way to prevent this additional copy

The only copy happening here is a pointer copy, not a deep copy of the data, so you shouldn’t have to worry about the extra copying.

> [@R.Engelken](#):
>
> What would be the right way to inform the pipeline that the data has changed?

Invoke `ImageData->Modified()` after changing the scalars.

---

<div class="post-metadata">

### Author: ![R.Engelken](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/8edcca/32.png) [@R.Engelken](https://discourse.vtk.org/u/R.Engelken)
#### Post date: [August 11, 2020, 3:29pm UTC](https://discourse.vtk.org/t/updating-data-input-for-volumemapper-without-copying-data/3943/3 "2020-08-11T15:29:01Z")

</div>

Thanks that solved my problems.

Have a nice day 🙂
