 // PhD student University of Nottingham
 // imaluengo@gmail.com
 // 2015
-
+// Sligtly modified by Ander Biguri
 
 // http://gpu4vision.icg.tugraz.at/papers/2010/knoll.pdf#pub47
-
+#define MAXTREADS 1024
+#define WARPSIZE 32
 #include "tvdenoising.hpp"
 #define cudaCheckErrors(msg) \
 do { \

    py[idx] = q[1] / norm;
    px[idx] = q[2] / norm;
}


// Main function
void tvdenoising(const float* src, float* dst, float lambda,
                 const float* spacing, const long* image_size, int maxIter)
{
    // Init params
    size_t total = image_size[0] * image_size[1]  * image_size[2] ;
    size_t mem_size = sizeof(float) * total;

    // Init cuda memory
    // BEFORE DOING ANYTHING: Use the proper CUDA enabled GPU: Tesla K40c or Gforce GT 740M

        } \
} while (0)

__device__ float d_max;
__device__ float d_min;

__device__ __inline__
float divergence(const float* pz, const float* py, const float* px,
                 long z, long y, long x, long depth, long rows, long cols,
