# Shadowed functions in GPUImage (or CudaImage)

**URL:** <https://discourse.itk.org/t/shadowed-functions-in-gpuimage-or-cudaimage/1614>\
**Category:** Uncategorized\
**Created:** [February 21, 2019, 4:20pm UTC](https://discourse.itk.org/t/shadowed-functions-in-gpuimage-or-cudaimage/1614 "2019-02-21T16:20:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [February 22, 2019, 8:08pm UTC](https://discourse.itk.org/t/shadowed-functions-in-gpuimage-or-cudaimage/1614/4 "2019-02-22T20:08:35Z")

</div>

In Python, I think it should look like this (though we have not wrapped itk.GPUImage):

```auto
PixelType = itk.ctype('float')
image = itk.imread('myfile.nrrd', PixelType)
GPUImageType = itk.GPUImage[PixelType, image.GetImageDimension()]
gpu_filter = itk.GPUImageToImageFilter[type(image), GPUImageType].New()
gpu_filter.SetInput(image)
gpu_filter.Update()
gpu_image = gpu_filter.GetOutput()
# Transfer from GPU memory to CPU memory if needed
gpu_image.UpdateBuffers()
# Since itk::GPUImage inherits from itk::Image, use it in parent filters

```

or, in ITK 5 syntax,

```auto
image = itk.imread('myfile.nrrd')
gpu_image = itk.gpu_image_to_image_filter(image)

```

So, the `itk::CudaImage` could be wrapped in a similar way…

---

_[View the full topic](https://discourse.itk.org/t/shadowed-functions-in-gpuimage-or-cudaimage/1614)._
