Get a vector at specific voxel coordinates

Hi,

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

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