Home > vbmeg > external > mne > mne_find_source_space_hemi.m

mne_find_source_space_hemi

PURPOSE ^

SYNOPSIS ^

function [hemi] = mne_find_source_space_hemi(src)

DESCRIPTION ^

 function mne_find_source_space_hemi(src)

 Return the hemisphere id for a source space

 src      - The source space to investigate
 hemi     - Deduced hemisphere id

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [hemi] = mne_find_source_space_hemi(src)
0002 %
0003 % function mne_find_source_space_hemi(src)
0004 %
0005 % Return the hemisphere id for a source space
0006 %
0007 % src      - The source space to investigate
0008 % hemi     - Deduced hemisphere id
0009 %
0010 
0011 %
0012 %
0013 %   Author : Matti Hamalainen, MGH Martinos Center
0014 %   License : BSD 3-clause
0015 %
0016 %   Revision 1.2  2006/09/25 19:48:16  msh
0017 %   Added projection item kinds to fiff_define_constants
0018 %   Changed some fields to int32 in surface structures
0019 %
0020 %   Revision 1.1  2006/05/05 03:50:40  msh
0021 %   Added routines to compute L2-norm inverse solutions.
0022 %   Added mne_write_inverse_sol_stc to write them in stc files
0023 %   Several bug fixes in other files
0024 %
0025 %
0026 
0027 me='MNE:mne_find_source_space_hemi';
0028 
0029 global FIFF;
0030 if isempty(FIFF)
0031    FIFF = fiff_define_constants();
0032 end
0033 
0034 if nargin ~= 1
0035     error(me,'Incorrect number of arguments');
0036 end
0037 
0038 xave = sum(src.rr(:,1));
0039 
0040 if xave < 0
0041     hemi = int32(FIFF.FIFFV_MNE_SURF_LEFT_HEMI);
0042 else
0043     hemi = int32(FIFF.FIFFV_MNE_SURF_RIGHT_HEMI);
0044 end
0045 
0046 return;
0047

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