# mean or average over specific dimension of a vtkImage

**URL:** https://discourse.vtk.org/t/mean-or-average-over-specific-dimension-of-a-vtkimage/8509
**Category:** Support
**Created:** [May 17, 2022, 1:25am UTC](https://discourse.vtk.org/t/mean-or-average-over-specific-dimension-of-a-vtkimage/8509 "2022-05-17T01:25:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gregthom992](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gregthom992/32/7988_2.png) [@gregthom992](https://discourse.vtk.org/u/gregthom992)
#### Post date: [May 17, 2022, 1:25am UTC](https://discourse.vtk.org/t/mean-or-average-over-specific-dimension-of-a-vtkimage/8509/1 "2022-05-17T01:25:06Z")

</div>

Hi,  
I was wondering if there is anything ready made in vtk to do this task.  
say conceptually, I have a 2D vtk Image “matrix”  
I want to compute the mean/average over only one dimension so that if the input image/matrix was MxN, the final image is 1xN if I average over the M dimension.  
This is done easily in numpy/python but I don’t know if there is anything in VTK.  
I use C# for this project that is why I ask.

Thanks

GT
