Home > vbmeg > external > mne > mne_patch_info.m

mne_patch_info

PURPOSE ^

SYNOPSIS ^

function [pinfo] = mne_patch_info(nearest)

DESCRIPTION ^

 [pinfo] = mne_patch_info(nearest)

 Generate the patch information from the 'nearest' vector in a source space

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pinfo] = mne_patch_info(nearest)
0002 %
0003 % [pinfo] = mne_patch_info(nearest)
0004 %
0005 % Generate the patch information from the 'nearest' vector in a source space
0006 %
0007 
0008 %
0009 %
0010 %   Author : Matti Hamalainen, MGH Martinos Center
0011 %   License : BSD 3-clause
0012 %
0013 %
0014 
0015 me='MNE:mne_patch_info';
0016 
0017 if nargin ~= 1
0018    error(me,'Incorrect number of arguments');
0019 end
0020 
0021 if isempty(nearest)
0022    pinfo = [];
0023    return;
0024 end
0025 
0026 [ sorted, indn ] = sort(nearest);
0027 
0028 [uniq,firsti,dum] = unique(sorted,'first');
0029 [uniq,lasti,dum] = unique(sorted,'last');
0030 
0031 for k = 1:length(uniq)
0032    pinfo{k} = indn(firsti(k):lasti(k));
0033 end
0034 
0035 return;
0036

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005