# Get a vector at specific voxel coordinates

**URL:** <https://discourse.vtk.org/t/get-a-vector-at-specific-voxel-coordinates/2664>\
**Category:** Development\
**Created:** [February 20, 2020, 6:20pm UTC](https://discourse.vtk.org/t/get-a-vector-at-specific-voxel-coordinates/2664 "2020-02-20T18:20:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/e68b1a/32.png) [@Nina](https://discourse.vtk.org/u/Nina)\
**Post date:** [February 20, 2020, 6:20pm UTC](https://discourse.vtk.org/t/get-a-vector-at-specific-voxel-coordinates/2664/1 "2020-02-20T18:20:20Z")

</div>

Hi,

I have applied a 3d sobel filter on vtkImageData like this:

```auto
vtkSmartPointer<vtkImageSobel3D> sobelFilter =
vtkSmartPointer<vtkImageSobel3D>::New();
sobelFilter->SetInputData(image);
sobelFilter->Update();

```

My question is how can I extract the vector field at a specific voxel coordinates. For exemple to extract a value we can do:

int coords[3] = {i, j, k};

vtkVariant variant = image-\>GetPointData()-\>GetScalars()-\> GetVariantValue(input\>ComputePointId(coords)); // to get 0 or 1

but what about vectors , I want to get the vector field produced by soble filter at {i,j,k] coordinates in c++? I have tried many solutions but I have not get good results.

Thank’s in advance
