Research Article

True 4D Image Denoising on the GPU

Algorithm 3

//  Do  the  filtering  for  all  the  time  points  in  the  data
for  (intt=0;  t<DATA_T;  t++)
{
  //  Do  the  filtering  for  all  the  slices  in  the  data
  for  (intz=0;  z<DATA_D;z++)
  {
    //  Set  the  filter  responses  on  the  GPU  to  0
    Reset<<<dimGrid, dimBlock>>>(d_Filter_Responses);
    //  Do  the  filtering  for  all  the  time  points  in  the  filter
    for  (inttt=0;  tt<FILTER_T;  tt++)
    {
      //  Do  the  filtering  for  all  the  slices  in  the  filter
      for  (int  zz=0;  zz<FILTER_D;  zz++)
      {
        //  Copy  the  current  filter  coefficients
        //  to  constant  memory on  the  GPU
        CopyFilterCoefficients(zz,tt);
        //  Do  the  2D  filtering  on  the  GPU
        //  and  increment  the  filter  responses
        //  inside  the  filtering  function
        Conv2D<<<dimGrid,  dimBlock>>>(d_Filter_Responses);
      }
    }
  }
}