spm_get_lm.m 1.1 KB

123456789101112131415161718192021222324252627
  1. function idx = spm_get_lm(vol,list,n)
  2. % Identification of local maxima in 3(or 2)D volume - a compiled routine
  3. % FORMAT idx = spm_get_lm(vol,list,n)
  4. %
  5. % Routine that identifies which voxels in a list of coordinates that are
  6. % local maxima, and returns a list of indices into the coordinate list for
  7. % those maxima.
  8. %
  9. % Input:
  10. % vol - 3(or 2)D volume of statistics (e.g. t or F)
  11. % list - 3xn (or 2xn) list of voxel coordinates of tentative local
  12. % maxima.
  13. % n - connectivity criterion: 6 (surface), 18 (edge) or 26 (corner).
  14. % [Default: 18].
  15. % (for a 2D image these correspond to 4, 8 and 8 respectively).
  16. %
  17. % Output:
  18. % idx - Index into list such that list(:,idx) returns those
  19. % coordinates that are truly local maxima.
  20. %__________________________________________________________________________
  21. % Copyright (C) 2002-2015 Wellcome Trust Centre for Neuroimaging
  22. % Jesper Andersson
  23. % $Id: spm_get_lm.m 6534 2015-08-24 16:02:56Z guillaume $
  24. %-This is merely the help file for the compiled routine
  25. error('spm_get_lm.c not compiled - see Makefile');