% % Threshold calculation
% %
% % By: Indranath Chattterjee
% % Department of computer science, University of Delhi, Delhi-110007,
% % E-mail: indranath.cs.du@gmail.com


% Function to remove the values inside the data matrix that
% falls below a general threshold i.e 0.05 
% All the voxel intensities that falls in the range of
% -0.05 and 0.05 are set to 0.
function mat = knockout_threshold(mat)
  [row,col,height] = size(mat);
  for i = 1: row
    for j = 1:col
        for k = 1:height
            % As per the description written above, values that fall below
            % the threshold are set to 0.
         if mat(i,j,k)< 0.05 && mat(i,j,k) > -0.05
            mat(i,j,k)=0;
         end
        end
    end
  end
end