├── dispp.m ├── DefaultPath.txt ├── 3D.png ├── txt.png ├── Broom.png ├── Edit.png ├── Excel.png ├── Filter.png ├── Minus.png ├── Open.jpg ├── Plus.png ├── Save.png ├── SaveAs.png ├── Spin.png ├── Swap.png ├── CarTool.png ├── Cluster.png ├── Compute.png ├── NoFilter.png ├── Process.png ├── SpinVert.png ├── AddTemplate.png ├── binoculars.png ├── MSTemplateEditor.mlapp ├── SetXYZCoordinates.fig ├── s10548-023-00993-6.pdf ├── MSTemplateExplorer.mlapp ├── Template Maps ├── Hu 2023.set ├── Lassi2023.set ├── Liu 2020.set ├── Nash 2022.set ├── Artoni 2023.set ├── Brechet 2020.set ├── Britz 2010.set ├── Croce 2020.set ├── Croce 2022.set ├── Custo 2017.set ├── Denzer2024.set ├── Diezig 2022.set ├── Hanoglu 2022.set ├── Hill2023_EC.set ├── Hill2023_EO.set ├── Koenig 2002.set ├── Murphy 2018.set ├── Musaeus 2020.set ├── Ricci 2020.set ├── Ricci 2022.set ├── Spring 2017.set ├── Spring 2018.set ├── Spring 2022.set ├── Tomescu 2018.set ├── Tomescu 2022.set ├── Zanesco 2020.set ├── Antonova 2022.set ├── Deolindo 2021.set ├── Giordano 2018.set ├── Lehmann 2005HC.set ├── Lehmann 2005SZ.set ├── Notturno 2022.set ├── Schiller 2019.set ├── Schiller 2020.set ├── Smailovic 2019.set ├── Tarailis 2021.set ├── Vellante 2020.set ├── Zanesco 2021a.set ├── Zanesco 2021b.set ├── Zanesco 2021c.set ├── Zappasodi 2019.set ├── Damborska 2019a.set ├── Damborska 2019b.set ├── Hu Emotions 2021.set ├── Shen_emotion_2020.set ├── Croce 2018 AG-Post.set ├── Croce 2018 IPS-Post.set ├── Kleinert 2022 Set1.set ├── Kleinert 2022 Set2.set ├── Nagabhushan 2020 TD.set ├── Deiber Borderline 2023.set ├── Linton_Modafinil_2022.set ├── Nagabhushan 2020 ASD.set ├── Sharma Parkinson 2021.set ├── Toplutas 2023 DOC_HC.set ├── Toplutas 2023 DOC_MCS.set ├── Toplutas 2023 DOC_VS.set ├── Zelenina_2022 Oxytocin.set ├── Croce 2018 Sham Pre TPJ.set ├── Zappasodi 2017 Controls.set ├── Caoqike_dep-insomnia_2023.set ├── Milz_2016_Cognitive Style.set ├── Murphy Depression 2020 FEP.set ├── Murphy Depression 2020 MDD.set ├── Qin2022 Depression_Controls.set ├── Qin2022 Depression_Patients.set ├── Zappasodi 2017 Patients Left.set ├── Zappasodi 2017 Patients Right.set ├── Müller 2005 Multistable perception.set └── Schiller2021 Alcohol Intoxication.set ├── MSTemplateEditor.mlappinstall ├── MSTemplateExplorer.mlappinstall ├── Microstate template explorer.mlappinstall ├── FixTemplateDomains.m ├── NormDim.m ├── Planar2Sphere.m ├── vararginmatch.m ├── CopyNecessaryFilesMSWebApp.m ├── MakeResampleMatrices.m ├── mywaitbar.m ├── VAsph2cart.m ├── bluered.m ├── FixSetNames.m ├── splint2.m ├── ReadSXYZ.m ├── .gitignore ├── CompareTemplateMaps.m ├── rotate.m ├── MSTemplateEditor.prj ├── MSTemplatesCarTool2eeglab.m ├── eeg_kMeans.m ├── LoadSetFromExcelTemplate.m ├── README.md ├── SetXYZCoordinates.m ├── dspCMap.m ├── Microstate template explorer.prj ├── dspCMap2T.m ├── MSTemplateExplorer.prj └── GetChannelPositionsFromLabels.m /dispp.m: -------------------------------------------------------------------------------- 1 | function dispp(txt) 2 | disp(txt); 3 | pause -------------------------------------------------------------------------------- /DefaultPath.txt: -------------------------------------------------------------------------------- 1 | D:\Dropbox (PUK-TRC)\Desktop\Metamaps V2.0\DataReceived 2 | -------------------------------------------------------------------------------- /3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/3D.png -------------------------------------------------------------------------------- /txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/txt.png -------------------------------------------------------------------------------- /Broom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Broom.png -------------------------------------------------------------------------------- /Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Edit.png -------------------------------------------------------------------------------- /Excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Excel.png -------------------------------------------------------------------------------- /Filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Filter.png -------------------------------------------------------------------------------- /Minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Minus.png -------------------------------------------------------------------------------- /Open.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Open.jpg -------------------------------------------------------------------------------- /Plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Plus.png -------------------------------------------------------------------------------- /Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Save.png -------------------------------------------------------------------------------- /SaveAs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/SaveAs.png -------------------------------------------------------------------------------- /Spin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Spin.png -------------------------------------------------------------------------------- /Swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Swap.png -------------------------------------------------------------------------------- /CarTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/CarTool.png -------------------------------------------------------------------------------- /Cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Cluster.png -------------------------------------------------------------------------------- /Compute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Compute.png -------------------------------------------------------------------------------- /NoFilter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/NoFilter.png -------------------------------------------------------------------------------- /Process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Process.png -------------------------------------------------------------------------------- /SpinVert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/SpinVert.png -------------------------------------------------------------------------------- /AddTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/AddTemplate.png -------------------------------------------------------------------------------- /binoculars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/binoculars.png -------------------------------------------------------------------------------- /MSTemplateEditor.mlapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/MSTemplateEditor.mlapp -------------------------------------------------------------------------------- /SetXYZCoordinates.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/SetXYZCoordinates.fig -------------------------------------------------------------------------------- /s10548-023-00993-6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/s10548-023-00993-6.pdf -------------------------------------------------------------------------------- /MSTemplateExplorer.mlapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/MSTemplateExplorer.mlapp -------------------------------------------------------------------------------- /Template Maps/Hu 2023.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Hu 2023.set -------------------------------------------------------------------------------- /Template Maps/Lassi2023.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Lassi2023.set -------------------------------------------------------------------------------- /Template Maps/Liu 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Liu 2020.set -------------------------------------------------------------------------------- /Template Maps/Nash 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Nash 2022.set -------------------------------------------------------------------------------- /MSTemplateEditor.mlappinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/MSTemplateEditor.mlappinstall -------------------------------------------------------------------------------- /Template Maps/Artoni 2023.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Artoni 2023.set -------------------------------------------------------------------------------- /Template Maps/Brechet 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Brechet 2020.set -------------------------------------------------------------------------------- /Template Maps/Britz 2010.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Britz 2010.set -------------------------------------------------------------------------------- /Template Maps/Croce 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Croce 2020.set -------------------------------------------------------------------------------- /Template Maps/Croce 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Croce 2022.set -------------------------------------------------------------------------------- /Template Maps/Custo 2017.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Custo 2017.set -------------------------------------------------------------------------------- /Template Maps/Denzer2024.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Denzer2024.set -------------------------------------------------------------------------------- /Template Maps/Diezig 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Diezig 2022.set -------------------------------------------------------------------------------- /Template Maps/Hanoglu 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Hanoglu 2022.set -------------------------------------------------------------------------------- /Template Maps/Hill2023_EC.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Hill2023_EC.set -------------------------------------------------------------------------------- /Template Maps/Hill2023_EO.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Hill2023_EO.set -------------------------------------------------------------------------------- /Template Maps/Koenig 2002.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Koenig 2002.set -------------------------------------------------------------------------------- /Template Maps/Murphy 2018.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Murphy 2018.set -------------------------------------------------------------------------------- /Template Maps/Musaeus 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Musaeus 2020.set -------------------------------------------------------------------------------- /Template Maps/Ricci 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Ricci 2020.set -------------------------------------------------------------------------------- /Template Maps/Ricci 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Ricci 2022.set -------------------------------------------------------------------------------- /Template Maps/Spring 2017.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Spring 2017.set -------------------------------------------------------------------------------- /Template Maps/Spring 2018.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Spring 2018.set -------------------------------------------------------------------------------- /Template Maps/Spring 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Spring 2022.set -------------------------------------------------------------------------------- /Template Maps/Tomescu 2018.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Tomescu 2018.set -------------------------------------------------------------------------------- /Template Maps/Tomescu 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Tomescu 2022.set -------------------------------------------------------------------------------- /Template Maps/Zanesco 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zanesco 2020.set -------------------------------------------------------------------------------- /MSTemplateExplorer.mlappinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/MSTemplateExplorer.mlappinstall -------------------------------------------------------------------------------- /Template Maps/Antonova 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Antonova 2022.set -------------------------------------------------------------------------------- /Template Maps/Deolindo 2021.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Deolindo 2021.set -------------------------------------------------------------------------------- /Template Maps/Giordano 2018.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Giordano 2018.set -------------------------------------------------------------------------------- /Template Maps/Lehmann 2005HC.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Lehmann 2005HC.set -------------------------------------------------------------------------------- /Template Maps/Lehmann 2005SZ.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Lehmann 2005SZ.set -------------------------------------------------------------------------------- /Template Maps/Notturno 2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Notturno 2022.set -------------------------------------------------------------------------------- /Template Maps/Schiller 2019.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Schiller 2019.set -------------------------------------------------------------------------------- /Template Maps/Schiller 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Schiller 2020.set -------------------------------------------------------------------------------- /Template Maps/Smailovic 2019.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Smailovic 2019.set -------------------------------------------------------------------------------- /Template Maps/Tarailis 2021.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Tarailis 2021.set -------------------------------------------------------------------------------- /Template Maps/Vellante 2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Vellante 2020.set -------------------------------------------------------------------------------- /Template Maps/Zanesco 2021a.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zanesco 2021a.set -------------------------------------------------------------------------------- /Template Maps/Zanesco 2021b.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zanesco 2021b.set -------------------------------------------------------------------------------- /Template Maps/Zanesco 2021c.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zanesco 2021c.set -------------------------------------------------------------------------------- /Template Maps/Zappasodi 2019.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zappasodi 2019.set -------------------------------------------------------------------------------- /Template Maps/Damborska 2019a.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Damborska 2019a.set -------------------------------------------------------------------------------- /Template Maps/Damborska 2019b.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Damborska 2019b.set -------------------------------------------------------------------------------- /Template Maps/Hu Emotions 2021.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Hu Emotions 2021.set -------------------------------------------------------------------------------- /Template Maps/Shen_emotion_2020.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Shen_emotion_2020.set -------------------------------------------------------------------------------- /Template Maps/Croce 2018 AG-Post.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Croce 2018 AG-Post.set -------------------------------------------------------------------------------- /Template Maps/Croce 2018 IPS-Post.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Croce 2018 IPS-Post.set -------------------------------------------------------------------------------- /Template Maps/Kleinert 2022 Set1.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Kleinert 2022 Set1.set -------------------------------------------------------------------------------- /Template Maps/Kleinert 2022 Set2.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Kleinert 2022 Set2.set -------------------------------------------------------------------------------- /Template Maps/Nagabhushan 2020 TD.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Nagabhushan 2020 TD.set -------------------------------------------------------------------------------- /Template Maps/Deiber Borderline 2023.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Deiber Borderline 2023.set -------------------------------------------------------------------------------- /Template Maps/Linton_Modafinil_2022.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Linton_Modafinil_2022.set -------------------------------------------------------------------------------- /Template Maps/Nagabhushan 2020 ASD.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Nagabhushan 2020 ASD.set -------------------------------------------------------------------------------- /Template Maps/Sharma Parkinson 2021.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Sharma Parkinson 2021.set -------------------------------------------------------------------------------- /Template Maps/Toplutas 2023 DOC_HC.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Toplutas 2023 DOC_HC.set -------------------------------------------------------------------------------- /Template Maps/Toplutas 2023 DOC_MCS.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Toplutas 2023 DOC_MCS.set -------------------------------------------------------------------------------- /Template Maps/Toplutas 2023 DOC_VS.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Toplutas 2023 DOC_VS.set -------------------------------------------------------------------------------- /Template Maps/Zelenina_2022 Oxytocin.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zelenina_2022 Oxytocin.set -------------------------------------------------------------------------------- /Microstate template explorer.mlappinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Microstate template explorer.mlappinstall -------------------------------------------------------------------------------- /Template Maps/Croce 2018 Sham Pre TPJ.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Croce 2018 Sham Pre TPJ.set -------------------------------------------------------------------------------- /Template Maps/Zappasodi 2017 Controls.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zappasodi 2017 Controls.set -------------------------------------------------------------------------------- /Template Maps/Caoqike_dep-insomnia_2023.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Caoqike_dep-insomnia_2023.set -------------------------------------------------------------------------------- /Template Maps/Milz_2016_Cognitive Style.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Milz_2016_Cognitive Style.set -------------------------------------------------------------------------------- /Template Maps/Murphy Depression 2020 FEP.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Murphy Depression 2020 FEP.set -------------------------------------------------------------------------------- /Template Maps/Murphy Depression 2020 MDD.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Murphy Depression 2020 MDD.set -------------------------------------------------------------------------------- /Template Maps/Qin2022 Depression_Controls.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Qin2022 Depression_Controls.set -------------------------------------------------------------------------------- /Template Maps/Qin2022 Depression_Patients.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Qin2022 Depression_Patients.set -------------------------------------------------------------------------------- /Template Maps/Zappasodi 2017 Patients Left.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zappasodi 2017 Patients Left.set -------------------------------------------------------------------------------- /Template Maps/Zappasodi 2017 Patients Right.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Zappasodi 2017 Patients Right.set -------------------------------------------------------------------------------- /Template Maps/Müller 2005 Multistable perception.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Müller 2005 Multistable perception.set -------------------------------------------------------------------------------- /Template Maps/Schiller2021 Alcohol Intoxication.set: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasKoenigBern/MS-Template-Explorer/HEAD/Template Maps/Schiller2021 Alcohol Intoxication.set -------------------------------------------------------------------------------- /FixTemplateDomains.m: -------------------------------------------------------------------------------- 1 | Clean 2 | 3 | d = dir('Template Maps/*.set'); 4 | 5 | fnames = {d.name}; 6 | 7 | for i = 1:67 8 | MSTemplateEditor(fullfile('Template Maps/',fnames{i})); 9 | end -------------------------------------------------------------------------------- /NormDim.m: -------------------------------------------------------------------------------- 1 | function [out,divisor] = NormDim(in,dim) 2 | 3 | % Copyright 2009-2011 Thomas Koenig 4 | % distributed under the terms of the GNU AFFERO General Public License 5 | 6 | rep = ones(numel(size(in)),1); 7 | rep(dim) = size(in,dim); 8 | d = std(in,1,dim); 9 | d(d == 0) = 1; 10 | divisor = repmat(d,rep(:)'); 11 | out = in./divisor; -------------------------------------------------------------------------------- /Planar2Sphere.m: -------------------------------------------------------------------------------- 1 | function [x,y,z] = Planar2Sphere(pxG,pyG,fact) 2 | 3 | if nargin < 3 4 | fact = 1; 5 | end 6 | Theta = sqrt(pxG.^2 + pyG.^2); 7 | 8 | z = cos(Theta/180 * pi); 9 | 10 | k = sqrt((1-z.^2) ./ (pxG.^2 + pyG.^2)); 11 | 12 | 13 | Theta(Theta == 0) = 1; 14 | 15 | x = pxG .* k * fact; 16 | y = pyG .* k * fact; 17 | z = z * fact; 18 | 19 | end 20 | -------------------------------------------------------------------------------- /vararginmatch.m: -------------------------------------------------------------------------------- 1 | function i = vararginmatch(v,str) 2 | 3 | % Copyright 2009-2011 Thomas Koenig 4 | % distributed under the terms of the GNU AFFERO General Public License 5 | i = 0; 6 | 7 | if isempty(v) 8 | return 9 | end 10 | 11 | if iscell(v(1)) 12 | for i = 1:numel(v) 13 | if strcmp(v{i},str) 14 | return 15 | end 16 | end 17 | else 18 | if strcmp(v,str) 19 | i = 1; 20 | end 21 | end 22 | i = 0; 23 | -------------------------------------------------------------------------------- /CopyNecessaryFilesMSWebApp.m: -------------------------------------------------------------------------------- 1 | mfilePath = fileparts(which('MSTemplateExplorer.mlapp')); 2 | 3 | 4 | FilesINeed = matlab.codetools.requiredFilesAndProducts('MSTemplateExplorer.mlapp')'; 5 | FilesINeed = [FilesINeed;matlab.codetools.requiredFilesAndProducts('MSTemplateEditor.mlapp')']; 6 | 7 | FilesINeed = unique(FilesINeed); 8 | 9 | FilesINeed(contains(FilesINeed,'MSWebApp')) = []; 10 | FilesINeed(contains(FilesINeed,'userpath.m')) = []; 11 | 12 | for i = 1:numel(FilesINeed) 13 | [FilePath,FileName,Ext] = fileparts(FilesINeed{i}); 14 | Dest = fullfile(mfilePath,[FileName Ext]); 15 | copyfile(FilesINeed{i},Dest); 16 | end -------------------------------------------------------------------------------- /MakeResampleMatrices.m: -------------------------------------------------------------------------------- 1 | function [LocalToGlobal,GlobalToLocal] = MakeResampleMatrices(chanlocs_local,chanlocs_global) 2 | 3 | [xyz_local ,nelec_local] = ChanPos2XYZ(chanlocs_local); 4 | [xyz_global,nelec_global] = ChanPos2XYZ(chanlocs_global); 5 | warning('off','all'); 6 | LocalToGlobal = splint2(xyz_local ,eye(nelec_local) ,xyz_global); 7 | GlobalToLocal = splint2(xyz_global,eye(nelec_global),xyz_local ); 8 | warning('on','all'); 9 | end 10 | 11 | 12 | function [xyz,nelec] = ChanPos2XYZ(chanlocs) 13 | 14 | nelec = numel(chanlocs); 15 | 16 | [x{1:nelec}] = deal(chanlocs.X); 17 | [y{1:nelec}] = deal(chanlocs.Y); 18 | [z{1:nelec}] = deal(chanlocs.Z); 19 | 20 | xyz = [cell2mat(x)' cell2mat(y)' cell2mat(z)']; 21 | end -------------------------------------------------------------------------------- /mywaitbar.m: -------------------------------------------------------------------------------- 1 | function [step, strLength] = mywaitbar(compl, total, step, nSteps, strLength,progStrArray) 2 | 3 | if nargin < 6 4 | progStrArray = '/-\|'; 5 | end 6 | tmp = floor(compl / total * nSteps); 7 | if step == nSteps 8 | fprintf(1, [repmat('\b', 1, strLength) '%s']); 9 | strLength = fprintf(1, '| Done'); 10 | return; 11 | end 12 | if tmp > step 13 | fprintf(1, [repmat('\b', 1, strLength) '%s'], repmat('=', 1, tmp - step)); 14 | step = tmp; 15 | ete = ceil(toc / step * (nSteps - step)); 16 | strLength = fprintf(1, [repmat(' ', 1, nSteps - step) '%s %3d%%, ETE %02d:%02d'], progStrArray(mod(step - 1, 4) + 1), floor(step * 100 / nSteps), floor(ete / 60), mod(ete, 60)); 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /VAsph2cart.m: -------------------------------------------------------------------------------- 1 | function [x,y,z] = VAsph2cart(Channel) 2 | 3 | % Copyright 2009-2011 Thomas Koenig 4 | % distributed under the terms of the GNU AFFERO General Public License 5 | 6 | tmp = Channel(1); 7 | 8 | if isfield(tmp,'CoordsTheta') 9 | %if exist('Analyzer','var') % Analyzer 2 10 | for i = 1:numel(Channel) 11 | Theta(i) = Channel(i).CoordsTheta; 12 | Phi(i) = Channel(i).CoordsPhi; 13 | Radius(i) = Channel(i).CoordsRadius; 14 | end 15 | else 16 | for i = 1:numel(Channel) 17 | Theta(i) = Channel(i).Theta; 18 | Phi(i) = Channel(i).Phi; 19 | Radius(i) = Channel(i).Radius; 20 | end 21 | end 22 | 23 | Theta = Theta / 180 * pi; 24 | Phi = Phi / 180 * pi; 25 | 26 | z = Radius .* cos(Theta); 27 | x = Radius .* cos(Phi) .* sin(Theta); 28 | y = Radius .* sin(Phi) .* sin(Theta); -------------------------------------------------------------------------------- /bluered.m: -------------------------------------------------------------------------------- 1 | function h = bluered(m) 2 | %HOT Black-red-yellow-white color map. 3 | % HOT(M) returns an M-by-3 matrix containing a "hot" colormap. 4 | % HOT, by itself, is the same length as the current colormap. 5 | % 6 | % For example, to reset the colormap of the current figure: 7 | % 8 | % colormap(hot) 9 | % 10 | % See also HSV, GRAY, PINK, COOL, BONE, COPPER, FLAG, 11 | % COLORMAP, RGBPLOT. 12 | 13 | % C. Moler, 8-17-88, 5-11-91, 8-19-92. 14 | % Copyright 1984-2001 The MathWorks, Inc. 15 | % $Revision: 5.6 $ $Date: 2001/04/15 11:58:57 $ 16 | 17 | if nargin < 1, m = size(get(gcf,'colormap'),1); end 18 | 19 | n = fix(1/2*m); 20 | o = m - n - n; 21 | 22 | r = [(0:n-1)'/n ;ones(o,1) ; ones(n,1)]; 23 | g = [(0:n-1)'/n ;ones(o,1) ; (n-1:-1:0)'/n]; 24 | b = [ones(n,1);ones(o,1); (n-1:-1:0)'/n]; 25 | 26 | h = [r g b]; -------------------------------------------------------------------------------- /FixSetNames.m: -------------------------------------------------------------------------------- 1 | indir = '/Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/MSWebApp/Templates/Maps 2023-04-l19'; 2 | 3 | d = dir(fullfile(indir,'Custo*.set')); 4 | outdir = fullfile(indir,'fixed'); 5 | mkdir(outdir); 6 | 7 | for i = 1:numel(d) 8 | 9 | load(fullfile(d(i).folder,d(i).name),'-mat'); 10 | [~,fn] = fileparts(d(i).name); 11 | EEG.setname = fn; 12 | 13 | nClasses = EEG.msinfo.ClustPar.MaxClasses; 14 | clc 15 | disp('-----------------------'); 16 | fprintf(1,'%s: %s, %s\n',fn,EEG.msinfo.Citation.Authors,EEG.msinfo.Citation.Year); 17 | 18 | CurrentLabels = EEG.msinfo.MSMaps(nClasses).Labels; 19 | disp(CurrentLabels); 20 | 21 | answer = questdlg('Fix label names?'); 22 | 23 | if strcmp(answer,'Cancel') 24 | break; 25 | end 26 | 27 | if strcmp(answer,'Yes') 28 | answer = inputdlg({'Old part','New part'},'Fix things',1,{CurrentLabels{1},fn}); 29 | if ~isempty(answer) 30 | for l = 1:numel(CurrentLabels) 31 | CurrentLabels{l} = strrep(CurrentLabels{l},answer{1},answer{2}); 32 | end 33 | EEG.msinfo.MSMaps(nClasses).Labels = CurrentLabels; 34 | end 35 | end 36 | 37 | save(fullfile(outdir,d(i).name),'EEG','-mat'); 38 | 39 | 40 | end -------------------------------------------------------------------------------- /splint2.m: -------------------------------------------------------------------------------- 1 | function V2 = splint2(elc1, V1, elc2) 2 | 3 | N = size(elc1,1); % number of known electrodes 4 | M = size(elc2,1); % number of unknown electrodes 5 | T = size(V1,2); % number of timepoints in the potential 6 | Z = V1; % potential on known electrodes, can be matrix 7 | 8 | % scale all electrodes towards a unit sphere 9 | elc1 = elc1 ./ repmat(sqrt(sum(elc1.^2,2)), 1, 3); 10 | elc2 = elc2 ./ repmat(sqrt(sum(elc2.^2,2)), 1, 3); 11 | 12 | G = computeg(elc1(:,1)',elc1(:,2)',elc1(:,3)',elc1(:,1)',elc1(:,2)',elc1(:,3)'); 13 | 14 | H = ones(N+1,N+1); H(1,1) = 0; H(2:end,2:end) = G; 15 | 16 | C = H \ [zeros(1,T); Z]; % solve by Gaussian elimination 17 | 18 | gx = computeg(elc2(:,1)',elc2(:,2)',elc2(:,3)',elc1(:,1)',elc1(:,2)',elc1(:,3)'); 19 | 20 | V2 = [ones(M,1) gx] * C; 21 | 22 | end 23 | 24 | 25 | function g = computeg(x,y,z,xelec,yelec,zelec) 26 | 27 | unitmat = ones(length(x(:)),length(xelec)); 28 | EI = unitmat - sqrt((repmat(x(:),1,length(xelec)) - repmat(xelec,length(x(:)),1)).^2 +... 29 | (repmat(y(:),1,length(xelec)) - repmat(yelec,length(x(:)),1)).^2 +... 30 | (repmat(z(:),1,length(xelec)) - repmat(zelec,length(x(:)),1)).^2); 31 | 32 | g = zeros(length(x(:)),length(xelec)); 33 | 34 | m = 4; % 3 is linear, 4 is best according to Perrin's curve 35 | for n = 1:7 36 | L = legendre(n,EI); 37 | g = g + ((2*n+1)/(n^m*(n+1)^m))*squeeze(L(1,:,:)); 38 | end 39 | g = g/(4*pi); 40 | end 41 | 42 | -------------------------------------------------------------------------------- /ReadSXYZ.m: -------------------------------------------------------------------------------- 1 | function [Montage,pos,lbl] = ReadSXYZ(fname) 2 | 3 | % Copyright 2009-2011 Thomas Koenig 4 | % distributed under the terms of the GNU AFFERO General Public License 5 | 6 | [fid,message] = fopen(fname,'rt'); 7 | 8 | if fid == -1 9 | errordlg(message,'Read SXYZ File'); 10 | Montage = []; 11 | return; 12 | end 13 | 14 | l = fgets(fid); 15 | [params,pcount] = sscanf(l,'%f'); 16 | 17 | nChannels = params(1); 18 | 19 | C = textscan(fid,'%f%f%f%s'); 20 | fclose(fid); 21 | 22 | if numel(C) ~= 4 23 | errordlg('Problem with file format, not 4 columns found','Read SXYZ File'); 24 | Montage = []; 25 | end 26 | 27 | x = C{1}; 28 | y = C{2}; 29 | z = C{3}; 30 | lbl = C{4}; 31 | 32 | Coords.pos = [x y z]; 33 | Coords.lbl = lbl; 34 | 35 | if numel(x) ~= nChannels 36 | errordlg('Channel number mismatch','Read SXYZ File'); 37 | end 38 | 39 | 40 | h = SetXYZCoordinates([],[],[],Coords); 41 | 42 | if isempty(h) 43 | Montage = []; 44 | return; 45 | end 46 | 47 | Coords = get(h,'UserData'); 48 | 49 | close(h); 50 | 51 | x = Coords.x; 52 | y = Coords.y; 53 | z = Coords.z; 54 | 55 | pos = [x y z]; 56 | 57 | sgnx = ones(numel(x),1); 58 | sgnx(x<0) = -1; 59 | 60 | sgny = ones(numel(y),1); 61 | sgny(y<=0) = -1; 62 | 63 | r = sqrt(x.*x + y.*y + z.*z); 64 | rh = sqrt(x.*x + y.*y); 65 | ph = abs(acos(abs(x) ./ rh) / pi * 180); 66 | ph(rh == 0) = 0; 67 | th = abs(acos(abs(z) ./ r ) / pi * 180); 68 | 69 | for i = 1:nChannels 70 | Montage(i).Name = lbl{i}; 71 | Montage(i).Ref = ''; 72 | Montage(i).Radius = r(i); 73 | 74 | if z(i) < 0 75 | Montage(i).Theta = -(-180 + th(i)) * sgnx(i); 76 | else 77 | Montage(i).Theta = th(i) * sgnx(i); 78 | end 79 | Montage(i).Phi = ph(i) * sgnx(i) * sgny(i); 80 | Montage(i).sx = sgnx(i); 81 | end 82 | 83 | 84 | 85 | 86 | %pos = [x y z]; 87 | %Montage = [y -x z]; 88 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | DefaultPath.txt 4 | Template Maps 2023-04-19/Zappasodi 2019.set 5 | Template Maps 2023-04-19/Zanesco 2021c.set 6 | Template Maps 2023-04-19/Zanesco 2021b.set 7 | Template Maps 2023-04-19/Zanesco 2021a.set 8 | Template Maps 2023-04-19/Zanesco 2020.set 9 | Template Maps 2023-04-19/Vellante 2020.set 10 | Template Maps 2023-04-19/Tomescu 2022.set 11 | Template Maps 2023-04-19/Tomescu 2018.set 12 | Template Maps 2023-04-19/Tarailis 2021.set 13 | Template Maps 2023-04-19/Stroke & TMS/Zappasodi 2017 Patients Right.set 14 | Template Maps 2023-04-19/Stroke & TMS/Zappasodi 2017 Patients Left.set 15 | Template Maps 2023-04-19/Stroke & TMS/Zappasodi 2017 Controls.set 16 | Template Maps 2023-04-19/Stroke & TMS/Croce 2018 Sham Pre TPJ.set 17 | Template Maps 2023-04-19/Stroke & TMS/Croce 2018 IPS-Post.set 18 | Template Maps 2023-04-19/Stroke & TMS/Croce 2018 AG-Post.set 19 | Template Maps 2023-04-19/Spring 2022.set 20 | Template Maps 2023-04-19/Spring 2018.set 21 | Template Maps 2023-04-19/Spring 2017.set 22 | Template Maps 2023-04-19/Smailovic 2019.set 23 | Template Maps 2023-04-19/Schiller 2020.set 24 | Template Maps 2023-04-19/Schiller 2019.set 25 | Template Maps 2023-04-19/Ricci 2022.set 26 | Template Maps 2023-04-19/Ricci 2020.set 27 | Template Maps 2023-04-19/Notturno 2022.set 28 | Template Maps 2023-04-19/Nash 2022.set 29 | Template Maps 2023-04-19/Nagabhushan 2020 TD.set 30 | Template Maps 2023-04-19/Nagabhushan 2020 ASD.set 31 | Template Maps 2023-04-19/Musaeus 2020.set 32 | Template Maps 2023-04-19/Murphy 2018.set 33 | Template Maps 2023-04-19/Liu 2020.set 34 | Template Maps 2023-04-19/Koenig 2002.set 35 | Template Maps 2023-04-19/Kleinert 2022 Set2.set 36 | Template Maps 2023-04-19/Kleinert 2022 Set1.set 37 | Template Maps 2023-04-19/Hu 2023.set 38 | Template Maps 2023-04-19/Hanoglu 2022.set 39 | Template Maps 2023-04-19/Diezig 2022.set 40 | Template Maps 2023-04-19/Deolindo 2021.set 41 | Template Maps 2023-04-19/Damborska 2019b.set 42 | Template Maps 2023-04-19/Damborska 2019a.set 43 | Template Maps 2023-04-19/Custo 2017.set 44 | Template Maps 2023-04-19/Croce 2022.set 45 | Template Maps 2023-04-19/Croce 2020.set 46 | Template Maps 2023-04-19/Britz 2010.set 47 | Template Maps 2023-04-19/Brechet 2020.set 48 | Template Maps 2023-04-19/Artoni 2023.set 49 | Template Maps 2023-04-19/Antonova 2022.set 50 | DefaultPath.txt 51 | -------------------------------------------------------------------------------- /CompareTemplateMaps.m: -------------------------------------------------------------------------------- 1 | function C = CompareTemplateMaps(eeg1,eeg2,nTemplates1, nTemplates2) 2 | 3 | 4 | if nargin < 3 5 | if eeg1.msinfo.ClustPar.MinClasses ~= eeg1.msinfo.ClustPar.MaxClasses 6 | eeg1.setname 7 | error('Dataset can only contain one microstate solution'); 8 | else 9 | nTemplates1 = eeg1.msinfo.ClustPar.MinClasses; 10 | end 11 | else 12 | if nTemplates1 < eeg1.msinfo.ClustPar.MinClasses || nTemplates1 > eeg1.msinfo.ClustPar.MaxClasses 13 | error('Dataset 1 does not contain the requested microstate solution'); 14 | end 15 | end 16 | 17 | if nargout > 0 && nargin < 2 18 | C = corr(eeg1.msinfo.MSMaps(nTemplates1).Maps'); 19 | return 20 | end 21 | 22 | if nargin < 4 23 | if eeg2.msinfo.ClustPar.MinClasses ~= eeg2.msinfo.ClustPar.MaxClasses 24 | error('Dataset can only contain one microstate solution'); 25 | else 26 | nTemplates2 = eeg2.msinfo.ClustPar.MinClasses; 27 | end 28 | else 29 | if nTemplates2 < eeg2.msinfo.ClustPar.MinClasses || nTemplates2 > eeg2.msinfo.ClustPar.MaxClasses 30 | error('Dataset 2 does not contain the requested microstate solution'); 31 | end 32 | end 33 | 34 | nChannels1 = size(eeg1.msinfo.MSMaps(nTemplates1).Maps,2); 35 | nChannels2 = size(eeg2.msinfo.MSMaps(nTemplates2).Maps,2); 36 | 37 | 38 | if isequal(eeg1.chanlocs,eeg2.chanlocs) 39 | Maps1 = eeg1.msinfo.MSMaps(nTemplates1).Maps; 40 | Maps2 = eeg2.msinfo.MSMaps(nTemplates2).Maps; 41 | else 42 | if nChannels1 > nChannels2 43 | 44 | ResamplingMat = MakeResampleMatrices(eeg1.chanlocs,eeg2.chanlocs); 45 | Maps1 = eeg1.msinfo.MSMaps(nTemplates1).Maps * ResamplingMat'; 46 | Maps2 = eeg2.msinfo.MSMaps(nTemplates2).Maps; 47 | else 48 | ResamplingMat = MakeResampleMatrices(eeg2.chanlocs,eeg1.chanlocs); 49 | Maps1 = eeg1.msinfo.MSMaps(nTemplates1).Maps; 50 | Maps2 = eeg2.msinfo.MSMaps(nTemplates2).Maps * ResamplingMat'; 51 | end 52 | end 53 | 54 | C = corr(double(Maps1)',double(Maps2)'); 55 | 56 | 57 | if nargout < 1 58 | clf 59 | for i = 1:nTemplates1 60 | subplot(nTemplates1+1,nTemplates2+1,i * (nTemplates2+1)+1); 61 | mx = max(abs(eeg1.msinfo.MSMaps(nTemplates1).Maps(:))); 62 | dspCMap(double(eeg1.msinfo.MSMaps(nTemplates1).Maps(i,:)),eeg1.chanlocs,'Step',mx/8); 63 | end 64 | 65 | for j = 1:nTemplates2 66 | subplot(nTemplates1+1,nTemplates2+1,j + 1); 67 | mx = max(abs(eeg2.msinfo.MSMaps(nTemplates2).Maps(:))); 68 | dspCMap(double(eeg2.msinfo.MSMaps(nTemplates2).Maps(j,:)),eeg2.chanlocs,'Step',mx/8); 69 | end 70 | 71 | 72 | 73 | 74 | for i = 1:nTemplates1 75 | for j = 1:nTemplates2 76 | h = subplot(nTemplates1+1,nTemplates2+1,j + 1 + (nTemplates2+1) * i); 77 | text(0.5,0.5,sprintf('%3.3f',C(i,j)),'HorizontalAlignment','center'); 78 | h.XLim = [0 1]; 79 | h.YLim = [0 1]; 80 | axis(h,'off'); 81 | end 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /rotate.m: -------------------------------------------------------------------------------- 1 | function rotate(h,azel,alpha,origin) 2 | %ROTATE Rotate objects about specified origin and direction. 3 | % ROTATE(H,[THETA PHI],ALPHA) rotates the objects with handles H 4 | % through angle ALPHA about an axis described by the 2-element 5 | % direction vector [THETA PHI] (spherical coordinates). 6 | % All the angles are in degrees. The handles in H must be children 7 | % of the same axes. 8 | % 9 | % THETA is the angle in the xy plane counterclockwise from the 10 | % positive x axis. PHI is the elevation of the direction vector 11 | % from the xy plane (see also SPH2CART). Positive ALPHA is defined 12 | % as the righthand-rule angle about the direction vector as it 13 | % extends from the origin. 14 | % 15 | % ROTATE(H,[X Y Z],ALPHA) rotates the objects about the direction 16 | % vector [X Y Z] (Cartesian coordinates). The direction vector 17 | % is the vector from the center of the plot box to (X,Y,Z). 18 | % 19 | % ROTATE(...,ORIGIN) uses the point ORIGIN = [x0,y0,y0] as 20 | % the center of rotation instead of the center of the plot box. 21 | % 22 | % See also SPH2CART, CART2SPH. 23 | % Copyright 1984-2009 The MathWorks, Inc. 24 | % Bug fixed: now rotates the vertexnormals property of surf objects 25 | % in order to correctly calculate the lighting. 26 | % Luc Masset, 2012 (luc.masset@heliodon.net) 27 | % Determine the default origin (center of plot box). 28 | if nargin < 4 29 | if ~ishghandle(h) 30 | error(id('InvalidHandle'),'H must contain axes children only.'); 31 | end 32 | ax = ancestor(h(1),'axes'); 33 | if isempty(ax) || ax==0, 34 | error(id('InvalidHandle'),'H must contain axes children only.'); 35 | end 36 | origin = sum([get(ax,'xlim')' get(ax,'ylim')' get(ax,'zlim')'])/2; 37 | end 38 | % find unit vector for axis of rotation 39 | if numel(azel) == 2 % theta, phi 40 | theta = pi*azel(1)/180; 41 | phi = pi*azel(2)/180; 42 | u = [cos(phi)*cos(theta); cos(phi)*sin(theta); sin(phi)]; 43 | elseif numel(azel) == 3 % direction vector 44 | u = azel(:)/norm(azel); 45 | end 46 | alph = alpha*pi/180; 47 | cosa = cos(alph); 48 | sina = sin(alph); 49 | vera = 1 - cosa; 50 | x = u(1); 51 | y = u(2); 52 | z = u(3); 53 | rot = [cosa+x^2*vera x*y*vera-z*sina x*z*vera+y*sina; ... 54 | x*y*vera+z*sina cosa+y^2*vera y*z*vera-x*sina; ... 55 | x*z*vera-y*sina y*z*vera+x*sina cosa+z^2*vera]'; 56 | for i=1:numel(h), 57 | t = get(h(i),'type'); 58 | skip = 0; 59 | if strcmp(t,'surface') || strcmp(t,'line') || strcmp(t,'patch') 60 | 61 | % If patch, rotate vertices 62 | if strcmp(t,'patch') 63 | verts = get(h(i),'Vertices'); 64 | x = verts(:,1); y = verts(:,2); 65 | if size(verts,2)>2 66 | z = verts(:,3); 67 | else 68 | z = []; 69 | end 70 | 71 | % If surface or line, rotate {x,y,z}data 72 | else 73 | x = get(h(i),'xdata'); 74 | y = get(h(i),'ydata'); 75 | z = get(h(i),'zdata'); 76 | end 77 | 78 | if isempty(z) 79 | z = -origin(3)*ones(size(y)); 80 | end 81 | [m,n] = size(z); 82 | if numel(x) < m*n 83 | [x,y] = meshgrid(x,y); 84 | end 85 | elseif strcmp(t,'text') 86 | p = get(h(i),'position'); 87 | x = p(1); y = p(2); z = p(3); 88 | elseif strcmp(t,'image') 89 | x = get(h(i),'xdata'); 90 | y = get(h(i),'ydata'); 91 | z = zeros(size(x)); 92 | else 93 | skip = 1; 94 | end 95 | 96 | if ~skip, 97 | [m,n] = size(x); 98 | newxyz = [x(:)-origin(1), y(:)-origin(2), z(:)-origin(3)]; 99 | newxyz = newxyz*rot; 100 | newx = origin(1) + reshape(newxyz(:,1),m,n); 101 | newy = origin(2) + reshape(newxyz(:,2),m,n); 102 | newz = origin(3) + reshape(newxyz(:,3),m,n); 103 | if strcmp(t,'surface') || strcmp(t,'line') 104 | set(h(i),'xdata',newx,'ydata',newy,'zdata',newz); 105 | if strcmp(t,'surface') % bug fixed 106 | vn=get(h(i),'vertexnormals'); % bug fixed 107 | vnx=vn(:,:,1); % bug fixed 108 | vny=vn(:,:,2); % bug fixed 109 | vnz=vn(:,:,3); % bug fixed 110 | vnxyz=[vnx(:) vny(:) vnz(:)]*rot; % bug fixed 111 | for j=1:3, % bug fixed 112 | vn(:,:,j)=reshape(vnxyz(:,j),m,n); % bug fixed 113 | end % bug fixed 114 | set(h(i),'vertexnormals',vn); % bug fixed 115 | end % bug fixed 116 | elseif strcmp(t,'patch') 117 | set(h(i),'Vertices',[newx,newy,newz]); 118 | elseif strcmp(t,'text') 119 | set(h(i),'position',[newx newy newz]) 120 | elseif strcmp(t,'image') 121 | set(h(i),'xdata',newx,'ydata',newy) 122 | end 123 | end 124 | end 125 | function str=id(str) 126 | str = ['MATLAB:rotate:' str]; 127 | -------------------------------------------------------------------------------- /MSTemplateEditor.prj: -------------------------------------------------------------------------------- 1 | 2 | 3 | MSTemplateEditor 4 | Thomas Koenig 5 | thomas.koenig@unibe.ch 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1.0 13 | 14 | 15 | 16 | 17 | ${PROJECT_ROOT} 18 | f728db88-24e7-4049-a59b-4ddd1d6e094d 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ${PROJECT_ROOT}/MSTemplateExplorer.mlapp 35 | 36 | 37 | ${MATLAB_ROOT}/toolbox/local/userpath.m 38 | ${PROJECT_ROOT}/3D.png 39 | ${PROJECT_ROOT}/AddTemplate.png 40 | ${PROJECT_ROOT}/Broom.png 41 | ${PROJECT_ROOT}/CarTool.png 42 | ${PROJECT_ROOT}/Cluster.png 43 | ${PROJECT_ROOT}/CompareTemplateMaps.m 44 | ${PROJECT_ROOT}/Compute.png 45 | ${PROJECT_ROOT}/Edit.png 46 | ${PROJECT_ROOT}/Excel.png 47 | ${PROJECT_ROOT}/Filter.png 48 | ${PROJECT_ROOT}/GetChannelPositionsFromLabels.m 49 | ${PROJECT_ROOT}/LoadSetFromExcelTemplate.m 50 | ${PROJECT_ROOT}/MSTemplateEditor.mlapp 51 | ${PROJECT_ROOT}/MSTemplatesCarTool2eeglab.m 52 | ${PROJECT_ROOT}/MakeResampleMatrices.m 53 | ${PROJECT_ROOT}/Minus.png 54 | ${PROJECT_ROOT}/NoFilter.png 55 | ${PROJECT_ROOT}/NormDim.m 56 | ${PROJECT_ROOT}/Open.jpg 57 | ${PROJECT_ROOT}/Planar2Sphere.m 58 | ${PROJECT_ROOT}/Plus.png 59 | ${PROJECT_ROOT}/ReadSXYZ.m 60 | ${PROJECT_ROOT}/Save.png 61 | ${PROJECT_ROOT}/SaveAs.png 62 | ${PROJECT_ROOT}/SetXYZCoordinates.fig 63 | ${PROJECT_ROOT}/SetXYZCoordinates.m 64 | ${PROJECT_ROOT}/Swap.png 65 | ${PROJECT_ROOT}/VAsph2cart.m 66 | ${PROJECT_ROOT}/binoculars.png 67 | ${PROJECT_ROOT}/bluered.m 68 | ${PROJECT_ROOT}/dspCMap.m 69 | ${PROJECT_ROOT}/dspCMap2T.m 70 | ${PROJECT_ROOT}/eeg_kMeans.m 71 | ${PROJECT_ROOT}/mywaitbar.m 72 | ${PROJECT_ROOT}/rotate.m 73 | ${PROJECT_ROOT}/splint2.m 74 | ${PROJECT_ROOT}/txt.png 75 | ${PROJECT_ROOT}/uipickfiles.m 76 | ${PROJECT_ROOT}/vararginmatch.m 77 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/VAsph2cartStruct.m 78 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/dspMapClass.m 79 | 80 | 81 | 82 | 83 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/MSWebApp 84 | 85 | 86 | 87 | /Applications/MATLAB_R2023b.app 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | true 98 | 99 | 100 | 101 | 102 | true 103 | 104 | 105 | 106 | 107 | true 108 | 109 | 110 | 111 | 112 | true 113 | 114 | 115 | 116 | 117 | true 118 | 119 | 120 | 121 | 122 | true 123 | true 124 | false 125 | false 126 | false 127 | false 128 | false 129 | false 130 | 14.4.1 131 | true 132 | false 133 | maci64 134 | true 135 | 136 | 137 | -------------------------------------------------------------------------------- /MSTemplatesCarTool2eeglab.m: -------------------------------------------------------------------------------- 1 | function [EEG,OutFileName] = MSTemplatesCarTool2eeglab(varargin) 2 | 3 | 4 | p = inputParser; 5 | addOptional(p,'FileName',[]); 6 | addOptional(p,'XYZFile',[]); 7 | addOptional(p,'LabelFile',[]); 8 | addOptional(p,'OutputFile',[]); 9 | addOptional(p,'Comment',[]); 10 | 11 | parse(p,varargin{:}); 12 | 13 | EEG = []; 14 | OutFileName = []; 15 | 16 | if isempty(p.Results.FileName) 17 | [FileName,PathName] = uigetfile({"*.ep","Select EP file";"*.txt","Select text file"}); 18 | if FileName == 0 19 | return 20 | end 21 | 22 | EPFile = fullfile(PathName,FileName); 23 | else 24 | EPFile = p.Results.FileName; 25 | end 26 | 27 | if ~isempty(p.Results.XYZFile) 28 | [Montage,xyz,Labels] = ReadSXYZ(p.Results.XYZFile); 29 | if isempty(Montage) 30 | error('Cannot read file %s',p.Results.XYZFile); 31 | end 32 | elseif ~isempty(p.Results.LabelFile) 33 | Labels = readlines(p.Results.LabelFile); 34 | Montage = GetChannelPositionsFromLabels(Labels); 35 | [x,y,z] = VAsph2cart(Montage); 36 | xyz = [x;y;z]'; 37 | else 38 | [FileName,PathName,FilterIndex] = uigetfile({'*.sxyz';'*.txt'}); 39 | 40 | switch(FilterIndex) 41 | case 0 42 | return; 43 | 44 | case 1 45 | [Montage,xyz,Labels] = ReadSXYZ(fullfile(PathName,FileName)); 46 | if isempty(Montage) 47 | error('Cannot read file %s',p.Results.XYZFile); 48 | end 49 | 50 | case 2 51 | Labels = readlines(fullfile(PathName,FileName)); 52 | Montage = GetChannelPositionsFromLabels(Labels); 53 | [x,y,z] = VAsph2cart(Montage); 54 | xyz = [x;y;z]'; 55 | end 56 | end 57 | 58 | 59 | MSMaps = load(EPFile); 60 | [nMaps,nChannels] = size(MSMaps); 61 | 62 | aref = eye(nChannels) - 1/nChannels; 63 | MSMaps = MSMaps * aref; 64 | 65 | % Convert the XYZ to a sfp file 66 | 67 | nChannels = size(xyz,1); 68 | 69 | EEG = eeg_emptyset(); 70 | EEG.nbchan = size(MSMaps,2); 71 | EEG.trials = 1; 72 | EEG.pnts = size(MSMaps,1); 73 | EEG.srate = 1000; 74 | EEG.xmin = 0; 75 | EEG.xmax = (size(MSMaps,1) - 1) / 1000; 76 | EEG.times = 0 : (size(MSMaps,1) - 1); 77 | EEG.data = single(MSMaps'); 78 | 79 | if ~isempty(p.Results.Comment) 80 | EEG.comments = p.Results.Comment; 81 | end 82 | 83 | for i = 1:nChannels 84 | x = -xyz(i,1); 85 | y = xyz(i,2); 86 | z = xyz(i,3); 87 | EEG.chanlocs(i).Y = x; 88 | EEG.chanlocs(i).X = y; 89 | EEG.chanlocs(i).Z = z; 90 | EEG.chanlocs(i).labels = Labels(i); 91 | [th,phi,radius] = cart2sph(x,y,z); 92 | EEG.chanlocs(i).sph_theta = th/pi*180; 93 | EEG.chanlocs(i).sph_phi = phi/pi*180; 94 | EEG.chanlocs(i).sph_radius = radius; 95 | EEG.chanlocs(i).theta = -EEG.chanlocs(i).sph_theta; 96 | EEG.chanlocs(i).radius = 0.5 - EEG.chanlocs(i).sph_phi/180; 97 | EEG.chanlocs(i).sph_theta_besa = 0; 98 | EEG.chanlocs(i).sph_phi_besa = 0; 99 | EEG.chanlocs(i).type = []; 100 | end 101 | 102 | 103 | EEG.chaninfo = struct('icachansind',[],... 104 | 'plotrad',[],... 105 | 'shrink',[],... 106 | 'nosedir','+X',... 107 | 'nodatchans',[]); 108 | 109 | EEG.ref = 'common'; 110 | EEG.msinfo.MSMaps(nMaps).Maps = MSMaps; 111 | EEG.msinfo.MSMaps(nMaps).ExpVar = nan; 112 | EEG.msinfo.MSMaps(nMaps).ColorMap = lines(nMaps); 113 | EEG.msinfo.MSMaps(nMaps).SortMode = 'none'; 114 | EEG.msinfo.MSMaps(nMaps).SortedBy = ''; 115 | EEG.msinfo.MSMaps(nMaps).SpatialCorrelation = []; 116 | EEG.msinfo.MSMaps(nMaps).Parents = []; 117 | if nargin > 4 118 | EEG.msinfo.MSMaps(nMaps).Labels = Labels; 119 | else 120 | for i = 1:nMaps 121 | EEG.msinfo.MSMaps(nMaps).Labels(i) = {sprintf('Class_%i',i)}; 122 | end 123 | end 124 | EEG.msinfo.ClustPar = struct('MinClasses',nMaps,... 125 | 'MaxClasses',nMaps,... 126 | 'GFPPeaks',1,... 127 | 'IgnorePolarity', 1, ... 128 | 'MaxMaps', NaN, ... 129 | 'Restarts', 5, ... 130 | 'UseAAHC', 0, ... 131 | 'Normalize', 1); 132 | 133 | OutFileName = EPFile; 134 | 135 | if nargout < 1 136 | [outpath,outname,ext] = fileparts(OutFile); 137 | pop_saveset(EEG,'filename',[outname,ext],'filepath',outpath); 138 | end 139 | 140 | 141 | function EEG = eeg_emptyset() 142 | 143 | EEG.setname = ''; 144 | EEG.filename = ''; 145 | EEG.filepath = ''; 146 | EEG.subject = ''; 147 | EEG.group = ''; 148 | EEG.condition = ''; 149 | EEG.session = []; 150 | EEG.comments = ''; 151 | EEG.nbchan = 0; 152 | EEG.trials = 0; 153 | EEG.pnts = 0; 154 | EEG.srate = 1; 155 | EEG.xmin = 0; 156 | EEG.xmax = 0; 157 | EEG.times = []; 158 | EEG.data = []; 159 | EEG.icaact = []; 160 | EEG.icawinv = []; 161 | EEG.icasphere = []; 162 | EEG.icaweights = []; 163 | EEG.icachansind = []; 164 | EEG.chanlocs = []; 165 | EEG.urchanlocs = []; 166 | EEG.chaninfo = []; 167 | EEG.ref = []; 168 | EEG.event = []; 169 | EEG.urevent = []; 170 | EEG.eventdescription = {}; 171 | EEG.epoch = []; 172 | EEG.epochdescription = {}; 173 | EEG.reject = []; 174 | EEG.stats = []; 175 | EEG.specdata = []; 176 | EEG.specicaact = []; 177 | EEG.splinefile = ''; 178 | EEG.icasplinefile = ''; 179 | EEG.dipfit = []; 180 | EEG.history = ''; 181 | EEG.saved = 'no'; 182 | EEG.etc = []; 183 | 184 | %EEG.reject.threshold = [1 0.8 0.85]; 185 | %EEG.reject.icareject = []; 186 | %EEG.reject.compreject = []; 187 | %EEG.reject.gcompreject= []; 188 | %EEG.reject.comptrial = []; 189 | %EEG.reject.sigreject = []; 190 | %EEG.reject.elecreject = []; 191 | 192 | %EEG.stats.kurta = []; 193 | %EEG.stats.kurtr = []; 194 | %EEG.stats.kurtd = []; 195 | %EEG.stats.eegentropy = []; 196 | %EEG.stats.eegkurt = []; 197 | %EEG.stats.eegkurtg = []; 198 | %EEG.stats.entropy = []; 199 | %EEG.stats.kurtc = []; 200 | %EEG.stats.kurtt = []; 201 | %EEG.stats.entropyc = []; 202 | 203 | return; 204 | -------------------------------------------------------------------------------- /eeg_kMeans.m: -------------------------------------------------------------------------------- 1 | function[b_model,b_ind,b_loading,exp_var] = eeg_kMeans(eeg,n_mod,reruns,max_n,flags,chanloc) 2 | % EEG_MOD Create the EEG model I'm working with 3 | % 4 | % function[b_model,b_ind,b_loading,exp_var] = eeg_mod_r(eeg,n_mod,reruns,max_n) 5 | 6 | % input arguments 7 | % eeg = the input data (number of time instances * number of channels) 8 | % n_mod = the number of microstate clusters that you want to extract 9 | % reruns = the number of reiterations (use about 20) 10 | % max_n = maximum number of eeg timepoints used for cluster indentification 11 | 12 | % output arguments 13 | % b_model = cluster centers (microstate topographies) 14 | % b_ind = cluster assignment for each moment of time 15 | % b_loading = Amplitude of the assigned cluster at each moment in time 16 | % exp_var = explained variance of the model 17 | 18 | 19 | if (size(n_mod,1) ~= 1) 20 | error('Second argument must be a scalar') 21 | end 22 | 23 | if (size(n_mod,2) ~= 1) 24 | error('Second argument must be a scalar') 25 | end 26 | 27 | [n_frame,n_chan] = size(eeg); 28 | 29 | if nargin < 3 30 | reruns = 1; 31 | end 32 | 33 | if nargin < 4 34 | max_n = n_frame; 35 | end 36 | 37 | if isempty(max_n) 38 | max_n = n_frame; 39 | end 40 | 41 | 42 | if (max_n > n_frame) 43 | max_n = n_frame; 44 | end 45 | 46 | if n_mod > max_n 47 | warning('Not enough data for clustering'); 48 | b_model = []; 49 | b_ind = []; 50 | b_loading = []; 51 | exp_var = 0; 52 | return 53 | end 54 | 55 | if ~contains(flags,'p') 56 | pmode = 0; 57 | else 58 | pmode = 1; 59 | end 60 | 61 | newRef = eye(n_chan); 62 | if contains(flags,'a') 63 | newRef = newRef -1/n_chan; 64 | end 65 | 66 | UseEMD = false; 67 | if contains(flags,'e') 68 | UseEMD = true; 69 | end 70 | 71 | 72 | 73 | eeg = eeg*newRef; 74 | 75 | if contains(flags,'n') 76 | eeg = NormDim(eeg,2); 77 | end 78 | 79 | org_data = eeg; 80 | best_fit = 0; 81 | 82 | if contains(flags,'b') 83 | h = waitbar(0,sprintf('Computing %i clusters, please wait...',n_mod)); 84 | else 85 | h = []; 86 | nSteps = 20; 87 | step = 0; 88 | fprintf(1, 'k-means clustering(k=%i): |',n_mod); 89 | strLength = fprintf(1, [repmat(' ', 1, nSteps - step) '| 0%%']); 90 | tic 91 | end 92 | 93 | for run = 1:reruns 94 | if isempty(h) 95 | [step, strLength] = mywaitbar(run, reruns, step, nSteps, strLength); 96 | else 97 | t = sprintf('Run: %i / %i',run,reruns); 98 | set(h,'Name',t); 99 | waitbar(run/reruns,h); 100 | end 101 | if nargin > 3 102 | idx = randperm(n_frame); 103 | eeg = org_data(idx(1:max_n),:); 104 | end 105 | 106 | idx = randperm(max_n); 107 | model = eeg(idx(1:n_mod),:); 108 | model = NormDim(model,2)*newRef; % Average Reference, equal variance of model 109 | 110 | o_ind = zeros(max_n,1); % Some initialization 111 | % ind = ones(max_n,1); 112 | count = 0; 113 | covmat = eeg*model'; % Get the unsigned covariance 114 | 115 | if pmode 116 | if UseEMD == true 117 | [~,ind] = min(EMMapDifference(double(eeg),double(model),chanloc,chanloc,false),[],2); 118 | else 119 | [~,ind] = max(covmat,[],2); 120 | end % Look for the best fit 121 | else 122 | if UseEMD == true 123 | [~,ind] = min(EMMapDifference(double(eeg),double(model),chanloc,chanloc,true),[],2); 124 | else 125 | [~,ind] = max(abs(covmat),[],2); % Look for the best fit 126 | end 127 | end 128 | 129 | 130 | % TODO TEMP COUNT LIMIT 131 | conv_limit = 10000; 132 | while count < conv_limit && any(o_ind - ind) 133 | count = count+1; 134 | if count == conv_limit 135 | warning("K-Means Didn't converge in 10000 iterations"); 136 | end 137 | o_ind = ind; 138 | % if pmode 139 | % covm = eeg * model'; % Get the unsigned covariance matrix 140 | % else 141 | % covm = abs(eeg * model'); % Get the unsigned covariance matrix 142 | % end 143 | % [c,ind] = max(covm,[],2); % Look for the best fit 144 | 145 | for i = 1:n_mod 146 | idx = find (ind == i); 147 | if pmode 148 | model(i,:) = mean(eeg(idx,:)); 149 | else 150 | cvm = eeg(idx,:)' * eeg(idx,:); 151 | [v,d] = eigs(double(cvm),1); 152 | model(i,:) = v(:,1)'; 153 | end 154 | end 155 | model = NormDim(model,2)*newRef; % Average Reference, equal variance of model 156 | covmat = eeg*model'; % Get the unsigned covariance 157 | if pmode 158 | if UseEMD == true 159 | [~,ind] = min(EMMapDifference(double(eeg),double(model),chanloc,chanloc,false),[],2); 160 | else 161 | [~,ind] = max(covmat,[],2); 162 | end % Look for the best fit 163 | else 164 | if UseEMD == true 165 | [~,ind] = min(EMMapDifference(double(eeg),double(model),chanloc,chanloc,true),[],2); 166 | else 167 | [~,ind] = max(abs(covmat),[],2); % Look for the best fit 168 | end 169 | end 170 | end % while any 171 | covmat = org_data*model'; % Get the unsigned covariance 172 | if pmode 173 | if UseEMD == true 174 | [~,ind] = min(EMMapDifference(double(org_data),double(model),chanloc,chanloc,false),[],2); 175 | loading = zeros(size(ind)); 176 | for t = 1:numel(ind) 177 | loading(t) = covmat(t,ind(t)); 178 | end 179 | else 180 | [loading,ind] = max(covmat,[],2); % Look for the best fit 181 | end 182 | else 183 | if UseEMD == true 184 | [~,ind] = min(EMMapDifference(double(org_data),double(model),chanloc,chanloc,true),[],2); 185 | loading = zeros(size(ind)); 186 | for t = 1:numel(ind) 187 | loading(t) = abs(covmat(t,ind(t))); 188 | end 189 | else 190 | [loading,ind] = max(abs(covmat),[],2); % Look for the best fit 191 | end 192 | end 193 | 194 | tot_fit = sum(loading); 195 | if (tot_fit > best_fit) 196 | b_model = model; 197 | b_ind = ind; 198 | b_loading = loading; %/sqrt(n_chan); 199 | best_fit = tot_fit; 200 | end 201 | end % for run = 1:reruns 202 | 203 | % average reference eeg in case it was not already done 204 | newRef = eye(n_chan); 205 | newRef = newRef -1/n_chan; 206 | ref_eeg = eeg*newRef; 207 | exp_var = sum((b_loading/sqrt(n_chan)).^2)/sum(vecnorm(ref_eeg).^2); 208 | 209 | if isempty(h) 210 | mywaitbar(reruns, reruns, step, nSteps, strLength); 211 | fprintf('\n'); 212 | else 213 | close(h); 214 | end -------------------------------------------------------------------------------- /LoadSetFromExcelTemplate.m: -------------------------------------------------------------------------------- 1 | function EEG = LoadSetFromExcelTemplate(InFile) 2 | if nargin < 1 3 | [fn,pn] = uigetfile('*.xlsx', 'Pick an Excel file'); 4 | if fn == 0 5 | return 6 | end 7 | InFile = fullfile(pn,fn); 8 | end 9 | 10 | % Read the template maps 11 | 12 | TemplateMapTable = readcell(InFile,"Sheet","Template Maps"); 13 | TemplateMaps = cell2mat(TemplateMapTable(2:end,2:end)); 14 | TemplateNames = TemplateMapTable(2:end,1); 15 | ElectrodeNames = TemplateMapTable(1,2:end); 16 | 17 | for i = 1:numel(ElectrodeNames) 18 | if isnumeric(ElectrodeNames{i}) 19 | ElectrodeNames{i} = sprintf('%i',ElectrodeNames{i}); 20 | end 21 | end 22 | 23 | % Read the electrode positions 24 | opts = spreadsheetImportOptions("NumVariables", 4); 25 | opts.VariableTypes = ["string", "double", "double", "double"]; 26 | opts.VariableNames = ["labels", "X", "Y", "Z"]; 27 | opts.DataRange = 'A2'; 28 | ElectrodeTable = readtable(InFile,opts,"Sheet","Electrode Coordinates"); 29 | 30 | if size(ElectrodeTable,1) ~= numel(ElectrodeNames) 31 | error('Channel number inconsistent'); 32 | end 33 | 34 | if ~all(cellfun(@strcmp,ElectrodeNames',ElectrodeTable.labels)) 35 | error('Channel ordering inconsistent'); 36 | end 37 | 38 | Coords.pos = table2array(ElectrodeTable(:,2:4)); 39 | 40 | if any(isnan(Coords.pos(:))) 41 | warning('Defaulting channel positions'); 42 | ChannelPositions = GetChannelPositionsFromLabels(ElectrodeTable.labels); 43 | res = VAsph2cartStruct(ChannelPositions); 44 | Coords.pos = res.Coords'; 45 | end 46 | 47 | Coords.lbl = ElectrodeNames; 48 | 49 | h = SetXYZCoordinates([],[],[],Coords); 50 | 51 | if isempty(h) 52 | EEG = []; 53 | return; 54 | end 55 | 56 | Coords = get(h,'UserData'); 57 | 58 | close(h); 59 | 60 | x = Coords.x; 61 | y = Coords.y; 62 | z = Coords.z; 63 | 64 | EEG = EmptySet(TemplateMaps,[x y z],ElectrodeNames); 65 | 66 | nTemplates = size(TemplateMaps,1); 67 | 68 | EEG.msinfo.MSMaps(nTemplates) = struct('Maps' ,TemplateMaps, ... 69 | 'ExpVar' , nan, ... 70 | 'ColorMap' , lines(nTemplates), ... 71 | 'SortMode' , 'none',... 72 | 'SortedBy' , '', ... 73 | 'SpatialCorrelations',[], ... 74 | 'Parents' ,[]); 75 | EEG.msinfo.MSMaps(nTemplates).Labels = TemplateNames'; 76 | 77 | % Read the findings 78 | FindingsTable = readtable(InFile,"Sheet","Findings"); 79 | 80 | NamesToSearch = [TemplateNames;{'Class independent effect'}]; 81 | 82 | for i = 1:numel(NamesToSearch) 83 | idx = find(strcmp(FindingsTable.MicrostateClass,NamesToSearch{i})); 84 | if ~isempty(idx) 85 | EEG.msinfo.MSMaps(nTemplates).Findings{i} = table2cell(FindingsTable(idx,2:5)); 86 | else 87 | EEG.msinfo.MSMaps(nTemplates).Findings{i} = []; 88 | end 89 | end 90 | 91 | MetaDataTable = readtable(InFile,"Sheet","MetaData"); 92 | DomainDataTable = readtable(InFile,"Sheet","Research Domain"); 93 | Keywords = readtable(InFile,"Sheet","Keywords"); 94 | 95 | 96 | CitationFields = {'Authors','Title','Journal','Year','Pages','DOI','EMail'}; 97 | MetaDataFields = {'AlgorithmUsed','BackFittingDataSelection','SoftwareUsed','ModelSelection','BandPassFilter','EyeState','nSubjects','MeanTime'}; 98 | DomainFields = {'Cognition and Emotion','Neurological disorders','Psychiatric disorders','Consciousness and its disorders','Development','Drugs and brain stimulation'}; 99 | 100 | for i = 1:numel(CitationFields) 101 | EEG.msinfo.Citation.(CitationFields{i}) = GetValuefromField(MetaDataTable,CitationFields{i}); 102 | end 103 | 104 | for i = 1:numel(MetaDataFields) 105 | EEG.msinfo.MetaData.(MetaDataFields{i}) = GetValuefromField(MetaDataTable,MetaDataFields{i}); 106 | end 107 | 108 | for i = 1:numel(DomainFields) 109 | FieldName = DomainFields{i}; 110 | FieldName(isspace(FieldName)) = []; 111 | EEG.msinfo.Citation.(FieldName) = GetBooleanfromField(DomainDataTable,DomainFields{i}); 112 | end 113 | 114 | EEG.msinfo.Citation.FreeKeyWords = ''; 115 | for i = 1:numel(Keywords) 116 | if i == 1 117 | EEG.msinfo.Citation.FreeKeyWords = [EEG.msinfo.Citation.FreeKeyWords, Keywords.Keywords{i,1}]; 118 | else 119 | EEG.msinfo.Citation.FreeKeyWords = [EEG.msinfo.Citation.FreeKeyWords, ', ' Keywords.Keywords{i,1}]; 120 | end 121 | end 122 | 123 | 124 | EEG.msinfo.MetaData.DataSelection = GetValuefromField(MetaDataTable,'ClusterDataSelection'); 125 | EEG.msinfo.MetaData.nSubjects = str2double(EEG.msinfo.MetaData.nSubjects); 126 | EEG.msinfo.MetaData.MeanTime = str2double(EEG.msinfo.MetaData.MeanTime); 127 | EEG.msinfo.ClustPar.MinClasses = EEG.pnts; 128 | EEG.msinfo.ClustPar.MaxClasses = EEG.pnts; 129 | end 130 | 131 | function value = GetBooleanfromField(Data,FieldName) 132 | idx = find(strcmpi(Data.Domain,FieldName)); 133 | if isempty(idx) 134 | value = ''; 135 | else 136 | if strcmpi(Data.Applicable{idx},'Yes') 137 | value = true; 138 | elseif strcmpi(Data.Applicable{idx},'No') 139 | value = false; 140 | else 141 | value = nan; 142 | end 143 | end 144 | end 145 | 146 | 147 | 148 | function value = GetValuefromField(Data,FieldName) 149 | idx = find(strcmpi(Data.Field,FieldName)); 150 | if isempty(idx) 151 | value = ''; 152 | else 153 | value = Data.Value {idx}; 154 | end 155 | end 156 | 157 | 158 | 159 | 160 | function EEG = EmptySet(data, xyz,Labels) 161 | EEG.setname = ''; 162 | EEG.filename = ''; 163 | EEG.filepath = ''; 164 | EEG.subject = ''; 165 | EEG.group = ''; 166 | EEG.condition = ''; 167 | EEG.session = []; 168 | EEG.comments = ''; 169 | EEG.nbchan = size(data,2); 170 | EEG.trials = 1; 171 | EEG.pnts = size(data,1); 172 | EEG.srate = 1; 173 | EEG.xmin = 0; 174 | EEG.xmax = EEG.pnts -1; 175 | EEG.times = EEG.xmin : EEG.xmax; 176 | EEG.data = data'; 177 | EEG.icaact = []; 178 | EEG.icawinv = []; 179 | EEG.icasphere = []; 180 | EEG.icaweights = []; 181 | EEG.icachansind = []; 182 | for i = 1:size(xyz,1) 183 | x = -xyz(i,1); 184 | y = xyz(i,2); 185 | z = xyz(i,3); 186 | EEG.chanlocs(i).Y = x; 187 | EEG.chanlocs(i).X = y; 188 | EEG.chanlocs(i).Z = z; 189 | EEG.chanlocs(i).labels = Labels{i}; 190 | [th,phi,radius] = cart2sph(x,y,z); 191 | EEG.chanlocs(i).sph_theta = th/pi*180; 192 | EEG.chanlocs(i).sph_phi = phi/pi*180; 193 | EEG.chanlocs(i).sph_radius = radius; 194 | EEG.chanlocs(i).theta = -EEG.chanlocs(i).sph_theta; 195 | EEG.chanlocs(i).radius = 0.5 - EEG.chanlocs(i).sph_phi/180; 196 | EEG.chanlocs(i).sph_theta_besa = 0; 197 | EEG.chanlocs(i).sph_phi_besa = 0; 198 | EEG.chanlocs(i).type = []; 199 | end 200 | 201 | EEG.urchanlocs = []; 202 | EEG.chaninfo = []; 203 | EEG.ref = []; 204 | EEG.event = []; 205 | EEG.urevent = []; 206 | EEG.eventdescription = {}; 207 | EEG.epoch = []; 208 | EEG.epochdescription = {}; 209 | EEG.reject = []; 210 | EEG.stats = []; 211 | EEG.specdata = []; 212 | EEG.specicaact = []; 213 | EEG.splinefile = ''; 214 | EEG.icasplinefile = ''; 215 | EEG.dipfit = []; 216 | EEG.history = ''; 217 | EEG.saved = 'no'; 218 | EEG.etc = []; 219 | end 220 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Microstate Template Editor and Explorer 2 | 3 | ## Installation 4 | 5 | 1) Make sure you have installed Matlab 2022b or above. 6 | 2) Download the two files MSTemplateEditor.mlappinstall and MSTemplateExplorer.mlappinstall 7 | 3) In MATLAB, select the APPS tab, hit the Install App button, and select the two downloaded files 8 | 4) The Apps should now be available in the Apps toolbar of MATLAB 9 | 10 | ## Using the Microstate Template Editor 11 | 12 | The Microstate Template Editor lets you import new sets of microstate template maps, check if the import completed correctly, and add findings associated with particular microstate class. It also collects data about the publication where these findings came out, and some extra-information like the number of subject and other parameters of the data and analysis. 13 | 14 | ### Loading templates: 15 | - If you have conducted the microstate analysis using our EEGLAB toolbox (available here: https://github.com/ThomasKoenigBern/microstates), you can directly import your grandmean(s) into the editor by using the “” 16 | button. Note that you can only edit the template with a single number of classes. If your data contains more than one set, you will be asked to make a choice during the import. 17 | - For data created in CarTool, you should be able to use the “” button. Note that you also need the corresponding xyz file. 18 | - For other data, you can read in the maps as map x electrode text file, and provide a list of electrode labels of the 10-20 system for the elecrode coordinates use the “” button. 19 | - Other import options may be implemented upon reasonable request. 20 | 21 | Once you have been able to import your templates, make sure they look as you expect it. 22 | 23 | ### Editing templates 24 | When editing your templates, you should do all of the following 25 | 1) Adjust, if necessary, the order of the templates to correspond to the order used in the publication, 26 | 2) Label the template maps according to the publication 27 | 3) Add, Edit, or Remove empirical findings. Please make sure you present them in a maximally concise and precise form. 28 | 4) Add all the information about the publication 29 | 5) Add the meta-information, such as number of subjects, filter-settings, software used, etc. 30 | 31 | ### Saving templates 32 | Once our done editing, you can save the data using the Save “” and SaveAs “” buttons. 33 | 34 | ### Submitting your edited template to the database 35 | Ideally, you send the resulting data to thomas.koenig(at)unibe.ch who will check it and add it to the database. Note, however, that we only accept template sets that have been accepted for publication. Please provide overall grandmean templates unless there is statistically supported evidence for topographic differences between relevant mean template sets. 36 | 37 | ## Using the Microstate Template Explorer 38 | The Microstate Template Explorer only works with template data that has been processed using the Microstate Template Editor. A database of published templates is available for download from the GitHub repository. 39 | Typically, you will want to go through the following steps. (For the rationales of these steps, see the the paper in the special issue of Brain Topography on microstates, as also found in this repository.) 40 | 41 | ### Computation and visualization of the Similarity Matrix 42 | - To compute the similarity matrix, all you need to do is to load all the templates that you want to include using the Template/Load Template Menu or the “” button. 43 | - Once the computation is finished, you will see the similarity matrix of all included maps. You can read out the similarities by hovering over the pixels of the matrix, and you can display the pair of maps that is associated with a given voxel by klicking on the voxel. 44 | - You can select subset of studies for display and futher analysis (see below) using the list-box in the lower right corner and the button below. 45 | - You can chanege the color scaling using the “” and “” buttons. 46 | - You can filter the studies depending on the research domain using the “” button, and remove the filter using the “” button. 47 | 48 | ### Exporation of the Multidimensional Scaling (MDS) 49 | Once the Similarity Matrix has been computed, you can switch to the MDS tab. Here, you can do the following: 50 | - You can identify and select particular maps of particular studies using the tree-control on the left, and you can visually explore the neighborhood of interesting maps using the mouse pointer. Double-clicking on a tree element or clicking on a point in the MDS display will select the associated map. This means that the map is shown on the right side of the display, and eventually associated findings are collected in the Findings Tab. You can select as many maps as you want. 51 | - You can use the Findings / Next best guess menu or the “” button to display the next closest match to the first template map that you selected, and obtain its associated findings. This is particularly useful when the first template map you selected is from a new study, and you want to identify the relevant literature based on spatially similar maps (added 30.6.2023). 52 | - You can switch between a 2D and a 3D visualization using the View menu or using the “” button. 53 | - You can clear all selected maps and findings using the “” button or using the Findings/Clear menu. 54 | - If you have computed Meta-Microstate maps (see below), they will also appear in the tree-control. You can show the assigment to these metamaps by selecting the corresponding tree-control element. 55 | 56 | ### Exploration of selected findings 57 | Once you have selected a set of maps or meta-maps, the associated findings, and the corresponding publications appear in the Findings tab. You have the option to export this data to an Excel spreadsheet from the Findings menu, and you can have a look at the details of the study by clicking on the study ID or the title of the study (opens the study in the template editor) or by clicking on the DOI (opens the corresponding paper). 58 | 59 | ### Computation of Meta-Microstate Maps 60 | - The MSTemplateExplorer allows you to compute a k-means clustering across all included template maps using the Meta-Maps/Compute Meta-Maps menu item or using the “” button. You will be asked for a file with the electrode positions to be used to compute these metamaps. The format of this file is given below. Once the computation is complete, the maps will be displayed. 61 | - You can reorder and polarity-flip the obtained meta-microstate maps using the “” button or the Reorder Meta-Maps/Meta-Maps menu item. You then need to give the new order of maps for each solution. For polarity reversals, add a minus to the position. 62 | - You can export the obtained Meta-Maps to be directly used in our EEGLAB microstate toolbox. 63 | ### Saving the configuration 64 | Once you're done, you can save the entire data structure using the File/Save Configuration Menu or the “” button. To load a previously saved data structure, use the File/Load Configuration Menu or the “” button. The resulting files are MATLAB readable, but yet to be documented. 65 | 66 | ## Supplementary information 67 | ### Structure of the electrode coordinate file 68 | (First line gives the number of channels, remaining lines are xyz coordinates and labels) 69 | 70 | 71 71 | 0.9230 0.0000 -0.3824 Nz 72 | -0.9230 0.0000 -0.3823 Iz 73 | 0.0001 0.7066 0.7066 C3 74 | .... 75 | 76 | ## History & Changelog 77 | - 01.06.2023: Initial commit. 78 | - 30.06.2023: Added the possibility to search for the next best guesses based on spatial similarity. 79 | - 25.04.2024: Possibility to filter the studies and work only on subsets of the entire database. 80 | -------------------------------------------------------------------------------- /SetXYZCoordinates.m: -------------------------------------------------------------------------------- 1 | function varargout = SetXYZCoordinates(varargin) 2 | % SETXYZCOORDINATES M-file for SetXYZCoordinates.fig 3 | % SETXYZCOORDINATES, by itself, creates a new SETXYZCOORDINATES or raises the existing 4 | % singleton*. 5 | % 6 | % H = SETXYZCOORDINATES returns the handle to a new SETXYZCOORDINATES or the handle to 7 | % the existing singleton*. 8 | % 9 | % SETXYZCOORDINATES('CALLBACK',hObject,eventData,handles,...) calls the local 10 | % function named CALLBACK in SETXYZCOORDINATES.M with the given input arguments. 11 | % 12 | % SETXYZCOORDINATES('Property','Value',...) creates a new SETXYZCOORDINATES or raises the 13 | % existing singleton*. Starting from the left, property value pairs are 14 | % applied to the GUI before SetXYZCoordinates_OpeningFcn gets called. An 15 | % unrecognized property name or invalid value makes property application 16 | % stop. All inputs are passed to SetXYZCoordinates_OpeningFcn via varargin. 17 | % 18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 19 | % instance to run (singleton)". 20 | % 21 | % See also: GUIDE, GUIDATA, GUIHANDLES 22 | 23 | % Edit the above text to modify the response to help SetXYZCoordinates 24 | 25 | % Last Modified by GUIDE v2.5 27-Jun-2013 17:26:49 26 | 27 | % Begin initialization code - DO NOT EDIT 28 | gui_Singleton = 1; 29 | gui_State = struct('gui_Name', mfilename, ... 30 | 'gui_Singleton', gui_Singleton, ... 31 | 'gui_OpeningFcn', @SetXYZCoordinates_OpeningFcn, ... 32 | 'gui_OutputFcn', @SetXYZCoordinates_OutputFcn, ... 33 | 'gui_LayoutFcn', [] , ... 34 | 'gui_Callback', []); 35 | if nargin && ischar(varargin{1}) 36 | gui_State.gui_Callback = str2func(varargin{1}); 37 | end 38 | 39 | if nargout 40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 41 | else 42 | gui_mainfcn(gui_State, varargin{:}); 43 | end 44 | % End initialization code - DO NOT EDIT 45 | 46 | 47 | % --- Executes just before SetXYZCoordinates is made visible. 48 | function SetXYZCoordinates_OpeningFcn(hObject, eventdata, handles, varargin) 49 | % This function has no output args, see OutputFcn. 50 | % hObject handle to figure 51 | % eventdata reserved - to be defined in a future version of MATLAB 52 | % handles structure with handles and user data (see GUIDATA) 53 | % varargin command line arguments to SetXYZCoordinates (see VARARGIN) 54 | 55 | % Choose default command line output for SetXYZCoordinates 56 | 57 | handles.output = hObject; 58 | set(handles.TopView,'UserData',varargin{4}); 59 | guidata(hObject, handles); 60 | set(handles.output,'UserData',varargin{4}); 61 | 62 | set(handles.PopupOrientation,'Value',1); 63 | 64 | set(handles.rbLeftNeg,'parent',handles.ButtonGroupLR,'UserData',1); 65 | set(handles.rbLeftPos,'parent',handles.ButtonGroupLR,'UserData',-1); 66 | set(handles.ButtonGroupLR,'SelectionChangeFcn',{@ButtonGroup_SelectionChanged,handles},'UserData',1); 67 | 68 | set(handles.rbAntNeg,'parent',handles.ButtonGroupAP,'UserData',1); 69 | set(handles.rbAntPos,'parent',handles.ButtonGroupAP,'UserData',-1); 70 | set(handles.ButtonGroupAP,'SelectionChangeFcn',{@ButtonGroup_SelectionChanged,handles},'UserData',1); 71 | 72 | set(handles.rbSupNeg,'parent',handles.ButtonGroupSI,'UserData',1); 73 | set(handles.rbSupPos,'parent',handles.ButtonGroupSI,'UserData',-1); 74 | set(handles.ButtonGroupSI,'SelectionChangeFcn',{@ButtonGroup_SelectionChanged,handles},'UserData',1); 75 | 76 | DisplayCoordinates(handles); 77 | % Update handles structure 78 | 79 | 80 | % UIWAIT makes SetXYZCoordinates wait for user response (see UIRESUME) 81 | uiwait(handles.figure1); 82 | 83 | 84 | function DisplayCoordinates(handles) 85 | 86 | Coords = get(handles.output,'UserData'); 87 | 88 | xdir = get(handles.ButtonGroupLR,'UserData'); 89 | ydir = get(handles.ButtonGroupAP,'UserData'); 90 | zdir = get(handles.ButtonGroupSI,'UserData'); 91 | 92 | switch(get(handles.PopupOrientation,'Value')); 93 | case 1 %LR - AP - SI 94 | Coords.x = Coords.pos(:,1) * xdir; 95 | Coords.y = Coords.pos(:,2) * ydir; 96 | Coords.z = Coords.pos(:,3) * zdir; 97 | case 2 % LR - SI - AP 98 | Coords.x = Coords.pos(:,1) * xdir; 99 | Coords.z = Coords.pos(:,2) * zdir; 100 | Coords.y = Coords.pos(:,3) * ydir; 101 | 102 | case 3 % AP - LR - SI 103 | Coords.y = Coords.pos(:,1) * ydir; 104 | Coords.x = Coords.pos(:,2) * xdir; 105 | Coords.z = Coords.pos(:,3) * zdir; 106 | 107 | case 4 % AP - SI - LR 108 | Coords.y = Coords.pos(:,1) * ydir; 109 | Coords.z = Coords.pos(:,2) * zdir; 110 | Coords.x = Coords.pos(:,3) * xdir; 111 | 112 | case 5 % SI - AP - LR 113 | Coords.z = Coords.pos(:,1) * zdir; 114 | Coords.y = Coords.pos(:,2) * ydir; 115 | Coords.x = Coords.pos(:,3) * xdir; 116 | 117 | case 6 % SI - LR - AP 118 | Coords.z = Coords.pos(:,1) * zdir; 119 | Coords.x = Coords.pos(:,2) * xdir; 120 | Coords.y = Coords.pos(:,3) * ydir; 121 | end 122 | 123 | mx = max(abs(Coords.pos(:)))* 1.1; 124 | 125 | set(handles.output,'UserData',Coords); 126 | 127 | axes(handles.TopView); 128 | 129 | plot(Coords.x,Coords.y,'.w'); 130 | text(Coords.x,Coords.y,Coords.lbl,'HorizontalAlignment','center','BackgroundColor','none','FontSize',8); 131 | axis([-mx mx -mx mx]); 132 | title('Top View'); 133 | xlabel('left <-> right'); 134 | ylabel('posterior <-> anterior'); 135 | 136 | idx = Coords.x >= 0; 137 | 138 | axes(handles.LeftView); 139 | plot(Coords.y(idx),Coords.z(idx),'.w'); 140 | text(Coords.y(idx),Coords.z(idx),Coords.lbl(idx),'HorizontalAlignment','center','BackgroundColor','none','FontSize',8); 141 | axis([-mx mx -mx mx]); 142 | title('Right View'); 143 | xlabel('posterior <-> anterior'); 144 | ylabel('inferior <-> superior'); 145 | 146 | % --- Outputs from this function are returned to the command line. 147 | function varargout = SetXYZCoordinates_OutputFcn(hObject, eventdata, handles) 148 | % varargout cell array for returning output args (see VARARGOUT); 149 | % hObject handle to figure 150 | % eventdata reserved - to be defined in a future version of MATLAB 151 | % handles structure with handles and user data (see GUIDATA) 152 | 153 | % Get default command line output from handles structure 154 | 155 | if isempty(handles) 156 | varargout{1} = []; 157 | else 158 | varargout{1} = handles.output; 159 | end 160 | 161 | 162 | % --- Executes on selection change in PopupOrientation. 163 | function PopupOrientation_Callback(hObject, eventdata, handles) 164 | % hObject handle to PopupOrientation (see GCBO) 165 | % eventdata reserved - to be defined in a future version of MATLAB 166 | % handles structure with handles and user data (see GUIDATA) 167 | 168 | % Hints: contents = cellstr(get(hObject,'String')) returns PopupOrientation contents as cell array 169 | % contents{get(hObject,'Value')} returns selected item from PopupOrientation 170 | DisplayCoordinates(handles); 171 | 172 | 173 | % --- Executes during object creation, after setting all properties. 174 | function PopupOrientation_CreateFcn(hObject, eventdata, handles) 175 | % hObject handle to PopupOrientation (see GCBO) 176 | % eventdata reserved - to be defined in a future version of MATLAB 177 | % handles empty - handles not created until after all CreateFcns called 178 | 179 | % Hint: listbox controls usually have a white background on Windows. 180 | % See ISPC and COMPUTER. 181 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 182 | set(hObject,'BackgroundColor','white'); 183 | end 184 | 185 | 186 | % -------------------------------------------------------------------- 187 | function ButtonGroup_SelectionChanged(hObject, eventdata, handles) 188 | % hObject handle to ButtonGroupLR (see GCBO) 189 | % eventdata reserved - to be defined in a future version of MATLAB 190 | % handles structure with handles and user data (see GUIDATA) 191 | 192 | set(hObject,'UserData',get(eventdata.NewValue,'UserData')); 193 | DisplayCoordinates(handles); 194 | 195 | 196 | % --- Executes on mouse press over figure background. 197 | function figure1_ButtonDownFcn(hObject, eventdata, handles) 198 | % hObject handle to figure1 (see GCBO) 199 | % eventdata reserved - to be defined in a future version of MATLAB 200 | % handles structure with handles and user data (see GUIDATA) 201 | 202 | 203 | % --- Executes on button press in pushbuttonOK. 204 | function pushbuttonOK_Callback(hObject, eventdata, handles) 205 | % hObject handle to pushbuttonOK (see GCBO) 206 | % eventdata reserved - to be defined in a future version of MATLAB 207 | % handles structure with handles and user data (see GUIDATA) 208 | 209 | uiresume(handles.figure1); 210 | -------------------------------------------------------------------------------- /dspCMap.m: -------------------------------------------------------------------------------- 1 | function [c,imap,xm,ym] = dspCMap(map,ChanPos,varargin) 2 | % dspCMaocp - Display topographic scalp maps 3 | % ---------------------------------------- 4 | % Copyright 2009-2011 Thomas Koenig 5 | % distributed under the terms of the GNU AFFERO General Public License 6 | % 7 | % Usage: dspCMap(map,ChanPos,CStep) 8 | % 9 | % map is the 1xN voltage map to display, where N is the number of electrode 10 | % 11 | % ChanPos contains the electrode positions, either as Nx3 xyz coordinates, 12 | % or as structure withRadius, Theta and Phi (Brainvision convention), or as 13 | % labels of the 10-10 system 14 | % 15 | % CStep is the size of a single step in the contourlines, a default is used 16 | % if this is not set 17 | % 18 | % There are a series of options that can be set using parameter/value 19 | % pairs: 20 | %dir 21 | % 'Colormap': - 'bw' (Black & White) 22 | % - 'ww' (White & White; only contourlines) 23 | % - 'br' (Blue & Red; negative blue, positive red, default 24 | % 25 | % 'Resolution' controls the resolution of the interpolation 26 | % 'Label' shows the electrode positions and labels them 27 | % 'Gradient' N shows vectors with gradients at every N-th grid point 28 | % 'GradientScale' controls the length of these vectors 29 | % 'NoScale' whether or not a scale is being shown 30 | % 'LevelList' sets the levellist 31 | % 'Laplacian' shows the laplacian instead of the data 32 | % 'Plot' Plots additional x_points 33 | % 'Linewidth' Sets linewidth 34 | % 'NoExtrapolation' Prevents maps to be etrapolated) 35 | 36 | 37 | if iscell(ChanPos) 38 | ChanPos = GetChannelPositionsFromLabels(ChanPos); 39 | end 40 | 41 | if isstruct(ChanPos) 42 | if isfield(ChanPos,'Theta') || isfield(ChanPos,'CoordsTheta') 43 | [x,y,z] = VAsph2cart(ChanPos); 44 | else 45 | x = -cell2mat({ChanPos.Y}); 46 | y = cell2mat({ChanPos.X}); 47 | z = cell2mat({ChanPos.Z}); 48 | end 49 | 50 | else 51 | if size(ChanPos,1) == 3 52 | ChanPos = ChanPos'; 53 | end 54 | x = -ChanPos(:,2)'; 55 | y = ChanPos(:,1)'; 56 | z = ChanPos(:,3)'; 57 | end 58 | 59 | r = sqrt(x.*x + y.*y + z.*z); 60 | 61 | x = x ./ r; 62 | y = y ./ r; 63 | z = z ./ r; 64 | 65 | 66 | 67 | if numel(varargin) == 1 68 | varargin = varargin{1}; 69 | end 70 | 71 | if (nargin < 2) 72 | error('Not enough input arguments'); 73 | end 74 | 75 | if vararginmatch(varargin,'Step') 76 | CStep = varargin{vararginmatch(varargin,'Step')+1}; 77 | else 78 | CStep = max(abs(map)) / 4; 79 | end 80 | 81 | if vararginmatch(varargin,'Axis') 82 | PlotAxis = varargin{vararginmatch(varargin,'Axis')+1}; 83 | else 84 | PlotAxis = gca; 85 | end 86 | 87 | hold(PlotAxis,'off'); 88 | cla(PlotAxis); 89 | 90 | 91 | 92 | if vararginmatch(varargin,'NoScale') 93 | ShowScale = 0; 94 | else 95 | ShowScale = 1; 96 | end 97 | 98 | if vararginmatch(varargin,'ElectrodeClickCallBack') 99 | ElectrodeClickCallback = varargin{vararginmatch(varargin,'ElectrodeClickCallBack')+1}; 100 | else 101 | ElectrodeClickCallback = []; 102 | end 103 | 104 | 105 | if vararginmatch(varargin,'ShowNose') 106 | NoseRadius = varargin{vararginmatch(varargin,'ShowNose')+1}; 107 | else 108 | NoseRadius = 0; 109 | end 110 | 111 | 112 | if vararginmatch(varargin,'NoExtrapolation') 113 | NoExPol = 1; 114 | else 115 | NoExPol = 0; 116 | end 117 | 118 | 119 | if vararginmatch(varargin,'Laplacian') 120 | ShowLap = 1; 121 | LapFact = varargin{vararginmatch(varargin,'Laplacian')+1}; 122 | else 123 | ShowLap = 0; 124 | end 125 | 126 | 127 | if vararginmatch(varargin,'Interpolation') 128 | itype = varargin{vararginmatch(varargin,'Interpolation')+1}; 129 | else 130 | itype = 'v4'; 131 | end 132 | 133 | 134 | 135 | if vararginmatch(varargin,'Linewidth') 136 | MapLineWidth = varargin{vararginmatch(varargin,'Linewidth')+1}; 137 | else 138 | MapLineWidth = 1; 139 | end 140 | 141 | 142 | if vararginmatch(varargin,'Colormap') 143 | cmap = varargin{vararginmatch(varargin,'Colormap')+1}; 144 | else 145 | cmap = 'br'; 146 | end 147 | 148 | if vararginmatch(varargin,'Resolution') 149 | res = varargin{vararginmatch(varargin,'Resolution')+1}; 150 | else 151 | res = 1; 152 | end 153 | 154 | if vararginmatch(varargin,'LabelSize') 155 | LabelSize = varargin{vararginmatch(varargin,'LabelSize')+1}; 156 | else 157 | LabelSize = 8; 158 | end 159 | 160 | if vararginmatch(varargin,'LevelList') 161 | ll = varargin{vararginmatch(varargin,'LevelList')+1}; 162 | else 163 | ll = []; 164 | end 165 | 166 | Theta = acos(z) / pi * 180; 167 | r = sqrt(x.*x + y.* y); 168 | r(r == 0) = 1; 169 | 170 | pxG = x./r.*Theta; 171 | pyG = y./r.*Theta; 172 | 173 | 174 | % No extrapolation 175 | if NoExPol == 1 176 | xmx = max(abs(pxG)); 177 | ymx = max(abs(pyG)); 178 | 179 | else 180 | dist = sqrt(pxG.*pxG + pyG.*pyG); 181 | r_max = max(dist); 182 | xmx = r_max; 183 | ymx = r_max; 184 | end 185 | 186 | xa = -xmx:res:xmx; 187 | ya = -ymx:res:ymx; 188 | 189 | [xm,ym] = meshgrid(xa,ya); 190 | if ShowLap == 0 191 | imap = griddata(pxG,pyG,map,xm,ym,itype); 192 | else 193 | EiCOS = elec_cosines([x',y',z'],[x',y',z']); 194 | w = real(acos(EiCOS))/pi *180+eye(numel(x)); 195 | w = w.^LapFact; 196 | 197 | w = 1./w - eye(numel(x)); 198 | 199 | lp = w ./ repmat(sum(w,1),numel(x),1); 200 | lp = -lp + eye(numel(x)); %This laplacian does not work at all, not sharp enough 201 | imap = griddata(pxG,pyG,map * lp,xm,ym,itype); 202 | end 203 | 204 | if NoExPol == 1 205 | vmap = griddata(pxG,pyG,map,xm,ym,'linear'); 206 | idx = isnan(vmap); 207 | else 208 | dist = sqrt(xm.*xm + ym.*ym); 209 | idx = dist > r_max; 210 | end 211 | 212 | imap(idx) = NaN; 213 | if vararginmatch(varargin,'Gradient') 214 | Delta = varargin{vararginmatch(varargin,'Gradient')+1}; 215 | 216 | sx = size(imap,1); 217 | sy = size(imap,2); 218 | Grad1 = imap(1:sx-Delta,1:sy-Delta ) - imap((Delta+1):sx,(Delta+1):sy); 219 | Grad2 = imap(1:sx-Delta,(Delta+1):sy) - imap((Delta+1):sx,1:sy-Delta ); 220 | 221 | if vararginmatch(varargin,'GradientScale') 222 | gScale = varargin{vararginmatch(varargin,'GradientScale')+1}; 223 | else 224 | g = sqrt(Grad1.*Grad1 + Grad2 .* Grad2); 225 | gScale = 1/max(g(:)); 226 | end 227 | if (gScale == 0) 228 | gScale = gScale * Delta * res; 229 | ypgrad = 0; 230 | for i = 1:Delta:(sx-Delta) 231 | ypgrad = ypgrad+1; 232 | yposgrad(ypgrad) = (ya(i)+Delta/2*res); 233 | 234 | xpgrad = 0; 235 | for j = 1:Delta:(sy-Delta) 236 | xpgrad = xpgrad+1; 237 | xposgrad(xpgrad) = (xa(j)+Delta/2*res); 238 | 239 | if ~isnan(Grad1(i,j)) && ~isnan(Grad2(i,j)) 240 | GradMap(ypgrad,xpgrad) = sqrt((Grad1(i,j)- Grad2(i,j)).^2 + (Grad1(i,j)+Grad2(i,j)).^2); 241 | else 242 | GradMap(ypgrad,xpgrad) = 0; 243 | end 244 | end 245 | end 246 | imap = griddata(xposgrad,yposgrad,GradMap,xm,ym,'v4'); 247 | imap(idx) = NaN; 248 | end 249 | end 250 | 251 | 252 | 253 | if(isempty(CStep)) 254 | if((ShowLap == 1) || (gScale == 0)) 255 | CStep = max(abs(imap(:))) / 8; 256 | else 257 | CStep = max(abs(map)) / 8; 258 | end 259 | end 260 | 261 | 262 | if isempty(ll) 263 | % ContourLevel = (nNegLevels:nPosLevels) * CStep; 264 | ContourLevel = (-8*CStep):CStep:(8*CStep); 265 | ContourLevel = [-inf ContourLevel inf]; 266 | else 267 | ContourLevel = [-inf ll inf]; 268 | end 269 | 270 | %ContourLevel = (nNegLevels:(nPosLevels-1)) * CStep; 271 | [c,h] = contourf(PlotAxis,xm,ym,imap, ContourLevel); 272 | 273 | set(h,'LineWidth',MapLineWidth,'LineColor',[0.05 0.05 0.05],'LevelListMode','manual','LevelStepMode','manual'); 274 | hold(PlotAxis,'on'); 275 | hc = get(h,'Children'); 276 | 277 | if isempty(ll) 278 | ll = get(h,'LevelList'); 279 | end 280 | LabBkG = 1; 281 | 282 | 283 | switch cmap 284 | case 'bw' 285 | 286 | disp('The black / white colormap needs some reprogramming'); 287 | for i = 1:numel(ll) 288 | if (ll(i) < 0) 289 | cm(i,:) = [0 0 0]; 290 | else 291 | cm(i,:) = [1 1 1]; 292 | end 293 | end 294 | 295 | colormap(PlotAxis,cm); 296 | contour(PlotAxis,xm,ym,imap,ContourLevel(ContourLevel < 0),'LineColor',[0.99 0.99 0.99],'LineWidth',2); 297 | 298 | case 'ww' 299 | disp('The white colormap needs some reprogramming'); 300 | colormap(PlotAxis,ones(numel(ll),3)); 301 | LabBkG = 0.9; 302 | 303 | contour(PlotAxis,xm,ym,imap,[0 0],'LineWidth',MapLineWidth*2,'LineColor',[0 0 0]); 304 | 305 | case 'hot' 306 | disp('The hot colormap needs some reprogramming'); 307 | cntpos = 0; 308 | for i = 1:numel(ll) 309 | if (ll(i)) > 0 310 | cntpos = cntpos+1; 311 | end 312 | end 313 | 314 | negpos = numel(ll) - cntpos; 315 | size(hot(cntpos)) 316 | cm = [zeros(negpos,3);hot(cntpos)]; 317 | 318 | colormap(PlotAxis,cm); 319 | 320 | case 'br' 321 | 322 | caxis(PlotAxis,[-8*CStep 8*CStep]); 323 | colormap(PlotAxis,bluered(16)); 324 | LabBkG = 1; 325 | case 'rr' 326 | for i = 1:numel(ll) 327 | l = ll(i) / CStep / 8; 328 | l = max([l -1]); 329 | l = min([l 0.875]); 330 | if (l < 0) 331 | cm(i,:) = [1 0.875+l 0.875+l]; 332 | else 333 | cm(i,:) = [1 0.875-l 0.875-l]; 334 | end 335 | end 336 | colormap(PlotAxis,cm); 337 | 338 | % LabBkG = 1; 339 | % if (ll(1) < 0) 340 | % contour(xm,ym,imap,[0 0],'LineWidth',MapLineWidth*2,'LineColor',[0 0 0]); 341 | % end 342 | otherwise 343 | error('Colormap not defined'); 344 | end 345 | 346 | EndContourLevel = ContourLevel(numel(ll)); 347 | 348 | if EndContourLevel <= ContourLevel(1) 349 | EndContourLevel = ContourLevel(1) + 1; 350 | % ll = [ll EndContourLevel]; 351 | end 352 | 353 | 354 | 355 | 356 | if vararginmatch(varargin,'Gradient') 357 | if (gScale > 0) 358 | for i = 1:Delta:(sx-Delta) 359 | for j = 1:Delta:(sy-Delta) 360 | if ~isnan(Grad1(i,j)) && ~isnan(Grad2(i,j)) 361 | pos = [(xa(j)+Delta/2*res) (ya(i)+Delta/2*res)]; 362 | Grad = [Grad1(i,j)- Grad2(i,j) Grad1(i,j)+Grad2(i,j) ]; 363 | Arrow(PlotAxis,pos,-Grad*gScale); 364 | end 365 | end 366 | end 367 | end 368 | end 369 | 370 | %if verLessThan('matlab','8.0') 371 | % set(gca,'CLimMode','Manual','CLim',[ContourLevel(1) EndContourLevel]); 372 | %end 373 | 374 | % colorbar 375 | 376 | if vararginmatch(varargin,'Label') 377 | Label = varargin{vararginmatch(varargin,'Label')+1}; 378 | if numel(Label) == 1 379 | Label = []; 380 | end 381 | if vararginmatch(varargin,'LabelIndex') 382 | LabelIndex = varargin{vararginmatch(varargin,'LabelIndex')+1}; 383 | else 384 | LabelIndex = 1:numel(x); 385 | end 386 | 387 | if ~iscell(Label) && ~isempty(Label) 388 | Label = cellstr(Label); 389 | end 390 | Theta = acos(z) / pi * 180; 391 | r = sqrt(x.*x + y.* y); 392 | r(r == 0) = 1; 393 | 394 | pxe = x./r.*Theta; 395 | pye = y./r.*Theta; 396 | 397 | 398 | if vararginmatch(varargin,'LabelGrey') 399 | LabelGrey = varargin{vararginmatch(varargin,'LabelGrey')+1}; 400 | else 401 | LabelGrey = ones(numel(LabelIndex),1); 402 | end 403 | 404 | 405 | 406 | for i = 1:numel(LabelIndex) 407 | 408 | if ~isempty(Label) 409 | handles = PlotElectrode(pxe(LabelIndex(i)),pye(LabelIndex(i)),LabelSize,Label{i},LabelGrey(i),EndContourLevel +100,PlotAxis); 410 | else 411 | handles = PlotElectrode(pxe(LabelIndex(i)),pye(LabelIndex(i)),LabelSize,[],LabelGrey(i),EndContourLevel +100,PlotAxis); 412 | end 413 | if ~isempty(ElectrodeClickCallback) 414 | for j = 1:numel(handles) 415 | handles(j).ButtonDownFcn = {ElectrodeClickCallback,i,PlotAxis}; 416 | end 417 | end 418 | end 419 | end 420 | 421 | if vararginmatch(varargin,'Extrema') 422 | 423 | [~,maxIdx] = max(map,[],2); 424 | [~,minIdx] = min(map,[],2); 425 | plot(PlotAxis,[pxG(maxIdx);pxG(minIdx)],[pyG(maxIdx);pyG(minIdx)],'*k'); 426 | end 427 | 428 | 429 | if vararginmatch(varargin,'Centroids') 430 | 431 | posIdx = map > 0; 432 | negIdx = map < 0; 433 | 434 | cpx = sum(map(posIdx).*pxG(posIdx))./ sum(map(posIdx)); 435 | cpy = sum(map(posIdx).*pyG(posIdx))./ sum(map(posIdx)); 436 | 437 | cnx = sum(map(negIdx).*pxG(negIdx))./ sum(map(negIdx)); 438 | cny = sum(map(negIdx).*pyG(negIdx))./ sum(map(negIdx)); 439 | 440 | plot(PlotAxis,[cpx cnx],[cpy cny],'*k'); 441 | end 442 | 443 | if vararginmatch(varargin,'GravityCenter') 444 | cpx = sum(abs(map).*pxG)./ sum(abs(map)); 445 | cpy = sum(abs(map).*pyG)./ sum(abs(map)); 446 | 447 | plot(PlotAxis,cpx,cpy,'*k'); 448 | end 449 | 450 | if NoExPol == 0 451 | axh = PlotAxis; 452 | oldUnits = axh.Units; 453 | axh.Units = 'pixels'; 454 | nwidth = axh.Position(3); 455 | axh.Units = oldUnits; 456 | LineWidth = nwidth / res / 200; 457 | ang=0:0.01:(2*pi + 0.01); 458 | xp=r_max*cos(ang); 459 | yp=r_max*sin(ang); 460 | plot(PlotAxis,xp*0.980,yp*0.980,'-k','LineWidth',LineWidth); 461 | end 462 | 463 | if NoseRadius > 0 464 | w = 1:361; 465 | w = w / 180 * pi; 466 | xc = sin(w) .* NoseRadius; 467 | yc = cos(w) .* NoseRadius + r_max; 468 | patch(PlotAxis,xc,yc,ones(size(xc))-1000,[1 1 1],'LineWidth',2); 469 | 470 | Ang = [18 20 22 24 26 28] / 180 * pi; 471 | 472 | for i = 1:numel(Ang) 473 | x = sin(Ang(i)) * [1.05 1.1] * r_max; 474 | y = cos(Ang(i)) * [1.05 1.1] * r_max; 475 | line(PlotAxis, x,y,'LineWidth',2,'Color',[0 0 0]); 476 | line(PlotAxis,-x,y,'LineWidth',2,'Color',[0 0 0]); 477 | end 478 | 479 | 480 | % ell_h = ellipse(PlotAxis,r_max*0.99,r_max*0.99,[],0,0); 481 | % set(ell_h,'LineWidth',2,'Color',[0 0 0]); 482 | end 483 | 484 | 485 | hold(PlotAxis,'off'); 486 | set(PlotAxis,'xtick',[],'ytick',[],'xticklabel',[],'yticklabel',[],'Visible','off','XLim',[-xmx-15 xmx+15],'YLim',[-ymx-15 ymx+15+NoseRadius],'DataAspectRatio',[1 1 1]); %,'Color',get(get(PlotAxis,'Parent'),'Color')); 487 | %freezeColors(PlotAxis); 488 | 489 | tit = get(PlotAxis,'Title'); 490 | tit.Visible = 'on'; 491 | 492 | if vararginmatch(varargin,'Title') 493 | txt = varargin{vararginmatch(varargin,'Title')+1}; 494 | tit.String = txt; 495 | end 496 | 497 | if vararginmatch(varargin,'Background') 498 | BckCol = varargin{vararginmatch(varargin,'Background')+1}; 499 | set(PlotAxis,'Color',BckCol); 500 | axis(PlotAxis,'on'); 501 | end 502 | 503 | -------------------------------------------------------------------------------- /Microstate template explorer.prj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Microstate template explorer 4 | Thomas Koenig 5 | thomas.koenig@unibe.ch 6 | 7 | 8 | 9 | 10 | 11 | /private/var/folders/jr/tbmz7_q16_v8z5y2m005475c0000gn/T/tp8db640ef_e6a4_40a7_a4cb_f4fd6d8b6adc.png 12 | 1.01 13 | 14 | 15 | 16 | 17 | ${PROJECT_ROOT} 18 | 56670f98-a1f6-4974-b3a6-0692f479b025 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ${PROJECT_ROOT}/MSTemplateExplorer.mlapp 33 | 34 | 35 | ${MATLAB_ROOT}/toolbox/local/userpath.m 36 | ${PROJECT_ROOT}/3D.png 37 | ${PROJECT_ROOT}/AddTemplate.png 38 | ${PROJECT_ROOT}/Broom.png 39 | ${PROJECT_ROOT}/CarTool.png 40 | ${PROJECT_ROOT}/Cluster.png 41 | ${PROJECT_ROOT}/CompareTemplateMaps.m 42 | ${PROJECT_ROOT}/Compute.png 43 | ${PROJECT_ROOT}/Edit.png 44 | ${PROJECT_ROOT}/GetChannelPositionsFromLabels.m 45 | ${PROJECT_ROOT}/MSTemplateEditor.mlapp 46 | ${PROJECT_ROOT}/MSTemplatesCarTool2eeglab.m 47 | ${PROJECT_ROOT}/MakeResampleMatrices.m 48 | ${PROJECT_ROOT}/Minus.png 49 | ${PROJECT_ROOT}/NormDim.m 50 | ${PROJECT_ROOT}/Open.jpg 51 | ${PROJECT_ROOT}/Planar2Sphere.m 52 | ${PROJECT_ROOT}/Plus.png 53 | ${PROJECT_ROOT}/ReadSXYZ.m 54 | ${PROJECT_ROOT}/Save.png 55 | ${PROJECT_ROOT}/SaveAs.png 56 | ${PROJECT_ROOT}/SetXYZCoordinates.fig 57 | ${PROJECT_ROOT}/SetXYZCoordinates.m 58 | ${PROJECT_ROOT}/Swap.png 59 | ${PROJECT_ROOT}/VAsph2cart.m 60 | ${PROJECT_ROOT}/binoculars.png 61 | ${PROJECT_ROOT}/bluered.m 62 | ${PROJECT_ROOT}/dspCMap.m 63 | ${PROJECT_ROOT}/dspCMap2T.m 64 | ${PROJECT_ROOT}/eeg_kMeans.m 65 | ${PROJECT_ROOT}/mywaitbar.m 66 | ${PROJECT_ROOT}/rotate.m 67 | ${PROJECT_ROOT}/splint2.m 68 | ${PROJECT_ROOT}/txt.png 69 | ${PROJECT_ROOT}/uipickfiles.m 70 | ${PROJECT_ROOT}/vararginmatch.m 71 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/dspMapClass.m 72 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/display.m 73 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/eegobj.m 74 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/fieldnames.m 75 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/horzcat2.m 76 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/isfield.m 77 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/isstruct.m 78 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/length.m 79 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/orderfields.m 80 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/rmfield.m 81 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/simpletest.m 82 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/subsasgn.m 83 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@eegobj/subsref.m 84 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/binaryopp.m 85 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/bsxfun.m 86 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/changefile.m 87 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/checkcopies_local.m 88 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/checkworkspace.m 89 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/ctranspose.m 90 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/display.m 91 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/double.m 92 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/end.m 93 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/fft.m 94 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/isnumeric.m 95 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/length.m 96 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/mmo.m 97 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/ndims.m 98 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/permute.m 99 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/reshape.m 100 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/size.m 101 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/subsasgn.m 102 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/subsasgn_old.m 103 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/subsref.m 104 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/sum.m 105 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/transpose.m 106 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/unitaryopp.m 107 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/@mmo/var.m 108 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_checkchanlocs.m 109 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_checkset.m 110 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_eval.m 111 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_getdatact.m 112 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_getversion.m 113 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_hist.m 114 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_options.m 115 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_optionsbackup.m 116 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_retrieve.m 117 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeg_store.m 118 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/eeglab_options.m 119 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/error_bc.m 120 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/intersect_bc.m 121 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/is_sccn.m 122 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/ismatlab.m 123 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/ismember_bc.m 124 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_askinstall.m 125 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_getweb.m 126 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_install.m 127 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_urlread.m 128 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_urlreadwrite.m 129 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_urlsize.m 130 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/plugin_urlwrite.m 131 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/setdiff_bc.m 132 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/union_bc.m 133 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/unique_bc.m 134 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/adminfunc/vararg2str.m 135 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/errordlg2.m 136 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/finputcheck.m 137 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/inputgui.m 138 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/questdlg2.m 139 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/supergui.m 140 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/guifunc/warndlg2.m 141 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_boundarytype.m 142 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_decodechan.m 143 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_eegrej.m 144 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_emptyset.m 145 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_findboundaries.m 146 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_getica.m 147 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_insertbound.m 148 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_insertboundold.m 149 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_interp.m 150 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_isboundary.m 151 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_lat2point.m 152 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_point2lat.m 153 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_uniformepochinfo.m 154 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/eeg_urlatency.m 155 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/pop_editeventvals.m 156 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/pop_importepoch.m 157 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/pop_loadset.m 158 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/pop_saveset.m 159 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/popfunc/pop_select.m 160 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/convertlocs.m 161 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/eegrej.m 162 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/epoch.m 163 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/fastif.m 164 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/floatwrite.m 165 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/gettempfolder.m 166 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/icadefs.m 167 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/isscript.m 168 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/loadtxt.m 169 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/lookupchantemplate.m 170 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/mattocell.m 171 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/parsetxt.m 172 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/readeetraklocs.m 173 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/readelp.m 174 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/readlocs.m 175 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/readneurolocs.m 176 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/readtxtfile.m 177 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/sph2topo.m 178 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/strmultiline.m 179 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/topo2sph.m 180 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/uigetfile2.m 181 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/sigprocfunc/uiputfile2.m 182 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/studyfunc/std_chaninds.m 183 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/functions/studyfunc/std_maketrialinfo.m 184 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/arguments/arg_guipanel.m 185 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/arguments/arg_report.m 186 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/arguments/arg_tovals.m 187 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/helpers/hlp_struct2varargin.m 188 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/helpers/hlp_varargin2struct.m 189 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/keywords/mandatory.m 190 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/Cleanline2.00/external/bcilab_partial/keywords/unassigned.m 191 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/dipfit/dipfitdefs.m 192 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/dipfit/eeglab2fieldtrip.m 193 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/dipfit/pop_dipfit_settings.m 194 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/dipfit/traditionaldipfit.m 195 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/eeglab2022.1/plugins/microstates/analysis_functions/plotting_functions/PlotElectrode.m 196 | 197 | 198 | 199 | 200 | /Users/thomaskoenig/Dropbox (PUK-TRC)/Documents/MATLAB/MSWebApp 201 | 202 | 203 | 204 | /Applications/MATLAB_R2022b.app 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | true 215 | 216 | 217 | 218 | 219 | true 220 | 221 | 222 | 223 | 224 | true 225 | 226 | 227 | 228 | 229 | true 230 | 231 | 232 | 233 | 234 | true 235 | 236 | 237 | 238 | 239 | true 240 | true 241 | false 242 | false 243 | false 244 | false 245 | false 246 | false 247 | 13.4.1 248 | false 249 | true 250 | maci64 251 | true 252 | 253 | 254 | -------------------------------------------------------------------------------- /dspCMap2T.m: -------------------------------------------------------------------------------- 1 | function HelperData = dspCMap2T(map,ChanPos,varargin) 2 | % dspCMap2 - Display topographic scalp maps 3 | % ---------------------------------------- 4 | % Copyright 2009-2011 Thomas Koenig 5 | % distributed under the terms of the GNU AFFERO General Public License 6 | % 7 | % Usage: dspCMap(map,ChanPos,CStep) 8 | % 9 | % map is the 1xN voltage map to display, where N is the number of electrode 10 | % 11 | % ChanPos contains the electrode positions, either as Nx3 xyz coordinates, 12 | % or as structure withRadius, Theta and Phi (Brainvision convention), or as 13 | % labels of the 10-10 system 14 | % 15 | % CStep is the size of a single step in the contourlines, a default is used 16 | % if this is not set 17 | % 18 | % There are a series of options that can be set using parameter/value 19 | % pairs: 20 | %dir 21 | % 22 | % 'Step' Step between contour lines 23 | % 'Axis' The Axis to plot into 24 | % 'LineWidth' Sets linewidth 25 | % '3D' Show the map in 3D 26 | 27 | HelperFieldNames = {'NewHullEdgesX','NewHullEdgesY','XGrid2DaxPlane','YGrid2DaxPlane','XAxis2DGrid','YAxis2DGrid','XGrid2D','YGrid2D','InHull','ElectrodesOnPlaneX','ElectrodesOnPlaneY','InterpolationMatrix'}; 28 | 29 | InputParameters = inputParser; 30 | addOptional(InputParameters,'Step' ,max(abs(map)) / 4, @(x) isnumeric(x) && isscalar(x)); 31 | addOptional(InputParameters,'Axis' ,[],@(x)isa(x,'matlab.graphics.axis.Axes')||isempty(x)); 32 | addOptional(InputParameters,'tValues' ,[],@(x)isnumeric(x)); 33 | addOptional(InputParameters,'FigureHandle',[],@(x)isa(x,'matlab.ui.Figure')||isempty(x)); 34 | addOptional(InputParameters,'LineWidth' ,1,@(x)isnumeric(x)&&isscalar(x)); 35 | addOptional(InputParameters,'ContourLines',false,@(x)islogical(x)&&isscalar(x)); 36 | addOptional(InputParameters,'Title' ,[],@(s)isstring(s) || ischar(s)); 37 | addOptional(InputParameters,'Show3D' ,[],@(x)(islogical(x)||isempty(x))&&isscalar(x)); 38 | addOptional(InputParameters,'MenuButton' ,false,@(x)islogical(x)&&isscalar(x)); 39 | addOptional(InputParameters,'TuningMode' ,false,@(x)islogical(x)&&isscalar(x)); 40 | addOptional(InputParameters,'ContextMenu' ,false,@(x)islogical(x)&&isscalar(x)); 41 | addOptional(InputParameters,'Background' ,[],@(x)(all(isnumeric(x))&&numel(x) == 3) || isempty(x)); 42 | addOptional(InputParameters,'ShowPosition',[],@(x)(all(islogical(x))||iscell(x)) || isempty(x)); 43 | 44 | parse(InputParameters,varargin{:}); 45 | 46 | if InputParameters.Results.TuningMode 47 | clc; 48 | tic; 49 | end 50 | 51 | if isempty(InputParameters.Results.Axis) 52 | AxisToUse = gca; 53 | else 54 | AxisToUse = InputParameters.Results.Axis; 55 | end 56 | 57 | if isempty(InputParameters.Results.FigureHandle) 58 | FigureToUse = gcf; 59 | else 60 | FigureToUse = InputParameters.Results.FigureHandle; 61 | end 62 | if nargout < 1 63 | UserData = AxisToUse.UserData; 64 | else 65 | UserData = []; 66 | end 67 | 68 | 69 | HelperDataThere = false; 70 | 71 | if isstruct(ChanPos) && nargout < 1 72 | if isfield(ChanPos,'HelperData') 73 | for fn = HelperFieldNames 74 | UserData.PrivateMapInfo.(fn{1}) = ChanPos.HelperData.(fn{1}); 75 | end 76 | HelperDataThere = true; 77 | end 78 | end 79 | 80 | UserData.PrivateMapInfo.tMap = InputParameters.Results.tValues; 81 | UserData.PrivateMapInfo.FigureHandle = FigureToUse; 82 | UserData.PrivateMapInfo.MapLineWidth = InputParameters.Results.LineWidth; 83 | UserData.PrivateMapInfo.ContourLines = InputParameters.Results.ContourLines; 84 | UserData.PrivateMapInfo.Title = InputParameters.Results.Title; 85 | UserData.PrivateMapInfo.MenuButton = InputParameters.Results.MenuButton; 86 | UserData.PrivateMapInfo.Background = InputParameters.Results.Background; 87 | UserData.PrivateMapInfo.ShowPosition = InputParameters.Results.ShowPosition; 88 | 89 | if ~isempty(InputParameters.Results.Show3D) 90 | UserData.PrivateMapInfo.Show3D = InputParameters.Results.Show3D; 91 | else 92 | if ~isfield(UserData.PrivateMapInfo,'Show3D') 93 | UserData.PrivateMapInfo.Show3D = false; 94 | end 95 | end 96 | 97 | if HelperDataThere == false 98 | res = 1; 99 | 100 | if iscell(ChanPos) 101 | ChanPos = GetChannelPositionsFromLabels(ChanPos); 102 | end 103 | 104 | if isstruct(ChanPos) 105 | if isfield(ChanPos,'Theta') || isfield(ChanPos,'CoordsTheta') 106 | [x,y,z] = VAsph2cart(ChanPos); 107 | 108 | elseif isfield(ChanPos,'X') 109 | y = cell2mat({ChanPos.X}); 110 | x = -cell2mat({ChanPos.Y}); 111 | z = cell2mat({ChanPos.Z}); 112 | elseif isfield(ChanPos,'x') 113 | x = -cell2mat({ChanPos.x}); 114 | y = cell2mat({ChanPos.y}); 115 | z = cell2mat({ChanPos.z}); 116 | else 117 | error('Unknown montage format'); 118 | end 119 | 120 | else 121 | if size(ChanPos,1) == 3 122 | ChanPos = ChanPos'; 123 | end 124 | x = -ChanPos(:,2)'; 125 | y = ChanPos(:,1)'; 126 | z = ChanPos(:,3)'; 127 | end 128 | 129 | r = sqrt(x.*x + y.*y + z.*z); 130 | 131 | x = x ./ r; 132 | y = y ./ r; 133 | z = z ./ r; 134 | 135 | % Here, we project things on a sphere 136 | 137 | Theta = acos(z) / pi * 180; 138 | r = sqrt(x.*x + y.* y); 139 | 140 | r(r == 0) = 1; 141 | 142 | UserData.PrivateMapInfo.ElectrodesOnPlaneX = x./r.*Theta; 143 | UserData.PrivateMapInfo.ElectrodesOnPlaneY = y./r.*Theta; 144 | 145 | if ~isempty(UserData.PrivateMapInfo.ShowPosition) 146 | UserData.PrivateMapInfo.ElectrodesToPlotX = x./r.*Theta; 147 | UserData.PrivateMapInfo.ElectrodesToPlotY = y./r.*Theta; 148 | end 149 | if InputParameters.Results.TuningMode 150 | fprintf(1,'Start Hull: %f\n',toc); 151 | end 152 | 153 | % This finds the convex hull around the electrodes and interpolates 154 | % the points in between making spheres instead of straight lines, 155 | % as these lines look bad in 3D 156 | 157 | [kHull] = convhull(UserData.PrivateMapInfo.ElectrodesOnPlaneX,UserData.PrivateMapInfo.ElectrodesOnPlaneY); 158 | 159 | HullOriginalEdgesX = UserData.PrivateMapInfo.ElectrodesOnPlaneX(kHull); 160 | HullOriginalEdgesY = UserData.PrivateMapInfo.ElectrodesOnPlaneY(kHull); 161 | 162 | HullOriginalEdgesRadius = sqrt(HullOriginalEdgesX.^2 + HullOriginalEdgesY.^2); 163 | HullOriginalEdgesAngle = acos(HullOriginalEdgesY./HullOriginalEdgesRadius); 164 | HullOriginalEdgesAngle(HullOriginalEdgesX > 0) = 2 * pi - HullOriginalEdgesAngle(HullOriginalEdgesX > 0); 165 | [~,idx] = min(HullOriginalEdgesAngle); 166 | HullOriginalEdgesAngle(1:(idx-1)) = HullOriginalEdgesAngle(1:(idx-1)) - 2*pi; % These are all the angles of the electrodes 167 | 168 | 169 | HullOriginalEdgesAngle = [HullOriginalEdgesAngle HullOriginalEdgesAngle(1) + 2*pi]; 170 | HullOriginalEdgesRadius = [HullOriginalEdgesRadius HullOriginalEdgesRadius(1)]; 171 | 172 | [HullOriginalEdgesAngle,idx] = unique(HullOriginalEdgesAngle); 173 | 174 | NewHullAngles = unique(min(HullOriginalEdgesAngle):4 * pi /180:max(HullOriginalEdgesAngle)); % These are the angles of the new sphere 175 | HullOriginalEdgesRadius = HullOriginalEdgesRadius(idx); 176 | InterpRadius = interp1(HullOriginalEdgesAngle,HullOriginalEdgesRadius,NewHullAngles); % The radius is linearly interpolated 177 | 178 | UserData.PrivateMapInfo.NewHullEdgesX = sin(NewHullAngles).* InterpRadius; % And we recompute X and Y of the full hull 179 | UserData.PrivateMapInfo.NewHullEdgesY = cos(NewHullAngles).* InterpRadius; 180 | 181 | % Here, we create an equally spaced grid that Matlab can handle 182 | % well 183 | UserData.PrivateMapInfo.XGrid2DaxPlane = max(abs(UserData.PrivateMapInfo.NewHullEdgesX)); 184 | UserData.PrivateMapInfo.YGrid2DaxPlane = max(abs(UserData.PrivateMapInfo.NewHullEdgesY)); 185 | 186 | UserData.PrivateMapInfo.XAxis2DGrid = -UserData.PrivateMapInfo.XGrid2DaxPlane:res:UserData.PrivateMapInfo.XGrid2DaxPlane; 187 | UserData.PrivateMapInfo.YAxis2DGrid = -UserData.PrivateMapInfo.YGrid2DaxPlane:res:UserData.PrivateMapInfo.YGrid2DaxPlane; 188 | 189 | [UserData.PrivateMapInfo.XGrid2D,UserData.PrivateMapInfo.YGrid2D] = meshgrid(UserData.PrivateMapInfo.XAxis2DGrid,UserData.PrivateMapInfo.YAxis2DGrid); 190 | 191 | if InputParameters.Results.TuningMode 192 | fprintf(1,'Before inpolygon: %f\n',toc); 193 | end 194 | UserData.PrivateMapInfo.InHull = inpolygon(UserData.PrivateMapInfo.XGrid2D,UserData.PrivateMapInfo.YGrid2D,UserData.PrivateMapInfo.NewHullEdgesX,UserData.PrivateMapInfo.NewHullEdgesY); 195 | 196 | PointsToExtrapolateX = UserData.PrivateMapInfo.NewHullEdgesX(2:end)*1.05; 197 | PointsToExtrapolateY = UserData.PrivateMapInfo.NewHullEdgesY(2:end)*1.05; 198 | 199 | 200 | [mx,my,mz] = Planar2Sphere(PointsToExtrapolateX,PointsToExtrapolateY,1.00); 201 | 202 | 203 | 204 | if InputParameters.Results.TuningMode 205 | fprintf(1,'Before interpolation: %f\n',toc); 206 | end 207 | UserData.PrivateMapInfo.InterpolationMatrix = [eye(numel(x)); splint2([x(:) y(:) z(:)],eye(numel(x)),[mx(:) my(:) mz(:)])]; 208 | 209 | UserData.PrivateMapInfo.ElectrodesOnPlaneX = [UserData.PrivateMapInfo.ElectrodesOnPlaneX(:);PointsToExtrapolateX(:)]; 210 | UserData.PrivateMapInfo.ElectrodesOnPlaneY = [UserData.PrivateMapInfo.ElectrodesOnPlaneY(:);PointsToExtrapolateY(:)]; 211 | 212 | if InputParameters.Results.TuningMode 213 | fprintf(1,'After interpolation: %f\n',toc); 214 | end 215 | else 216 | if InputParameters.Results.TuningMode 217 | disp('Setup bypassed'); 218 | end 219 | end 220 | 221 | if nargout > 0 222 | HelperData = []; 223 | for fn = HelperFieldNames 224 | HelperData.(fn{1}) = UserData.PrivateMapInfo.(fn{1}); 225 | end 226 | return 227 | end 228 | 229 | if InputParameters.Results.TuningMode 230 | fprintf(1,'Start Interpolating: %f\n',toc); 231 | end 232 | UserData.PrivateMapInfo.imap = griddata(UserData.PrivateMapInfo.ElectrodesOnPlaneX,UserData.PrivateMapInfo.ElectrodesOnPlaneY,UserData.PrivateMapInfo.InterpolationMatrix*map,UserData.PrivateMapInfo.XGrid2D,UserData.PrivateMapInfo.YGrid2D,'cubic'); 233 | UserData.PrivateMapInfo.imap(~UserData.PrivateMapInfo.InHull) = nan; 234 | if ~isempty(UserData.PrivateMapInfo.tMap) 235 | UserData.PrivateMapInfo.itmap = griddata(UserData.PrivateMapInfo.ElectrodesOnPlaneX,UserData.PrivateMapInfo.ElectrodesOnPlaneY,UserData.PrivateMapInfo.InterpolationMatrix*UserData.PrivateMapInfo.tMap,UserData.PrivateMapInfo.XGrid2D,UserData.PrivateMapInfo.YGrid2D,'cubic'); 236 | UserData.PrivateMapInfo.itmap(~UserData.PrivateMapInfo.InHull) = nan; 237 | end 238 | 239 | if InputParameters.Results.TuningMode 240 | fprintf(1,'Done Interpolating: %f\n',toc); 241 | end 242 | 243 | UserData.PrivateMapInfo.nLevels = ceil(max(abs(UserData.PrivateMapInfo.imap(:))) / InputParameters.Results.Step) +1; 244 | UserData.PrivateMapInfo.Levels = ((-UserData.PrivateMapInfo.nLevels) * InputParameters.Results.Step):InputParameters.Results.Step:((UserData.PrivateMapInfo.nLevels)*InputParameters.Results.Step); 245 | 246 | UserData.PrivateMapInfo.ShowTValues = false; 247 | % FindPositionInUIFigure(InputParameters.Results.Axis) 248 | 249 | if InputParameters.Results.MenuButton && ~isfield(UserData.PrivateMapInfo,'Button') 250 | if isa(FigureToUse,'matlab.ui.Figure') 251 | UserData.PrivateMapInfo.Button = uibutton('Parent',AxisToUse,'Position',[10 10 20 20],'Text','...'); 252 | else 253 | UserData.PrivateMapInfo.Button = uicontrol('Parent',FigureToUse,'Style','pushbutton','Units','normalized','Position',[0.1 0.1 0.1 0.1],'String','...'); 254 | end 255 | end 256 | 257 | 258 | if isa(FigureToUse,'matlab.ui.Figure') 259 | UIAxesZoom = zoom(AxisToUse); 260 | setAllowAxesZoom(UIAxesZoom,AxisToUse,1); 261 | end 262 | % UserData.PrivateMapInfo.Button = uibutton(PlotAxis.Parent,'Position',[0 0 0.05 0.05]); 263 | AxisToUse.UserData.PrivateMapInfo = UserData.PrivateMapInfo; 264 | 265 | if InputParameters.Results.TuningMode 266 | fprintf(1,'Ready to plot: %f\n',toc); %#ok<*UNRCH> 267 | end 268 | 269 | 270 | % AxisToUse.Toolbar.Visible = 'off'; 271 | % AxisToUse.Interactions = []; 272 | 273 | if UserData.PrivateMapInfo.Show3D == false 274 | Show2DMap([],[],AxisToUse); 275 | else 276 | Show3DMap([],[],AxisToUse); 277 | end 278 | end 279 | 280 | function Show2DMap(~,~,PlotAxis) 281 | 282 | cla(PlotAxis); 283 | 284 | ud = PlotAxis.UserData.PrivateMapInfo; 285 | 286 | if ud.ShowTValues == false 287 | MapToShow = ud.imap; 288 | else 289 | MapToShow = ud.itmap; 290 | end 291 | 292 | if ud.ContourLines == true 293 | contourf(PlotAxis,ud.XGrid2D,ud.YGrid2D,MapToShow,ud.Levels,'LineWidth',ud.MapLineWidth); 294 | else 295 | surf(PlotAxis,ud.XGrid2D,ud.YGrid2D,MapToShow); 296 | view(PlotAxis,2); 297 | shading(PlotAxis,'interp'); 298 | end 299 | hold(PlotAxis,'on'); 300 | 301 | if ~isempty(ud.ShowPosition) 302 | plot3(PlotAxis,ud.ElectrodesToPlotX,ud.ElectrodesToPlotY,ones(size(ud.ElectrodesToPlotX)),'.k'); 303 | 304 | if iscell(ud.ShowPosition) 305 | text(PlotAxis,ud.ElectrodesToPlotX,ud.ElectrodesToPlotY,ones(size(ud.ElectrodesToPlotX)),ud.ShowPosition); 306 | end 307 | end 308 | 309 | caxis(PlotAxis,[ud.Levels(1) ud.Levels(end)]); 310 | colormap(PlotAxis,bluered(ud.nLevels*2)); 311 | plot(PlotAxis,ud.NewHullEdgesX,ud.NewHullEdgesY,'-k','LineWidth',ud.MapLineWidth*2); 312 | hold(PlotAxis,'off'); 313 | axis(PlotAxis,'equal'); 314 | if isempty(ud.Background) 315 | axis(PlotAxis,'off'); 316 | else 317 | set(PlotAxis,'xtick',[],'ytick',[],'xticklabel',[],'yticklabel',[],'Color',ud.Background); 318 | end 319 | ud.Show3D = false; 320 | PlotAxis.UserData.PrivateMapInfo = ud; 321 | ShowTitle(PlotAxis); 322 | PlotAxis.PlotBoxAspectRatio = [1,1,1]; 323 | PlotAxis.PlotBoxAspectRatioMode = 'manual'; 324 | UpdateTheContextMenu(PlotAxis); 325 | 326 | end 327 | 328 | 329 | function Show3DMap(~,~,PlotAxis) 330 | cla(PlotAxis); 331 | 332 | hold(PlotAxis,'on'); 333 | 334 | ud = PlotAxis.UserData.PrivateMapInfo; 335 | 336 | [mx,my,mz] = Planar2Sphere(ud.XGrid2D,ud.YGrid2D,1.00); 337 | c = []; 338 | 339 | if ud.ShowTValues == false 340 | if ud.ContourLines == true 341 | c = contourc(ud.XAxis2DGrid,ud.YAxis2DGrid,ud.imap,ud.Levels); 342 | end 343 | surfhandle = surf(PlotAxis,mx,my,mz,ud.imap,'BackFaceLighting','unlit'); 344 | else 345 | if ud.ContourLines == true 346 | c = contourc(ud.XAxis2DGrid,ud.YAxis2DGrid,ud.itmap,ud.Levels); 347 | end 348 | surfhandle = surf(PlotAxis,mx,my,mz,ud.itmap,'BackFaceLighting','unlit'); 349 | end 350 | 351 | 352 | caxis(PlotAxis,[ud.Levels(1) ud.Levels(end)]); 353 | colormap(PlotAxis,bluered(ud.nLevels*2)); 354 | 355 | shading(PlotAxis,'interp'); 356 | 357 | idx = 1; 358 | while(idx < size(c,2)) 359 | % clevel = c(1,idx); 360 | npts = c(2,idx); 361 | idx = idx + 1; 362 | cx = c(1,idx: (idx + npts-1)); 363 | cy = c(2,idx: (idx + npts-1)); 364 | [px,py,pz] = Planar2Sphere(cx,cy,1.00); 365 | idx = idx + npts; 366 | plot3(PlotAxis,px,py,pz,'-k','LineWidth',ud.MapLineWidth); 367 | end 368 | [HullX,HullY,HullZ] = Planar2Sphere(ud.NewHullEdgesX,ud.NewHullEdgesY); 369 | plot3(PlotAxis,HullX,HullY,HullZ,'-k','LineWidth',ud.MapLineWidth*4); 370 | hold(PlotAxis,'off'); 371 | axis(PlotAxis,'equal'); 372 | axis(PlotAxis,'off'); 373 | 374 | 375 | ShowEye(PlotAxis,-0.3,0.70,-0.5,0.2); 376 | ShowEye(PlotAxis, 0.3,0.70,-0.5,0.2); 377 | 378 | if ud.Show3D == false 379 | SetView([],[],PlotAxis, 127.5,30); 380 | end 381 | ud.Show3D = true; 382 | 383 | PlotAxis.UserData.PrivateMapInfo = ud; 384 | axis(PlotAxis,'vis3d'); 385 | material(surfhandle,'dull'); 386 | light(PlotAxis); 387 | ShowTitle(PlotAxis); 388 | PlotAxis.PlotBoxAspectRatio = [1,1,1]; 389 | PlotAxis.PlotBoxAspectRatioMode = 'manual'; 390 | UpdateTheContextMenu(PlotAxis); 391 | end 392 | 393 | function ShowTitle(PlotAxis) 394 | if ~isempty(PlotAxis.UserData.PrivateMapInfo.Title) 395 | PlotAxis.Title.Visible = 'on'; 396 | PlotAxis.Title.Interpreter = 'none'; 397 | PlotAxis.Title.String = PlotAxis.UserData.PrivateMapInfo.Title; 398 | else 399 | PlotAxis.Title.Visible = 'off'; 400 | end 401 | end 402 | 403 | function OpenMyContextMenu(obj,event) 404 | CurrentPoint = obj.Parent.CurrentPoint; 405 | open(obj,[CurrentPoint(1),CurrentPoint(2)]); 406 | end 407 | 408 | function UpdateTheContextMenu(PlotAxis) 409 | if ~isempty(PlotAxis.UserData.PrivateMapInfo.FigureHandle) 410 | 411 | ContextMenu = uicontextmenu(PlotAxis.UserData.PrivateMapInfo.FigureHandle); 412 | else 413 | ContextMenu = uicontextmenu(PlotAxis.Parent); 414 | end 415 | 416 | ContextMenu.ContextMenuOpeningFcn = @OpenMyContextMenu; 417 | if PlotAxis.UserData.PrivateMapInfo.Show3D == false 418 | uimenu(ContextMenu, 'Label', 'Plot 3D map', 'Callback', {@Show3DMap,PlotAxis}); 419 | else 420 | uimenu(ContextMenu, 'Label', 'Plot 2D map', 'Callback', {@Show2DMap,PlotAxis}); 421 | end 422 | if ~isempty(PlotAxis.UserData.PrivateMapInfo.tMap) 423 | if PlotAxis.UserData.PrivateMapInfo.ShowTValues == true 424 | uimenu(ContextMenu, 'Label', 'Show t-value', 'Callback', {@SwitchToTMap,PlotAxis,false}, 'Checked','on', 'Separator','on'); 425 | else 426 | uimenu(ContextMenu, 'Label', 'Show t-value', 'Callback', {@SwitchToTMap,PlotAxis,true}, 'Checked','off'); 427 | end 428 | end 429 | if PlotAxis.UserData.PrivateMapInfo.Show3D == true 430 | 431 | uimenu(ContextMenu, 'Label', 'Free rotation', 'Callback', {@FreeRotate, PlotAxis}, 'Separator','on'); 432 | uimenu(ContextMenu, 'Label', 'Left view', 'Callback', {@SetView, PlotAxis,-90, 0}, 'Separator','on'); 433 | uimenu(ContextMenu, 'Label', 'Right view', 'Callback', {@SetView, PlotAxis, 90, 0}); 434 | uimenu(ContextMenu, 'Label', 'Front view', 'Callback', {@SetView, PlotAxis,180, 0}); 435 | uimenu(ContextMenu, 'Label', 'Back view', 'Callback', {@SetView, PlotAxis, 0, 0}); 436 | uimenu(ContextMenu, 'Label', 'Top view', 'Callback', {@SetView, PlotAxis, 0,90}); 437 | 438 | uimenu(ContextMenu, 'Label', 'Left back view', 'Callback',{@SetView, PlotAxis,- 37.5,30}, 'Separator','on'); 439 | uimenu(ContextMenu, 'Label', 'Right back view', 'Callback',{@SetView, PlotAxis, 37.5,30}); 440 | uimenu(ContextMenu, 'Label', 'Left front view', 'Callback',{@SetView, PlotAxis,-127.5,30}); 441 | uimenu(ContextMenu, 'Label', 'Right front view','Callback',{@SetView, PlotAxis, 127.5,30}); 442 | 443 | uimenu(ContextMenu,'Label', 'Light from left', 'Separator','on','Callback', {@CamlightCallback,PlotAxis,'Left'}); 444 | uimenu(ContextMenu,'Label', 'Light from right', 'Callback', {@CamlightCallback,PlotAxis,'Right'}); 445 | uimenu(ContextMenu,'Label', 'No lights', 'Callback',{@DeleteLights,PlotAxis}); 446 | 447 | uimenu(ContextMenu,'Label', 'Look at me', 'Separator','on','Callback',{@LookAtMe,PlotAxis}); 448 | uimenu(ContextMenu,'Label', 'Blue eyes', 'Separator','on','Callback',{@EyeColor,PlotAxis,[0.2 0.2 1]}); 449 | uimenu(ContextMenu,'Label', 'Brown eyes','Callback',{@EyeColor,PlotAxis,[153/255 76/255 0]}); 450 | uimenu(ContextMenu,'Label', 'Zoom','Callback',{@ZoomOut,PlotAxis}, 'Separator','on'); 451 | end 452 | if isfield(PlotAxis.UserData.PrivateMapInfo,'Button') 453 | if isa(PlotAxis.UserData.PrivateMapInfo.FigureHandle,'matlab.ui.Figure') 454 | PlotAxis.UserData.PrivateMapInfo.Button.ButtonPushedFcn = {@ButtonOpenContextMenu,PlotAxis.UserData.PrivateMapInfo.FigureHandle, ContextMenu}; 455 | else 456 | PlotAxis.UserData.PrivateMapInfo.Button.Callback = {@ButtonOpenContextMenu,PlotAxis.UserData.PrivateMapInfo.FigureHandle, ContextMenu}; 457 | end 458 | else 459 | AddContextMenu(PlotAxis,ContextMenu); 460 | end 461 | end 462 | 463 | function AddContextMenu(obj,cm) 464 | 465 | if isprop(obj,'ContextMenu') 466 | obj.ContextMenu = cm; 467 | elseif isprop(obj,'uicontextmenu') 468 | obj.uicontextmenu = cm; 469 | end 470 | 471 | children = obj.Children; 472 | for kid = 1:numel(children) 473 | AddContextMenu(children(kid),cm); 474 | % children(kid).HitTest = 'off'; 475 | 476 | end 477 | end 478 | 479 | function ZoomOut(~,~,Axis) 480 | NewFigure = figure; 481 | NewAxes = axes(NewFigure); 482 | NewAxes.UserData = Axis.UserData; 483 | if isfield(NewAxes.UserData.PrivateMapInfo,'Button') 484 | NewAxes.UserData.PrivateMapInfo = rmfield(NewAxes.UserData.PrivateMapInfo,'Button'); 485 | end 486 | NewAxes.UserData.PrivateMapInfo.FigureHandle = NewFigure; 487 | if Axis.UserData.PrivateMapInfo.Show3D 488 | [az,el] = view(Axis); 489 | Show3DMap([],[],NewAxes); 490 | view(NewAxes,az,el); 491 | else 492 | Show2DMap([],[],NewAxes); 493 | end 494 | 495 | end 496 | 497 | function SetView(~,~,Axis,azimut,elevation) 498 | view(Axis,azimut,elevation); 499 | end 500 | 501 | function FreeRotate(obj,~,Axis) 502 | h = rotate3d(Axis); 503 | 504 | switch(h.Enable) 505 | case 'on' 506 | disp('on->off'); 507 | obj.Checked = 'off'; 508 | h.Enable = 'off'; 509 | Axis.Toolbar.Visible = 'off'; 510 | case 'off' 511 | disp('off->on'); 512 | obj.Checked = 'on'; 513 | h.Enable = 'on'; 514 | Axis.Toolbar.Visible = 'off'; 515 | end 516 | end 517 | 518 | 519 | 520 | 521 | function CamlightCallback(~,~,Axis,Direction) 522 | camlight(Axis,Direction,'infinite'); 523 | end 524 | 525 | function DeleteLights(~,~,Axis) 526 | delete(findall(Axis,'Type','light')); 527 | end 528 | 529 | function ButtonOpenContextMenu(obj,event, FigureHandle, TheMenu) 530 | CurrentPoint = FigureHandle.CurrentPoint; 531 | open(TheMenu,[CurrentPoint(1),CurrentPoint(2)]); 532 | end 533 | 534 | 535 | function OpenContextMenu(obj,event, FigureHandle) 536 | 537 | CurrentPoint = FigureHandle.CurrentPoint; 538 | open(obj.ContextMenu,[CurrentPoint(1),CurrentPoint(2)]); 539 | end 540 | 541 | 542 | function SwitchToTMap(~,~,PlotAxis,DoT) 543 | PlotAxis.UserData.PrivateMapInfo.ShowTValues = DoT; 544 | if PlotAxis.UserData.PrivateMapInfo.Show3D 545 | Show3DMap([],[],PlotAxis); 546 | else 547 | Show2DMap([],[],PlotAxis); 548 | end 549 | 550 | end 551 | 552 | function ShowEye(Axis,xpos,ypos,zpos,rad) 553 | [x,z,y] = sphere(100); 554 | [i1,j1] = find(y > 0.7); 555 | [i2,j2] = find(y > 0.9); 556 | [i3,j3] = find(y > 0.7 & y <= 0.9); 557 | x = x*rad + xpos; 558 | y = y*rad + ypos; 559 | z = z*rad + zpos; 560 | c = ones(size(x,1),size(x,2),3)-0.08; 561 | 562 | c(i1,j1,1) = 0.2; 563 | c(i1,j1,2) = 0.2; 564 | c(i1,j1,3) = 1; 565 | 566 | c(i2,j2,:) = 0; 567 | 568 | ud.pos = [xpos ypos zpos]; 569 | ud.icol = i3; 570 | ud.jcol = j3; 571 | ud.dir = [180 0]; 572 | surface(Axis,x,y,z,c,'EdgeColor','none','Tag','Eye','UserData',ud); 573 | end 574 | 575 | function LookAtMe(~,~,Axis) 576 | 577 | eyeh = findall(Axis,'Tag','Eye'); 578 | 579 | 580 | for i = 1:numel(eyeh) 581 | ud = get(eyeh(i),'UserData'); 582 | [az,el] = view(Axis); 583 | 584 | vert = abs(180-az); 585 | horiz = el; 586 | 587 | if vert < 50 && horiz < 45 && horiz > -60 588 | disp('normal') 589 | rotate(eyeh(i),[0 0 1],az-ud.dir(1),ud.pos); 590 | rotate(eyeh(i),[1 0 0],el-ud.dir(2),ud.pos); 591 | else 592 | disp('abnormal') 593 | % rotate(eyeh(i),[0 0 1],150-ud.dir(1),ud.pos); 594 | % rotate(eyeh(i),[1 0 0], 0-ud.dir(2),ud.pos); 595 | 596 | 597 | end 598 | 599 | ud.dir(1) = az; 600 | ud.dir(2) = el; 601 | set(eyeh(i),'UserData',ud); 602 | end 603 | 604 | end 605 | 606 | function EyeColor(~,~,figh,col) 607 | 608 | eyeh = findall(figh,'Tag','Eye'); 609 | 610 | for i = 1:numel(eyeh) 611 | ud = get(eyeh(i),'UserData'); 612 | 613 | c = get(eyeh(i),'CData'); 614 | c(ud.icol,ud.jcol,1) = col(1); 615 | c(ud.icol,ud.jcol,2) = col(2); 616 | c(ud.icol,ud.jcol,3) = col(3); 617 | set(eyeh(i),'CData',c); 618 | end 619 | 620 | end 621 | 622 | 623 | -------------------------------------------------------------------------------- /MSTemplateExplorer.prj: -------------------------------------------------------------------------------- 1 | 2 | 3 | MSTemplateExplorer 4 | Thomas Koenig 5 | thomas.koenig@unibe.ch 6 | 7 | 8 | 9 | 10 | 11 | C:\Users\Thomas Koenig\AppData\Local\Temp\tpaaa5e1f8_df0c_4657_a47c_21fec213d9a5.png 12 | 1.0 13 | 14 | 15 | 16 | 17 | win64 18 | 19 | ${PROJECT_ROOT} 20 | f9b5da14-c5f7-48ea-8111-722180d606df 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ${PROJECT_ROOT}\MSTemplateExplorer.mlapp 35 | 36 | 37 | ${MATLAB_ROOT}\toolbox\local\userpath.m 38 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\display.m 39 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\eegobj.m 40 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\fieldnames.m 41 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\horzcat2.m 42 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\isfield.m 43 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\isstruct.m 44 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\length.m 45 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\orderfields.m 46 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\rmfield.m 47 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\simpletest.m 48 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\subsasgn.m 49 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@eegobj\subsref.m 50 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\binaryopp.m 51 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\bsxfun.m 52 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\changefile.m 53 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\checkcopies_local.m 54 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\checkworkspace.m 55 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\ctranspose.m 56 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\display.m 57 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\double.m 58 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\end.m 59 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\fft.m 60 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\isnumeric.m 61 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\length.m 62 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\mmo.m 63 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\ndims.m 64 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\permute.m 65 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\reshape.m 66 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\size.m 67 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\subsasgn.m 68 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\subsasgn_old.m 69 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\subsref.m 70 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\sum.m 71 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\transpose.m 72 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\unitaryopp.m 73 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\@mmo\var.m 74 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_checkchanlocs.m 75 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_checkset.m 76 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_eval.m 77 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_getdatact.m 78 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_getversion.m 79 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_hist.m 80 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_options.m 81 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_optionsbackup.m 82 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_retrieve.m 83 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeg_store.m 84 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\eeglab_options.m 85 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\error_bc.m 86 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\intersect_bc.m 87 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\is_sccn.m 88 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\ismatlab.m 89 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_askinstall.m 90 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_getweb.m 91 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_install.m 92 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_urlread.m 93 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_urlreadwrite.m 94 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_urlsize.m 95 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\plugin_urlwrite.m 96 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\setdiff_bc.m 97 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\union_bc.m 98 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\unique_bc.m 99 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\adminfunc\vararg2str.m 100 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\errordlg2.m 101 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\finputcheck.m 102 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\inputgui.m 103 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\questdlg2.m 104 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\supergui.m 105 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\guifunc\warndlg2.m 106 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_boundarytype.m 107 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_decodechan.m 108 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_eegrej.m 109 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_emptyset.m 110 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_findboundaries.m 111 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_getica.m 112 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_insertbound.m 113 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_interp.m 114 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_isboundary.m 115 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_lat2point.m 116 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_mergelocs.m 117 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_mergelocs_diffstruct.m 118 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_point2lat.m 119 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_uniformepochinfo.m 120 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\eeg_urlatency.m 121 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_chancoresp.m 122 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_editeventvals.m 123 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_importepoch.m 124 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_loadset.m 125 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_saveset.m 126 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\popfunc\pop_select.m 127 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\celltomat.m 128 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\convertlocs.m 129 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\coregister.m 130 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\eegrej.m 131 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\epoch.m 132 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\fastif.m 133 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\floatwrite.m 134 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\gettempfolder.m 135 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\icadefs.m 136 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\isscript.m 137 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\loadtxt.m 138 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\lookupchantemplate.m 139 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\mattocell.m 140 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\parsetxt.m 141 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\plotmesh.m 142 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readeetraklocs.m 143 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readelp.m 144 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readlocs.m 145 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readneurodat.m 146 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readneurolocs.m 147 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\readtxtfile.m 148 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\sph2topo.m 149 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\strmultiline.m 150 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\topo2sph.m 151 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\uigetfile2.m 152 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\sigprocfunc\uiputfile2.m 153 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\studyfunc\std_chaninds.m 154 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\functions\studyfunc\std_maketrialinfo.m 155 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\arguments\arg_guipanel.m 156 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\arguments\arg_report.m 157 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\arguments\arg_tovals.m 158 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\helpers\hlp_struct2varargin.m 159 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\helpers\hlp_varargin2struct.m 160 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\keywords\mandatory.m 161 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\Cleanline2.00\external\bcilab_partial\keywords\unassigned.m 162 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\channelselection.m 163 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\dipfitdefs.m 164 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\eeglab2fieldtrip.m 165 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\electroderealign.m 166 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\headcoordinates.m 167 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\homogenous2traditional.m 168 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\pop_dipfit_settings.m 169 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\match_str.m 170 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\rotate.m 171 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\scale.m 172 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\traditional.m 173 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\translate.m 174 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\warp_apply.m 175 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\warp_error.m 176 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\private\warp_optim.m 177 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\dipfit\traditionaldipfit.m 178 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\microstates\analysis_functions\plotting_functions\PlotElectrode.m 179 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\eeglab2023.0\plugins\TTFrD\dspMapClass.m 180 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\ft_defaults.m 181 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\ft_prepare_headmodel.m 182 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\ft_prepare_layout.m 183 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\ft_prepare_mesh.m 184 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\ft_volumedownsample.m 185 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\channelposition.m 186 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\determine_segmentationstyle.m 187 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\dist.m 188 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\elproj.m 189 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\find_innermost_boundary.m 190 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\find_mesh_edge.m 191 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\find_outermost_boundary.m 192 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\find_triangle_neighbours.m 193 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\find_vertex_neighbours.m 194 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\fixname.m 195 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\fixpos.m 196 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\ft_fetch_sens.m 197 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\getorthoviewpos.m 198 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\getsubfield.m 199 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\grid2transform.m 200 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\headsurface.m 201 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\ignorefields.m 202 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\issubfield.m 203 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\loadvar.m 204 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mergestruct.m 205 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mesh2edge.m 206 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mesh_icosahedron.m 207 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mesh_octahedron.m 208 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mesh_sphere.m 209 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\mesh_tetrahedron.m 210 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\ndgrid.m 211 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\parameterselection.m 212 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\poly2tri.m 213 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_cortexhull.m 214 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_fittemplate.m 215 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_headshape.m 216 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_hexahedral.m 217 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_manual.m 218 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_segmentation.m 219 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\prepare_mesh_tetrahedral.m 220 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\projecttri.m 221 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\refine.m 222 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\remove_double_vertices.m 223 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\retriangulate.m 224 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\rmsubfield.m 225 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\rollback_provenance.m 226 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\rotate.m 227 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\setsubfield.m 228 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\solid_angle.m 229 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\solid_angle.mexw64 230 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\surface_inside.m 231 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\surface_normals.m 232 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\surface_orientation.m 233 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\surface_shift.m 234 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\triangulate_seg.m 235 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\undobalancing.m 236 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\volumefillholes.m 237 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\volumepad.m 238 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\volumesmooth.m 239 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\FieldTrip_Newer\private\volumethreshold.m 240 | ${PROJECT_ROOT}\3D.png 241 | ${PROJECT_ROOT}\AddTemplate.png 242 | ${PROJECT_ROOT}\binoculars.png 243 | ${PROJECT_ROOT}\bluered.m 244 | ${PROJECT_ROOT}\Broom.png 245 | ${PROJECT_ROOT}\CarTool.png 246 | ${PROJECT_ROOT}\Cluster.png 247 | ${PROJECT_ROOT}\CompareTemplateMaps.m 248 | ${PROJECT_ROOT}\Compute.png 249 | ${PROJECT_ROOT}\dspCMap.m 250 | ${PROJECT_ROOT}\dspCMap2T.m 251 | ${PROJECT_ROOT}\Edit.png 252 | ${PROJECT_ROOT}\eeg_kMeans.m 253 | ${PROJECT_ROOT}\Excel.png 254 | ${PROJECT_ROOT}\Filter.png 255 | ${PROJECT_ROOT}\GetChannelPositionsFromLabels.m 256 | ${PROJECT_ROOT}\LoadSetFromExcelTemplate.m 257 | ${PROJECT_ROOT}\MakeResampleMatrices.m 258 | ${PROJECT_ROOT}\Minus.png 259 | ${PROJECT_ROOT}\MSTemplateEditor.mlapp 260 | ${PROJECT_ROOT}\MSTemplatesCarTool2eeglab.m 261 | ${PROJECT_ROOT}\mywaitbar.m 262 | ${PROJECT_ROOT}\NoFilter.png 263 | ${PROJECT_ROOT}\NormDim.m 264 | ${PROJECT_ROOT}\Open.jpg 265 | ${PROJECT_ROOT}\Planar2Sphere.m 266 | ${PROJECT_ROOT}\Plus.png 267 | ${PROJECT_ROOT}\ReadSXYZ.m 268 | ${PROJECT_ROOT}\rotate.m 269 | ${PROJECT_ROOT}\Save.png 270 | ${PROJECT_ROOT}\SaveAs.png 271 | ${PROJECT_ROOT}\SetXYZCoordinates.fig 272 | ${PROJECT_ROOT}\SetXYZCoordinates.m 273 | ${PROJECT_ROOT}\splint2.m 274 | ${PROJECT_ROOT}\Swap.png 275 | ${PROJECT_ROOT}\txt.png 276 | ${PROJECT_ROOT}\uipickfiles.m 277 | ${PROJECT_ROOT}\vararginmatch.m 278 | ${PROJECT_ROOT}\VAsph2cart.m 279 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\VAsph2cartStruct.m 280 | 281 | 282 | 283 | 284 | D:\PUK-TRC Dropbox\Thomas Koenig\Documents\MATLAB\MSWebApp 285 | 286 | 287 | 288 | C:\Program Files\MATLAB\R2023b 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | true 300 | 301 | 302 | 303 | 304 | true 305 | 306 | 307 | 308 | 309 | true 310 | 311 | 312 | 313 | 314 | true 315 | 316 | 317 | 318 | 319 | true 320 | 321 | 322 | 323 | 324 | true 325 | 326 | 327 | 328 | 329 | false 330 | false 331 | true 332 | false 333 | false 334 | false 335 | false 336 | false 337 | 10.0 338 | false 339 | true 340 | win64 341 | true 342 | 343 | 344 | -------------------------------------------------------------------------------- /GetChannelPositionsFromLabels.m: -------------------------------------------------------------------------------- 1 | function Montage = GetChannelPositionsFromLabels(Labels) 2 | 3 | ChanInfo(1) = struct('Name','Fp1','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 4 | ChanInfo(2) = struct('Name','Fpz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 5 | ChanInfo(3) = struct('Name','Fp2','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 6 | ChanInfo(4) = struct('Name','AF9','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 7 | ChanInfo(5) = struct('Name','AF7','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 8 | ChanInfo(6) = struct('Name','AF5','CoordsPhi',-60.00,'CoordsRadius',1.00,'CoordsTheta',-81.00); 9 | ChanInfo(7) = struct('Name','AF3','CoordsPhi',-68.00,'CoordsRadius',1.00,'CoordsTheta',-74.00); 10 | ChanInfo(8) = struct('Name','AF1','CoordsPhi',-79.00,'CoordsRadius',1.00,'CoordsTheta',-69.00); 11 | ChanInfo(9) = struct('Name','AFz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',67.00); 12 | ChanInfo(10) = struct('Name','AF2','CoordsPhi',79.00,'CoordsRadius',1.00,'CoordsTheta',69.00); 13 | ChanInfo(11) = struct('Name','AF4','CoordsPhi',68.00,'CoordsRadius',1.00,'CoordsTheta',74.00); 14 | ChanInfo(12) = struct('Name','AF6','CoordsPhi',60.00,'CoordsRadius',1.00,'CoordsTheta',81.00); 15 | ChanInfo(13) = struct('Name','AF8','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 16 | ChanInfo(14) = struct('Name','AF10','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 17 | ChanInfo(15) = struct('Name','F9','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 18 | ChanInfo(16) = struct('Name','F7','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 19 | ChanInfo(17) = struct('Name','F5','CoordsPhi',-41.00,'CoordsRadius',1.00,'CoordsTheta',-74.00); 20 | ChanInfo(18) = struct('Name','F3','CoordsPhi',-51.00,'CoordsRadius',1.00,'CoordsTheta',-60.00); 21 | ChanInfo(19) = struct('Name','F1','CoordsPhi',-68.00,'CoordsRadius',1.00,'CoordsTheta',-49.00); 22 | ChanInfo(20) = struct('Name','Fz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',45.00); 23 | ChanInfo(21) = struct('Name','F2','CoordsPhi',68.00,'CoordsRadius',1.00,'CoordsTheta',49.00); 24 | ChanInfo(22) = struct('Name','F4','CoordsPhi',51.00,'CoordsRadius',1.00,'CoordsTheta',60.00); 25 | ChanInfo(23) = struct('Name','F6','CoordsPhi',41.00,'CoordsRadius',1.00,'CoordsTheta',74.00); 26 | ChanInfo(24) = struct('Name','F8','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 27 | ChanInfo(25) = struct('Name','F10','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 28 | ChanInfo(26) = struct('Name','FT9','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 29 | ChanInfo(27) = struct('Name','FT7','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 30 | ChanInfo(28) = struct('Name','FC5','CoordsPhi',-21.00,'CoordsRadius',1.00,'CoordsTheta',-69.00); 31 | ChanInfo(29) = struct('Name','FC3','CoordsPhi',-29.00,'CoordsRadius',1.00,'CoordsTheta',-49.00); 32 | ChanInfo(30) = struct('Name','FC1','CoordsPhi',-46.00,'CoordsRadius',1.00,'CoordsTheta',-31.00); 33 | ChanInfo(31) = struct('Name','FCz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',23.00); 34 | ChanInfo(32) = struct('Name','FC2','CoordsPhi',46.00,'CoordsRadius',1.00,'CoordsTheta',31.00); 35 | ChanInfo(33) = struct('Name','FC4','CoordsPhi',29.00,'CoordsRadius',1.00,'CoordsTheta',49.00); 36 | ChanInfo(34) = struct('Name','FC6','CoordsPhi',21.00,'CoordsRadius',1.00,'CoordsTheta',69.00); 37 | ChanInfo(35) = struct('Name','FT8','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 38 | ChanInfo(36) = struct('Name','FT10','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 39 | ChanInfo(37) = struct('Name','T9','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-112.00); 40 | ChanInfo(38) = struct('Name','T7','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 41 | ChanInfo(39) = struct('Name','C5','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-68.00); 42 | ChanInfo(40) = struct('Name','C3','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-45.00); 43 | ChanInfo(41) = struct('Name','C1','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-23.00); 44 | ChanInfo(42) = struct('Name','Cz','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',0.00); 45 | ChanInfo(43) = struct('Name','C2','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',23.00); 46 | ChanInfo(44) = struct('Name','C4','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',45.00); 47 | ChanInfo(45) = struct('Name','C6','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',68.00); 48 | ChanInfo(46) = struct('Name','T8','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 49 | ChanInfo(47) = struct('Name','T10','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',112.00); 50 | ChanInfo(48) = struct('Name','TP9','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 51 | ChanInfo(49) = struct('Name','TP7','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 52 | ChanInfo(50) = struct('Name','CP5','CoordsPhi',21.00,'CoordsRadius',1.00,'CoordsTheta',-69.00); 53 | ChanInfo(51) = struct('Name','CP3','CoordsPhi',29.00,'CoordsRadius',1.00,'CoordsTheta',-49.00); 54 | ChanInfo(52) = struct('Name','CP1','CoordsPhi',46.00,'CoordsRadius',1.00,'CoordsTheta',-31.00); 55 | ChanInfo(53) = struct('Name','CPz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',22.00); 56 | ChanInfo(54) = struct('Name','CP2','CoordsPhi',-46.00,'CoordsRadius',1.00,'CoordsTheta',31.00); 57 | ChanInfo(55) = struct('Name','CP4','CoordsPhi',-29.00,'CoordsRadius',1.00,'CoordsTheta',49.00); 58 | ChanInfo(56) = struct('Name','CP6','CoordsPhi',-21.00,'CoordsRadius',1.00,'CoordsTheta',69.00); 59 | ChanInfo(57) = struct('Name','TP8','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 60 | ChanInfo(58) = struct('Name','TP10','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 61 | ChanInfo(59) = struct('Name','P9','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 62 | ChanInfo(60) = struct('Name','P7','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 63 | ChanInfo(61) = struct('Name','P5','CoordsPhi',41.00,'CoordsRadius',1.00,'CoordsTheta',-74.00); 64 | ChanInfo(62) = struct('Name','P3','CoordsPhi',51.00,'CoordsRadius',1.00,'CoordsTheta',-60.00); 65 | ChanInfo(63) = struct('Name','P1','CoordsPhi',68.00,'CoordsRadius',1.00,'CoordsTheta',-49.00); 66 | ChanInfo(64) = struct('Name','Pz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',45.00); 67 | ChanInfo(65) = struct('Name','P2','CoordsPhi',-68.00,'CoordsRadius',1.00,'CoordsTheta',49.00); 68 | ChanInfo(66) = struct('Name','P4','CoordsPhi',-51.00,'CoordsRadius',1.00,'CoordsTheta',60.00); 69 | ChanInfo(67) = struct('Name','P6','CoordsPhi',-41.00,'CoordsRadius',1.00,'CoordsTheta',74.00); 70 | ChanInfo(68) = struct('Name','P8','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 71 | ChanInfo(69) = struct('Name','P10','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 72 | ChanInfo(70) = struct('Name','PO9','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 73 | ChanInfo(71) = struct('Name','PO7','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 74 | ChanInfo(72) = struct('Name','PO5','CoordsPhi',60.00,'CoordsRadius',1.00,'CoordsTheta',-81.00); 75 | ChanInfo(73) = struct('Name','PO3','CoordsPhi',68.00,'CoordsRadius',1.00,'CoordsTheta',-74.00); 76 | ChanInfo(74) = struct('Name','PO1','CoordsPhi',79.00,'CoordsRadius',1.00,'CoordsTheta',-69.00); 77 | ChanInfo(75) = struct('Name','POz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',67.00); 78 | ChanInfo(76) = struct('Name','PO2','CoordsPhi',-79.00,'CoordsRadius',1.00,'CoordsTheta',69.00); 79 | ChanInfo(77) = struct('Name','PO4','CoordsPhi',-68.00,'CoordsRadius',1.00,'CoordsTheta',74.00); 80 | ChanInfo(78) = struct('Name','PO6','CoordsPhi',-60.00,'CoordsRadius',1.00,'CoordsTheta',81.00); 81 | ChanInfo(79) = struct('Name','PO8','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 82 | ChanInfo(80) = struct('Name','PO10','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 83 | ChanInfo(81) = struct('Name','O1','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 84 | ChanInfo(82) = struct('Name','Oz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 85 | ChanInfo(83) = struct('Name','O2','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 86 | ChanInfo(84) = struct('Name','I1','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',-112.00); 87 | ChanInfo(85) = struct('Name','O9','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',-112.00); 88 | ChanInfo(86) = struct('Name','Iz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',112.00); 89 | ChanInfo(87) = struct('Name','I2','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',112.00); 90 | ChanInfo(88) = struct('Name','O10','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',112.00); 91 | ChanInfo(89) = struct('Name','AFp9h','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 92 | ChanInfo(90) = struct('Name','AFp7h','CoordsPhi',-66.00,'CoordsRadius',1.00,'CoordsTheta',-88.00); 93 | ChanInfo(91) = struct('Name','AFp5h','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',-83.00); 94 | ChanInfo(92) = struct('Name','AFp3h','CoordsPhi',-79.00,'CoordsRadius',1.00,'CoordsTheta',-80.00); 95 | ChanInfo(93) = struct('Name','AFp1h','CoordsPhi',-86.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 96 | ChanInfo(94) = struct('Name','AFp2h','CoordsPhi',86.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 97 | ChanInfo(95) = struct('Name','AFp4h','CoordsPhi',79.00,'CoordsRadius',1.00,'CoordsTheta',80.00); 98 | ChanInfo(96) = struct('Name','AFp6h','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',83.00); 99 | ChanInfo(97) = struct('Name','AFp8h','CoordsPhi',66.00,'CoordsRadius',1.00,'CoordsTheta',88.00); 100 | ChanInfo(98) = struct('Name','AFp10h','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 101 | ChanInfo(99) = struct('Name','AFF9h','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 102 | ChanInfo(100) = struct('Name','AFF7h','CoordsPhi',-48.00,'CoordsRadius',1.00,'CoordsTheta',-83.00); 103 | ChanInfo(101) = struct('Name','AFF5h','CoordsPhi',-55.00,'CoordsRadius',1.00,'CoordsTheta',-72.00); 104 | ChanInfo(102) = struct('Name','AFF3h','CoordsPhi',-67.00,'CoordsRadius',1.00,'CoordsTheta',-62.00); 105 | ChanInfo(103) = struct('Name','AFF1h','CoordsPhi',-82.00,'CoordsRadius',1.00,'CoordsTheta',-57.00); 106 | ChanInfo(104) = struct('Name','AFF2h','CoordsPhi',82.00,'CoordsRadius',1.00,'CoordsTheta',57.00); 107 | ChanInfo(105) = struct('Name','AFF4h','CoordsPhi',67.00,'CoordsRadius',1.00,'CoordsTheta',62.00); 108 | ChanInfo(106) = struct('Name','AFF6h','CoordsPhi',55.00,'CoordsRadius',1.00,'CoordsTheta',72.00); 109 | ChanInfo(107) = struct('Name','AFF8h','CoordsPhi',48.00,'CoordsRadius',1.00,'CoordsTheta',83.00); 110 | ChanInfo(108) = struct('Name','AFF10h','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 111 | ChanInfo(109) = struct('Name','FFT9h','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 112 | ChanInfo(110) = struct('Name','FFT7h','CoordsPhi',-29.00,'CoordsRadius',1.00,'CoordsTheta',-81.00); 113 | ChanInfo(111) = struct('Name','FFC5h','CoordsPhi',-35.00,'CoordsRadius',1.00,'CoordsTheta',-62.00); 114 | ChanInfo(112) = struct('Name','FFC3h','CoordsPhi',-48.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 115 | ChanInfo(113) = struct('Name','FFC1h','CoordsPhi',-73.00,'CoordsRadius',1.00,'CoordsTheta',-35.00); 116 | ChanInfo(114) = struct('Name','FFC2h','CoordsPhi',73.00,'CoordsRadius',1.00,'CoordsTheta',35.00); 117 | ChanInfo(115) = struct('Name','FFC4h','CoordsPhi',48.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 118 | ChanInfo(116) = struct('Name','FFC6h','CoordsPhi',35.00,'CoordsRadius',1.00,'CoordsTheta',62.00); 119 | ChanInfo(117) = struct('Name','FFT8h','CoordsPhi',29.00,'CoordsRadius',1.00,'CoordsTheta',81.00); 120 | ChanInfo(118) = struct('Name','FFT10h','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 121 | ChanInfo(119) = struct('Name','FTT9h','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 122 | ChanInfo(120) = struct('Name','FTT7h','CoordsPhi',-10.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 123 | ChanInfo(121) = struct('Name','FCC5h','CoordsPhi',-12.00,'CoordsRadius',1.00,'CoordsTheta',-57.00); 124 | ChanInfo(122) = struct('Name','FCC3h','CoordsPhi',-19.00,'CoordsRadius',1.00,'CoordsTheta',-35.00); 125 | ChanInfo(123) = struct('Name','FCC1h','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',-16.00); 126 | ChanInfo(124) = struct('Name','FCC2h','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',16.00); 127 | ChanInfo(125) = struct('Name','FCC4h','CoordsPhi',19.00,'CoordsRadius',1.00,'CoordsTheta',35.00); 128 | ChanInfo(126) = struct('Name','FCC6h','CoordsPhi',12.00,'CoordsRadius',1.00,'CoordsTheta',57.00); 129 | ChanInfo(127) = struct('Name','FTT8h','CoordsPhi',10.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 130 | ChanInfo(128) = struct('Name','FTT10h','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 131 | ChanInfo(129) = struct('Name','TTP9h','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 132 | ChanInfo(130) = struct('Name','TTP7h','CoordsPhi',10.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 133 | ChanInfo(131) = struct('Name','CCP5h','CoordsPhi',12.00,'CoordsRadius',1.00,'CoordsTheta',-57.00); 134 | ChanInfo(132) = struct('Name','CCP3h','CoordsPhi',19.00,'CoordsRadius',1.00,'CoordsTheta',-35.00); 135 | ChanInfo(133) = struct('Name','CCP1h','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',-16.00); 136 | ChanInfo(134) = struct('Name','CCP2h','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',16.00); 137 | ChanInfo(135) = struct('Name','CCP4h','CoordsPhi',-19.00,'CoordsRadius',1.00,'CoordsTheta',35.00); 138 | ChanInfo(136) = struct('Name','CCP6h','CoordsPhi',-12.00,'CoordsRadius',1.00,'CoordsTheta',57.00); 139 | ChanInfo(137) = struct('Name','TTP8h','CoordsPhi',-10.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 140 | ChanInfo(138) = struct('Name','TTP10h','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 141 | ChanInfo(139) = struct('Name','TPP9h','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 142 | ChanInfo(140) = struct('Name','TPP7h','CoordsPhi',29.00,'CoordsRadius',1.00,'CoordsTheta',-81.00); 143 | ChanInfo(141) = struct('Name','CPP5h','CoordsPhi',35.00,'CoordsRadius',1.00,'CoordsTheta',-62.00); 144 | ChanInfo(142) = struct('Name','CPP3h','CoordsPhi',48.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 145 | ChanInfo(143) = struct('Name','CPP1h','CoordsPhi',73.00,'CoordsRadius',1.00,'CoordsTheta',-35.00); 146 | ChanInfo(144) = struct('Name','CPP2h','CoordsPhi',-73.00,'CoordsRadius',1.00,'CoordsTheta',35.00); 147 | ChanInfo(145) = struct('Name','CPP4h','CoordsPhi',-48.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 148 | ChanInfo(146) = struct('Name','CPP6h','CoordsPhi',-35.00,'CoordsRadius',1.00,'CoordsTheta',62.00); 149 | ChanInfo(147) = struct('Name','TPP8h','CoordsPhi',-29.00,'CoordsRadius',1.00,'CoordsTheta',81.00); 150 | ChanInfo(148) = struct('Name','TPP10h','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 151 | ChanInfo(149) = struct('Name','PPO9h','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 152 | ChanInfo(150) = struct('Name','PPO7h','CoordsPhi',48.00,'CoordsRadius',1.00,'CoordsTheta',-83.00); 153 | ChanInfo(151) = struct('Name','PPO5h','CoordsPhi',55.00,'CoordsRadius',1.00,'CoordsTheta',-72.00); 154 | ChanInfo(152) = struct('Name','PPO3h','CoordsPhi',67.00,'CoordsRadius',1.00,'CoordsTheta',-62.00); 155 | ChanInfo(153) = struct('Name','PPO1h','CoordsPhi',82.00,'CoordsRadius',1.00,'CoordsTheta',-57.00); 156 | ChanInfo(154) = struct('Name','PPO2h','CoordsPhi',-82.00,'CoordsRadius',1.00,'CoordsTheta',57.00); 157 | ChanInfo(155) = struct('Name','PPO4h','CoordsPhi',-67.00,'CoordsRadius',1.00,'CoordsTheta',62.00); 158 | ChanInfo(156) = struct('Name','PPO6h','CoordsPhi',-55.00,'CoordsRadius',1.00,'CoordsTheta',72.00); 159 | ChanInfo(157) = struct('Name','PPO8h','CoordsPhi',-48.00,'CoordsRadius',1.00,'CoordsTheta',83.00); 160 | ChanInfo(158) = struct('Name','PPO10h','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 161 | ChanInfo(159) = struct('Name','POO9h','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 162 | ChanInfo(160) = struct('Name','POO7h','CoordsPhi',66.00,'CoordsRadius',1.00,'CoordsTheta',-88.00); 163 | ChanInfo(161) = struct('Name','POO5h','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',-83.00); 164 | ChanInfo(162) = struct('Name','POO3h','CoordsPhi',79.00,'CoordsRadius',1.00,'CoordsTheta',-80.00); 165 | ChanInfo(163) = struct('Name','POO1h','CoordsPhi',86.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 166 | ChanInfo(164) = struct('Name','POO2h','CoordsPhi',-86.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 167 | ChanInfo(165) = struct('Name','POO4h','CoordsPhi',-79.00,'CoordsRadius',1.00,'CoordsTheta',80.00); 168 | ChanInfo(166) = struct('Name','POO6h','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',83.00); 169 | ChanInfo(167) = struct('Name','POO8h','CoordsPhi',-66.00,'CoordsRadius',1.00,'CoordsTheta',88.00); 170 | ChanInfo(168) = struct('Name','POO10h','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 171 | ChanInfo(169) = struct('Name','OI1h','CoordsPhi',81.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 172 | ChanInfo(170) = struct('Name','OI2h','CoordsPhi',-81.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 173 | ChanInfo(171) = struct('Name','Fp1h','CoordsPhi',-81.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 174 | ChanInfo(172) = struct('Name','Fp2h','CoordsPhi',81.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 175 | ChanInfo(173) = struct('Name','AF9h','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 176 | ChanInfo(174) = struct('Name','AF7h','CoordsPhi',-57.00,'CoordsRadius',1.00,'CoordsTheta',-85.00); 177 | ChanInfo(175) = struct('Name','AF5h','CoordsPhi',-64.00,'CoordsRadius',1.00,'CoordsTheta',-77.00); 178 | ChanInfo(176) = struct('Name','AF3h','CoordsPhi',-73.00,'CoordsRadius',1.00,'CoordsTheta',-71.00); 179 | ChanInfo(177) = struct('Name','AF1h','CoordsPhi',-84.00,'CoordsRadius',1.00,'CoordsTheta',-68.00); 180 | ChanInfo(178) = struct('Name','AF2h','CoordsPhi',84.00,'CoordsRadius',1.00,'CoordsTheta',68.00); 181 | ChanInfo(179) = struct('Name','AF4h','CoordsPhi',73.00,'CoordsRadius',1.00,'CoordsTheta',71.00); 182 | ChanInfo(180) = struct('Name','AF6h','CoordsPhi',64.00,'CoordsRadius',1.00,'CoordsTheta',77.00); 183 | ChanInfo(181) = struct('Name','AF8h','CoordsPhi',57.00,'CoordsRadius',1.00,'CoordsTheta',85.00); 184 | ChanInfo(182) = struct('Name','AF10h','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 185 | ChanInfo(183) = struct('Name','F9h','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 186 | ChanInfo(184) = struct('Name','F7h','CoordsPhi',-38.00,'CoordsRadius',1.00,'CoordsTheta',-82.00); 187 | ChanInfo(185) = struct('Name','F5h','CoordsPhi',-46.00,'CoordsRadius',1.00,'CoordsTheta',-66.00); 188 | ChanInfo(186) = struct('Name','F3h','CoordsPhi',-58.00,'CoordsRadius',1.00,'CoordsTheta',-54.00); 189 | ChanInfo(187) = struct('Name','F1h','CoordsPhi',-78.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 190 | ChanInfo(188) = struct('Name','F2h','CoordsPhi',78.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 191 | ChanInfo(189) = struct('Name','F4h','CoordsPhi',58.00,'CoordsRadius',1.00,'CoordsTheta',54.00); 192 | ChanInfo(190) = struct('Name','F6h','CoordsPhi',46.00,'CoordsRadius',1.00,'CoordsTheta',66.00); 193 | ChanInfo(191) = struct('Name','F8h','CoordsPhi',38.00,'CoordsRadius',1.00,'CoordsTheta',82.00); 194 | ChanInfo(192) = struct('Name','F10h','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 195 | ChanInfo(193) = struct('Name','FT9h','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 196 | ChanInfo(194) = struct('Name','FT7h','CoordsPhi',-19.00,'CoordsRadius',1.00,'CoordsTheta',-80.00); 197 | ChanInfo(195) = struct('Name','FC5h','CoordsPhi',-24.00,'CoordsRadius',1.00,'CoordsTheta',-59.00); 198 | ChanInfo(196) = struct('Name','FC3h','CoordsPhi',-35.00,'CoordsRadius',1.00,'CoordsTheta',-40.00); 199 | ChanInfo(197) = struct('Name','FC1h','CoordsPhi',-64.00,'CoordsRadius',1.00,'CoordsTheta',-25.00); 200 | ChanInfo(198) = struct('Name','FC2h','CoordsPhi',64.00,'CoordsRadius',1.00,'CoordsTheta',25.00); 201 | ChanInfo(199) = struct('Name','FC4h','CoordsPhi',35.00,'CoordsRadius',1.00,'CoordsTheta',40.00); 202 | ChanInfo(200) = struct('Name','FC6h','CoordsPhi',24.00,'CoordsRadius',1.00,'CoordsTheta',59.00); 203 | ChanInfo(201) = struct('Name','FT8h','CoordsPhi',19.00,'CoordsRadius',1.00,'CoordsTheta',80.00); 204 | ChanInfo(202) = struct('Name','FT10h','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 205 | ChanInfo(203) = struct('Name','T9h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 206 | ChanInfo(204) = struct('Name','T7h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 207 | ChanInfo(205) = struct('Name','C5h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-56.00); 208 | ChanInfo(206) = struct('Name','C3h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-34.00); 209 | ChanInfo(207) = struct('Name','C1h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-11.00); 210 | ChanInfo(208) = struct('Name','C2h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',11.00); 211 | ChanInfo(209) = struct('Name','C4h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',34.00); 212 | ChanInfo(210) = struct('Name','C6h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',56.00); 213 | ChanInfo(211) = struct('Name','T8h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 214 | ChanInfo(212) = struct('Name','T10h','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 215 | ChanInfo(213) = struct('Name','TP9h','CoordsPhi',18.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 216 | ChanInfo(214) = struct('Name','TP7h','CoordsPhi',19.00,'CoordsRadius',1.00,'CoordsTheta',-80.00); 217 | ChanInfo(215) = struct('Name','CP5h','CoordsPhi',24.00,'CoordsRadius',1.00,'CoordsTheta',-59.00); 218 | ChanInfo(216) = struct('Name','CP3h','CoordsPhi',35.00,'CoordsRadius',1.00,'CoordsTheta',-40.00); 219 | ChanInfo(217) = struct('Name','CP1h','CoordsPhi',64.00,'CoordsRadius',1.00,'CoordsTheta',-25.00); 220 | ChanInfo(218) = struct('Name','CP2h','CoordsPhi',-64.00,'CoordsRadius',1.00,'CoordsTheta',25.00); 221 | ChanInfo(219) = struct('Name','CP4h','CoordsPhi',-35.00,'CoordsRadius',1.00,'CoordsTheta',40.00); 222 | ChanInfo(220) = struct('Name','CP6h','CoordsPhi',-24.00,'CoordsRadius',1.00,'CoordsTheta',59.00); 223 | ChanInfo(221) = struct('Name','TP8h','CoordsPhi',-19.00,'CoordsRadius',1.00,'CoordsTheta',80.00); 224 | ChanInfo(222) = struct('Name','TP10h','CoordsPhi',-18.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 225 | ChanInfo(223) = struct('Name','P9h','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 226 | ChanInfo(224) = struct('Name','P7h','CoordsPhi',38.00,'CoordsRadius',1.00,'CoordsTheta',-82.00); 227 | ChanInfo(225) = struct('Name','P5h','CoordsPhi',46.00,'CoordsRadius',1.00,'CoordsTheta',-66.00); 228 | ChanInfo(226) = struct('Name','P3h','CoordsPhi',58.00,'CoordsRadius',1.00,'CoordsTheta',-54.00); 229 | ChanInfo(227) = struct('Name','P1h','CoordsPhi',78.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 230 | ChanInfo(228) = struct('Name','P2h','CoordsPhi',-78.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 231 | ChanInfo(229) = struct('Name','P4h','CoordsPhi',-58.00,'CoordsRadius',1.00,'CoordsTheta',54.00); 232 | ChanInfo(230) = struct('Name','P6h','CoordsPhi',-46.00,'CoordsRadius',1.00,'CoordsTheta',66.00); 233 | ChanInfo(231) = struct('Name','P8h','CoordsPhi',-38.00,'CoordsRadius',1.00,'CoordsTheta',82.00); 234 | ChanInfo(232) = struct('Name','P10h','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 235 | ChanInfo(233) = struct('Name','PO9h','CoordsPhi',54.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 236 | ChanInfo(234) = struct('Name','PO7h','CoordsPhi',57.00,'CoordsRadius',1.00,'CoordsTheta',-85.00); 237 | ChanInfo(235) = struct('Name','PO5h','CoordsPhi',64.00,'CoordsRadius',1.00,'CoordsTheta',-77.00); 238 | ChanInfo(236) = struct('Name','PO3h','CoordsPhi',73.00,'CoordsRadius',1.00,'CoordsTheta',-71.00); 239 | ChanInfo(237) = struct('Name','PO1h','CoordsPhi',84.00,'CoordsRadius',1.00,'CoordsTheta',-68.00); 240 | ChanInfo(238) = struct('Name','PO2h','CoordsPhi',-84.00,'CoordsRadius',1.00,'CoordsTheta',68.00); 241 | ChanInfo(239) = struct('Name','PO4h','CoordsPhi',-73.00,'CoordsRadius',1.00,'CoordsTheta',71.00); 242 | ChanInfo(240) = struct('Name','PO6h','CoordsPhi',-64.00,'CoordsRadius',1.00,'CoordsTheta',77.00); 243 | ChanInfo(241) = struct('Name','PO8h','CoordsPhi',-57.00,'CoordsRadius',1.00,'CoordsTheta',85.00); 244 | ChanInfo(242) = struct('Name','PO10h','CoordsPhi',-54.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 245 | ChanInfo(243) = struct('Name','O1h','CoordsPhi',81.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 246 | ChanInfo(244) = struct('Name','O2h','CoordsPhi',-81.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 247 | ChanInfo(245) = struct('Name','I1h','CoordsPhi',81.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 248 | ChanInfo(246) = struct('Name','I2h','CoordsPhi',-81.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 249 | ChanInfo(247) = struct('Name','AFp9','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 250 | ChanInfo(248) = struct('Name','AFp7','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 251 | ChanInfo(249) = struct('Name','AFp5','CoordsPhi',-69.00,'CoordsRadius',1.00,'CoordsTheta',-85.00); 252 | ChanInfo(250) = struct('Name','AFp3','CoordsPhi',-75.00,'CoordsRadius',1.00,'CoordsTheta',-82.00); 253 | ChanInfo(251) = struct('Name','AFp1','CoordsPhi',-82.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 254 | ChanInfo(252) = struct('Name','AFpz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 255 | ChanInfo(253) = struct('Name','AFp2','CoordsPhi',82.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 256 | ChanInfo(254) = struct('Name','AFp4','CoordsPhi',75.00,'CoordsRadius',1.00,'CoordsTheta',82.00); 257 | ChanInfo(255) = struct('Name','AFp6','CoordsPhi',69.00,'CoordsRadius',1.00,'CoordsTheta',85.00); 258 | ChanInfo(256) = struct('Name','AFp8','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 259 | ChanInfo(257) = struct('Name','AFp10','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 260 | ChanInfo(258) = struct('Name','AFF9','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 261 | ChanInfo(259) = struct('Name','AFF7','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 262 | ChanInfo(260) = struct('Name','AFF5','CoordsPhi',-51.00,'CoordsRadius',1.00,'CoordsTheta',-77.00); 263 | ChanInfo(261) = struct('Name','AFF3','CoordsPhi',-60.00,'CoordsRadius',1.00,'CoordsTheta',-66.00); 264 | ChanInfo(262) = struct('Name','AFF1','CoordsPhi',-74.00,'CoordsRadius',1.00,'CoordsTheta',-59.00); 265 | ChanInfo(263) = struct('Name','AFFz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',56.00); 266 | ChanInfo(264) = struct('Name','AFF2','CoordsPhi',74.00,'CoordsRadius',1.00,'CoordsTheta',59.00); 267 | ChanInfo(265) = struct('Name','AFF4','CoordsPhi',60.00,'CoordsRadius',1.00,'CoordsTheta',66.00); 268 | ChanInfo(266) = struct('Name','AFF6','CoordsPhi',51.00,'CoordsRadius',1.00,'CoordsTheta',77.00); 269 | ChanInfo(267) = struct('Name','AFF8','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 270 | ChanInfo(268) = struct('Name','AFF10','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 271 | ChanInfo(269) = struct('Name','FFT9','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 272 | ChanInfo(270) = struct('Name','FFT7','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 273 | ChanInfo(271) = struct('Name','FFC5','CoordsPhi',-31.00,'CoordsRadius',1.00,'CoordsTheta',-71.00); 274 | ChanInfo(272) = struct('Name','FFC3','CoordsPhi',-41.00,'CoordsRadius',1.00,'CoordsTheta',-54.00); 275 | ChanInfo(273) = struct('Name','FFC1','CoordsPhi',-59.00,'CoordsRadius',1.00,'CoordsTheta',-40.00); 276 | ChanInfo(274) = struct('Name','FFCz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',34.00); 277 | ChanInfo(275) = struct('Name','FFC2','CoordsPhi',59.00,'CoordsRadius',1.00,'CoordsTheta',40.00); 278 | ChanInfo(276) = struct('Name','FFC4','CoordsPhi',41.00,'CoordsRadius',1.00,'CoordsTheta',54.00); 279 | ChanInfo(277) = struct('Name','FFC6','CoordsPhi',31.00,'CoordsRadius',1.00,'CoordsTheta',71.00); 280 | ChanInfo(278) = struct('Name','FFT8','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 281 | ChanInfo(279) = struct('Name','FFT10','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 282 | ChanInfo(280) = struct('Name','FTT9','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 283 | ChanInfo(281) = struct('Name','FTT7','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 284 | ChanInfo(282) = struct('Name','FCC5','CoordsPhi',-11.00,'CoordsRadius',1.00,'CoordsTheta',-68.00); 285 | ChanInfo(283) = struct('Name','FCC3','CoordsPhi',-15.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 286 | ChanInfo(284) = struct('Name','FCC1','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',-25.00); 287 | ChanInfo(285) = struct('Name','FCCz','CoordsPhi',90.00,'CoordsRadius',1.00,'CoordsTheta',11.00); 288 | ChanInfo(286) = struct('Name','FCC2','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',25.00); 289 | ChanInfo(287) = struct('Name','FCC4','CoordsPhi',15.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 290 | ChanInfo(288) = struct('Name','FCC6','CoordsPhi',11.00,'CoordsRadius',1.00,'CoordsTheta',68.00); 291 | ChanInfo(289) = struct('Name','FTT8','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 292 | ChanInfo(290) = struct('Name','FTT10','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 293 | ChanInfo(291) = struct('Name','TTP9','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 294 | ChanInfo(292) = struct('Name','TTP7','CoordsPhi',9.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 295 | ChanInfo(293) = struct('Name','CCP5','CoordsPhi',11.00,'CoordsRadius',1.00,'CoordsTheta',-68.00); 296 | ChanInfo(294) = struct('Name','CCP3','CoordsPhi',15.00,'CoordsRadius',1.00,'CoordsTheta',-46.00); 297 | ChanInfo(295) = struct('Name','CCP1','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',-25.00); 298 | ChanInfo(296) = struct('Name','CCPz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',11.00); 299 | ChanInfo(297) = struct('Name','CCP2','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',25.00); 300 | ChanInfo(298) = struct('Name','CCP4','CoordsPhi',-15.00,'CoordsRadius',1.00,'CoordsTheta',46.00); 301 | ChanInfo(299) = struct('Name','CCP6','CoordsPhi',-11.00,'CoordsRadius',1.00,'CoordsTheta',68.00); 302 | ChanInfo(300) = struct('Name','TTP8','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 303 | ChanInfo(301) = struct('Name','TTP10','CoordsPhi',-9.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 304 | ChanInfo(302) = struct('Name','TPP9','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 305 | ChanInfo(303) = struct('Name','TPP7','CoordsPhi',27.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 306 | ChanInfo(304) = struct('Name','CPP5','CoordsPhi',31.00,'CoordsRadius',1.00,'CoordsTheta',-71.00); 307 | ChanInfo(305) = struct('Name','CPP3','CoordsPhi',41.00,'CoordsRadius',1.00,'CoordsTheta',-54.00); 308 | ChanInfo(306) = struct('Name','CPP1','CoordsPhi',59.00,'CoordsRadius',1.00,'CoordsTheta',-40.00); 309 | ChanInfo(307) = struct('Name','CPPz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',34.00); 310 | ChanInfo(308) = struct('Name','CPP2','CoordsPhi',-59.00,'CoordsRadius',1.00,'CoordsTheta',40.00); 311 | ChanInfo(309) = struct('Name','CPP4','CoordsPhi',-41.00,'CoordsRadius',1.00,'CoordsTheta',54.00); 312 | ChanInfo(310) = struct('Name','CPP6','CoordsPhi',-31.00,'CoordsRadius',1.00,'CoordsTheta',71.00); 313 | ChanInfo(311) = struct('Name','TPP8','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 314 | ChanInfo(312) = struct('Name','TPP10','CoordsPhi',-27.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 315 | ChanInfo(313) = struct('Name','PPO9','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',-113.00); 316 | ChanInfo(314) = struct('Name','PPO7','CoordsPhi',45.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 317 | ChanInfo(315) = struct('Name','PPO5','CoordsPhi',51.00,'CoordsRadius',1.00,'CoordsTheta',-77.00); 318 | ChanInfo(316) = struct('Name','PPO3','CoordsPhi',60.00,'CoordsRadius',1.00,'CoordsTheta',-66.00); 319 | ChanInfo(317) = struct('Name','PPO1','CoordsPhi',74.00,'CoordsRadius',1.00,'CoordsTheta',-59.00); 320 | ChanInfo(318) = struct('Name','PPOz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',56.00); 321 | ChanInfo(319) = struct('Name','PPO2','CoordsPhi',-74.00,'CoordsRadius',1.00,'CoordsTheta',59.00); 322 | ChanInfo(320) = struct('Name','PPO4','CoordsPhi',-60.00,'CoordsRadius',1.00,'CoordsTheta',66.00); 323 | ChanInfo(321) = struct('Name','PPO6','CoordsPhi',-51.00,'CoordsRadius',1.00,'CoordsTheta',77.00); 324 | ChanInfo(322) = struct('Name','PPO8','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 325 | ChanInfo(323) = struct('Name','PPO10','CoordsPhi',-45.00,'CoordsRadius',1.00,'CoordsTheta',113.00); 326 | ChanInfo(324) = struct('Name','POO9','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',-112.00); 327 | ChanInfo(325) = struct('Name','POO7','CoordsPhi',63.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 328 | ChanInfo(326) = struct('Name','POO5','CoordsPhi',69.00,'CoordsRadius',1.00,'CoordsTheta',-85.00); 329 | ChanInfo(327) = struct('Name','POO3','CoordsPhi',75.00,'CoordsRadius',1.00,'CoordsTheta',-82.00); 330 | ChanInfo(328) = struct('Name','POO1','CoordsPhi',82.00,'CoordsRadius',1.00,'CoordsTheta',-79.00); 331 | ChanInfo(329) = struct('Name','POOz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 332 | ChanInfo(330) = struct('Name','POO2','CoordsPhi',-82.00,'CoordsRadius',1.00,'CoordsTheta',79.00); 333 | ChanInfo(331) = struct('Name','POO4','CoordsPhi',-75.00,'CoordsRadius',1.00,'CoordsTheta',82.00); 334 | ChanInfo(332) = struct('Name','POO6','CoordsPhi',-69.00,'CoordsRadius',1.00,'CoordsTheta',85.00); 335 | ChanInfo(333) = struct('Name','POO8','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 336 | ChanInfo(334) = struct('Name','POO10','CoordsPhi',-63.00,'CoordsRadius',1.00,'CoordsTheta',112.00); 337 | ChanInfo(335) = struct('Name','OI1','CoordsPhi',72.00,'CoordsRadius',1.00,'CoordsTheta',-101.00); 338 | ChanInfo(336) = struct('Name','OIz','CoordsPhi',-90.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 339 | ChanInfo(337) = struct('Name','OI2','CoordsPhi',-72.00,'CoordsRadius',1.00,'CoordsTheta',101.00); 340 | ChanInfo(338) = struct('Name','T3','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 341 | ChanInfo(339) = struct('Name','T5','CoordsPhi',36.00,'CoordsRadius',1.00,'CoordsTheta',-90.00); 342 | ChanInfo(340) = struct('Name','T4','CoordsPhi',0.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 343 | ChanInfo(341) = struct('Name','T6','CoordsPhi',-36.00,'CoordsRadius',1.00,'CoordsTheta',90.00); 344 | 345 | AllLabels = {ChanInfo.Name}; 346 | 347 | EmptyChanInfo = struct('Name','','CoordsPhi',0,'CoordsRadius',0,'CoordsTheta',0); 348 | 349 | for c = 1:numel(Labels) 350 | idx = find(strcmpi(AllLabels,Labels(c))); 351 | if numel(idx) ~= 1 352 | warning(['Electrode ' Labels{c} ' without known positions']); 353 | Montage(c) = EmptyChanInfo; %#ok<*AGROW> 354 | else 355 | Montage(c) = ChanInfo(idx); 356 | end 357 | end 358 | --------------------------------------------------------------------------------