                    int h_gridDims[3], // Dimensions of the output volume
                    double h_gridOrig[3], // Origin of the output volume
                    double h_gridSpacing[3], // Spacing of the output volume
-                   vtkDoubleArray* io_outScalar)
+                   vtkDoubleArray* io_outScalar) // It will be filled inside function
 {
   if (h_dataList.size() == 0)
     return -1;

  return (k*dimY + j)*dimX + i;
}

__device__ void computeVoxelCenter(int voxelCoordinate[3], double output[3])
{
  output[0] = c_gridOrig.x + (voxelCoordinate[0] + 0.5) * c_gridSpacing.x;



// ----------------------------------------------------------------------------
/* Extract double value from vtkDoubleArray and fill a double table (output) */
__host__ void vtkDoubleArrayToTable(vtkDoubleArray* doubleArray, double* output)
{
  for (int i = 0; i < doubleArray->GetNumberOfTuples(); i++)
  {
  output[i] = doubleArray->GetTuple1(i);
  }
}


// ----------------------------------------------------------------------------
/* Extract point data array (name 'Depths') from vtkImageData and fill a double table */
__host__ void vtkImageDataToTable(vtkImageData* image, double* output)
{
  vtkDoubleArray* depths = vtkDoubleArray::SafeDownCast(image->GetPointData()->GetArray("Depths"));
