 {
   Tsdf tsdf;
 
-  tsdf.volume = volume;
-  tsdf.volume_size = volume_size;
-
+  tsdf.volume = volume;  
+  tsdf.cell_size.x = volume_size.x / VOLUME_X;
+  tsdf.cell_size.y = volume_size.y / VOLUME_Y;
+  tsdf.cell_size.z = volume_size.z / VOLUME_Z;
+  
   tsdf.intr = intr;
 
   tsdf.Rcurr_inv = Rcurr_inv;

    }

    __global__ void
    tsdf2 (PtrStep<short2> volume, const float3 volume_size, const float tranc_dist_mm, const Mat33 Rcurr_inv, float3 tcurr,
           const Intr intr, const PtrStepSz<ushort> depth_raw, const float3 cell_size)
    {
      int x = threadIdx.x + blockIdx.x * blockDim.x;

        float3 coo = make_float3 (x, y, z);
        coo += 0.5f;         //shift to cell center;

        coo.x *= cell_size.x;
        coo.y *= cell_size.y;
        coo.z *= cell_size.z;

        return coo;
      }
