 
 // ----------------------------------------------------------------------------
 /* Compute the middle of a voxel according to constant global value and the origin of the voxel */
-__device__ void computeVoxelCenter(int voxelCoordinate[3], double output[3])
-{
-  output[0] = c_gridOrig.x + (voxelCoordinate[0] + 0.5) * c_gridSpacing.x;
-  output[1] = c_gridOrig.y + (voxelCoordinate[1] + 0.5) * c_gridSpacing.y;
-  output[2] = c_gridOrig.z + (voxelCoordinate[2] + 0.5) * c_gridSpacing.z;
+__device__ void computeVoxelCenter(int voxelCoordinate[Point3D], double output[Point3D])
+{
+  output[0] = c_gridOrig[0] + (voxelCoordinate[0] + 0.5) * c_gridSpacing[0];
+  output[1] = c_gridOrig[1] + (voxelCoordinate[1] + 0.5) * c_gridSpacing[1];
+  output[2] = c_gridOrig[2] +(voxelCoordinate[2] + 0.5) * c_gridSpacing[2];
 }
 
 

    ReconstructionData* currentData = h_dataList[i];
    double* h_depthMap = new double[nbPixelOnDepthMap];
    vtkImageDataToTable(currentData->GetDepthMap(), h_depthMap);
    double* h_matrixK = new double[16];
    vtkMatrixToDoubleTable(currentData->Get4MatrixK(), h_matrixK);
    double* h_matrixRT = new double[16];
    vtkMatrixToDoubleTable(currentData->GetMatrixTR(), h_matrixRT);

    CudaErrorCheck(cudaMemcpy(d_depthMap, h_depthMap, nbPixelOnDepthMap * sizeof(double), cudaMemcpyHostToDevice));
    CudaErrorCheck(cudaMemcpy(d_matrixK, h_matrixK, matrix4Size * sizeof(double), cudaMemcpyHostToDevice));
    CudaErrorCheck(cudaMemcpy(d_matrixRT, h_matrixRT, matrix4Size * sizeof(double), cudaMemcpyHostToDevice));

    // run code into device
    depthMapKernel <<<dimGrid, dimBlock >>>(d_depthMap, d_matrixK, d_matrixRT, d_outScalar);

    // Wait that all threads have finished
    CudaErrorCheck(cudaDeviceSynchronize());

  // Create device data from host value
  double *d_depthMap, *d_matrixK, *d_matrixRT;
  CudaErrorCheck(cudaMalloc((void**)&d_depthMap, nbPixelOnDepthMap * sizeof(double)));
  CudaErrorCheck(cudaMalloc((void**)&d_matrixK, Mat4x4 * sizeof(double)));
  CudaErrorCheck(cudaMalloc((void**)&d_matrixRT, Mat4x4 * sizeof(double)));
  
  for (int i = 0; i < h_dataList.size(); i++)
    {
