% % Standard deviation calculation
% %
% % By: Indranath Chattterjee
% % Department of computer science, University of Delhi, Delhi-110007,
% % E-mail: indranath.cs.du@gmail.com

% This function takes a cell array of cordinates ( mask of mni template
% coregistered on the subject space and takes the subject matrix and
% returns the standard deviation.

function stndrd_dev = Func_std(co_ordinates,sub_matrix)
   [l,r]=size(co_ordinates);
   intensity_vec(r)= 0.0;
   %creating vector
   for idx = l:r
      intensity_vec(idx)= sub_matrix(co_ordinates{idx}{1},co_ordinates{idx}{2},co_ordinates{idx}{3}); 
   end
   stndrd_dev = std(intensity_vec);
end
