spm_global.m 1002 B

1234567891011121314151617181920212223242526272829303132333435
  1. function GX = spm_global(V)
  2. % Compute the global mean for a volume image - a compiled routine
  3. % FORMAT GX = spm_global(V)
  4. % V - image handle structure
  5. % GX - global mean
  6. %__________________________________________________________________________
  7. %
  8. % spm_global returns the mean counts integrated over all the slices from
  9. % the volume.
  10. %
  11. % The mean is estimated after discounting voxels outside the object using
  12. % a criteria of greater than > (global mean)/8.
  13. %__________________________________________________________________________
  14. % Copyright (C) 1996-2012 Wellcome Trust Centre for Neuroimaging
  15. % Anonymous
  16. % $Id: spm_global.m 4921 2012-09-13 11:16:21Z guillaume $
  17. %-This is merely the help file for the compiled routine
  18. error('spm_global.c not compiled - see Makefile')
  19. % GX = zeros(numel(V),1);
  20. %
  21. % for i=1:numel(V)
  22. %
  23. % D = spm_data_read(V(i));
  24. %
  25. % iD = isfinite(D);
  26. %
  27. % S = mean(D(iD)) / 8;
  28. %
  29. % GX(i) = mean(D(iD & (D > S)));
  30. %
  31. % end