Skip to content

Commit

Permalink
IO: Added options to import sensor positions in WORLD coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed May 15, 2019
1 parent c2ab8d5 commit 59c2b65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions toolbox/core/bst_get.m
Expand Up @@ -3349,12 +3349,15 @@
{'.pos','.pol','.elp','.txt'}, 'EEG: Polhemus (*.pos;*.pol;*.elp;*.txt)', 'POLHEMUS'; ...
{'*'}, 'EEG: ASCII: Name,XYZ (*.*)', 'ASCII_NXYZ'; ...
{'*'}, 'EEG: ASCII: Name,XYZ_MNI (*.*)', 'ASCII_NXYZ_MNI'; ...
{'*'}, 'EEG: ASCII: Name,XYZ_World (*.*)', 'ASCII_NXYZ_WORLD'; ...
{'*'}, 'EEG: ASCII: Name,XY (*.*)', 'ASCII_NXY'; ...
{'*'}, 'EEG: ASCII: XYZ (*.*)', 'ASCII_XYZ'; ...
{'*'}, 'EEG: ASCII: XYZ_MNI (*.*)', 'ASCII_XYZ_MNI'; ...
{'*'}, 'EEG: ASCII: XYZ_World (*.*)', 'ASCII_XYZ_WORLD'; ...
{'*'}, 'EEG: ASCII: XY (*.*)', 'ASCII_XY'; ...
{'*'}, 'EEG: ASCII: XYZ,Name (*.*)', 'ASCII_XYZN'; ...
{'*'}, 'EEG: ASCII: XYZ_MNI,Name (*.*)', 'ASCII_XYZN_MNI'; ...
{'*'}, 'EEG: ASCII: XYZ_World,Name (*.*)', 'ASCII_XYZN_WORLD'; ...
{'*'}, 'EEG: ASCII: Name,Theta,Phi (*.*)', 'ASCII_NTP'; ...
{'*'}, 'EEG: ASCII: Theta,Phi (*.*)', 'ASCII_TP'; ...
};
Expand Down
10 changes: 7 additions & 3 deletions toolbox/io/import_channel.m
Expand Up @@ -255,15 +255,15 @@
ChannelMat.Comment = 'Contacts';
FileUnits = 'mm';
[ChannelMat.Channel.Type] = deal('SEEG');
case {'ASCII_XYZ', 'ASCII_XYZ_MNI'} % (*.*)
case {'ASCII_XYZ', 'ASCII_XYZ_MNI', 'ASCII_XYZ_WORLD'} % (*.*)
ChannelMat = in_channel_ascii(ChannelFile, {'X','Y','Z'}, 0, .01);
ChannelMat.Comment = 'Channels';
FileUnits = 'cm';
case {'ASCII_NXYZ', 'ASCII_NXYZ_MNI'} % (*.*)
case {'ASCII_NXYZ', 'ASCII_NXYZ_MNI', 'ASCII_NXYZ_WORLD'} % (*.*)
ChannelMat = in_channel_ascii(ChannelFile, {'Name','X','Y','Z'}, 0, .01);
ChannelMat.Comment = 'Channels';
FileUnits = 'cm';
case {'ASCII_XYZN', 'ASCII_XYZN_MNI'} % (*.*)
case {'ASCII_XYZN', 'ASCII_XYZN_MNI', 'ASCII_XYZN_WORLD'} % (*.*)
ChannelMat = in_channel_ascii(ChannelFile, {'X','Y','Z','Name'}, 0, .01);
ChannelMat.Comment = 'Channels';
FileUnits = 'cm';
Expand Down Expand Up @@ -293,6 +293,10 @@
end
% Are the SCS coordinates defined for this file?
isScsDefined = isfield(ChannelMat, 'SCS') && all(isfield(ChannelMat.SCS, {'NAS','LPA','RPA'})) && (length(ChannelMat.SCS.NAS) == 3) && (length(ChannelMat.SCS.LPA) == 3) && (length(ChannelMat.SCS.RPA) == 3);
if ismember(FileFormat, {'ASCII_XYZ_WORLD', 'ASCII_NXYZ_WORLD', 'ASCII_XYZN_WORLD'})
isApplyVox2ras = 1;
end



%% ===== CHECK DISTANCE UNITS =====
Expand Down

0 comments on commit 59c2b65

Please sign in to comment.