From ugobnunes at hotmail.com Sat Apr 1 23:33:41 2023 From: ugobnunes at hotmail.com (Ugo Bruzadin Nunes) Date: Sat, 1 Apr 2023 21:33:41 +0000 Subject: [FieldTrip] Headmodel orientation eloreta Message-ID: Dear fieldtrip community, I’m using some of eeglab’s dipfit settings to source-localize frequency activity, but this is mainly a fieldtrip issue. I hope anyone can help me and I appreciate any advice. I have two issues and one question. 1. When I plot the source localization, the orientation is 90 degrees wrong. When using dipfit in eeglab, the activity is correctly localized; but after doing all the dipfit processes – altered to plot frequency instead of component – frontal activity is being plot in the right ear. I thought something was wrong, so I artificially increased the activity at channel 12 (the anterior-most channel in my channel model), and the activity is coming from the ear in the eloreta instead. I can’t figure out where the rotation is incorrect and how I should approach the solution, since in EEGLAB the channels are correctly plotted. 2. For some reason, fieldtrip won’t accept the atlas. The error says my axis are 10mm in diameter, and the atlas is 150mm in each direction. I’m reading the ROI_MNI_V4 atlas in. Do I have to interpolate it? 3. I am not sure the following code is localizing and plotting the correct frequencies. I don’t think it’s working, but I haven’t tested individual frequencies yet since I haven’t fixed the headmodel orientation issue. Below is my code! Any feedback is welcome. Thank you so much in advance, Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Assistant Professor, Psychology Webster University Script/Code: EEG = pop_dipfit_settings( EEG, 'hdmfile',... 'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_vol.mat','coordformat','MNI','mrifile',... 'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_mri.mat','chanfile',... ['C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\elec\\standard_1005.elc ' ],... 'coord_transform',... [0.05476 -17.3653 -8.1318 0.075502 0.0031836 -1.5696 11.7138 12.7933 12.213] ,'chansel',[1:EEG.nbchan] ); atlas = ft_read_atlas('ROI_MNI_V4.nii'); %% compute spectral params (only need to be done once to get the right structures) EEGdata = eeglab2fieldtrip(EEG, 'preprocessing', 'none'); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 10; cfg.foilim = range; cfg.pad = 'nextpow2'; cfg.gpu = 'yes'; fftdata = ft_freqanalysis(cfg, EEGdata); if ~isfield(EEG,'lor') EEG.lor = struct(); end EEG.fftdata = fftdata; %% read headmodel p = fileparts(which('eeglab')); if ~isfield(EEG.lor,'HM') headmodel = load('-mat', EEG.dipfit.hdmfile); headmodel = headmodel.vol; EEG.lor.HM = headmodel; else headmodel = EEG.lor.HM; end cfg = []; cfg.elec = fftdata.elec; cfg.headmodel = headmodel; cfg.reducerank = 2; cfg.grid.resolution = 10; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'mm'; cfg.channel = { 'all' }; cfg.parallel = 'yes'; cfg.solver = 'cg'; [grid] = ft_prepare_leadfield(cfg); EEG.lor.grid = grid; mri = load('-mat', EEG.dipfit.mrifile); mri = ft_volumereslice([], mri.mri); EEG.lor.mri = mri; %% loops per frequency then plots counter = 0; numfreq = size(frequencies,2); EEGlor = EEG; vol = load('-mat', EEG.dipfit.hdmfile); for i = 1:numfreq atlas = ft_read_atlas('ROI_MNI_V4.nii'); freq = frequencies(i); cfg = struct(g.ft_sourceanalysis_params{:}); cfg.frequency = freq; cfg.grid = grid; cfg.headmodel = headmodel; cfg.method = 'eloreta'; cfg.atlas = atlas; cfg.roi = atlas.tissuelabel; cfg.eloreta.projectnoise = 'yes'; cfg.eloreta.lambda = 5; cfg.gpu = 'yes'; sourcemodel = ft_sourceanalysis(cfg, fftdata); EEGlor.lor.cfg(numfreq) = cfg; EEGlor.lor.freq(numfreq) = fftdata; EEGlor.lor.source(numfreq) = sourcemodel; %% load MRI and INTERPOLATE cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourcemodel.oridimord = 'pos'; sourcemodel.momdimord = 'pos'; sourcemodel_int = ft_sourceinterpolate(cfg2, sourcemodel , mri); EEGlor.lor.source_int(numfreq) = sourcemodel_int; %% plot cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'pow'; ft_sourceplot(cfg2,sourcemodel_int); textsc(sprintf('eLoreta source localization of %d frequency power',freq), 'title'); % end Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Professor, Psychology Webster University Office Location: ISB room 316 Office Number: (314) 968-7677 Ugo at webster.edu Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Professor, Psychology Webster University Office Location: ISB room 316 Office Number: (314) 968-7677 Ugo at webster.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From frsantos at fpce.up.pt Mon Apr 3 10:58:21 2023 From: frsantos at fpce.up.pt (Fernando Ferreira Santos) Date: Mon, 3 Apr 2023 08:58:21 +0000 Subject: [FieldTrip] Porto EEG/ERP Summer School 2023 - 17-21 July Message-ID: <095badd5ec084cb495a0bc7ce15edec5@fpce.up.pt> Dear colleagues, The Laboratory of Neuropsychopsysiology (https://urldefense.com/v3/__https://www.fpce.up.pt/labpsi__;!!HJOPV4FYYWzcc1jazlU!_AcLt7fD6vSCFF9SlMFvTmerA7LBn-dkP2kT7dBUP9cPZp8gc9lS7OICDA6vjTDQWAbqBkbCBZIqjR4iTnrLobzu$ ) is pleased to announce the 2023 Cognitive and Affective Neurophysiology Summer School, which will take place on-site from 17-21 July 2023 (35h course). This summer school is focused on the application of Electroencephalography (EEG) and Event Related Potential (ERP) techniques to the study of cognitive and affective processes. The course is designed as an introduction to these techniques and does not require prior knowledge or experience with EEG/ERP. However, participants with some degree of experience have also considered the course helpful in past editions. Basic knowledge of statistics is expected (general understanding of statistical significance tests, correlation, ANOVA, regression). This year's program will include: 1) Introduction to the EEG/ERP techniques in Cognitive and Affective Neuroscience 2) Collecting EEG data and ERP Research Design 3) Electrophysiological signal processing 4) Statistical analysis of ERP data You can find more details in the summer school website: https://urldefense.com/v3/__https://sites.google.com/view/can-summerschool-porto/__;!!HJOPV4FYYWzcc1jazlU!_AcLt7fD6vSCFF9SlMFvTmerA7LBn-dkP2kT7dBUP9cPZp8gc9lS7OICDA6vjTDQWAbqBkbCBZIqjR4iTkkGl90j$ If you have any additional questions, please do not hesitate to contact us at labnpf at fpce.up.pt. (Apologies for cross-postings) Fernando Ferreira-Santos Professor Auxiliar | Assistant Professor Coordenador Lab. Neuropsicofisiologia | Coordinator Lab. Neuropsychophysiology Laboratório de Neuropsicofisiologia | Laboratory of Neuropsychophysiology Faculdade de Psicologia e de Ciências da Educação da Universidade do Porto Faculty of Psychology and Education Sciences - University of Porto Rua Alfredo Allen, 4200-135 Porto, Portugal https://urldefense.com/v3/__https://www.fpce.up.pt__;!!HJOPV4FYYWzcc1jazlU!_AcLt7fD6vSCFF9SlMFvTmerA7LBn-dkP2kT7dBUP9cPZp8gc9lS7OICDA6vjTDQWAbqBkbCBZIqjR4iTjVMAiOi$ | frsantos at fpce.up.pt | (+351) 22 607 97 00 (ext. 409) Lab: https://urldefense.com/v3/__https://www.fpce.up.pt/labpsi__;!!HJOPV4FYYWzcc1jazlU!_AcLt7fD6vSCFF9SlMFvTmerA7LBn-dkP2kT7dBUP9cPZp8gc9lS7OICDA6vjTDQWAbqBkbCBZIqjR4iTnrLobzu$ Personal: https://urldefense.com/v3/__http://ferreira-santos.eu__;!!HJOPV4FYYWzcc1jazlU!_AcLt7fD6vSCFF9SlMFvTmerA7LBn-dkP2kT7dBUP9cPZp8gc9lS7OICDA6vjTDQWAbqBkbCBZIqjR4iTvMq9fKC$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Olaf.Hauk at mrc-cbu.cam.ac.uk Tue Apr 4 15:54:03 2023 From: Olaf.Hauk at mrc-cbu.cam.ac.uk (Olaf Hauk) Date: Tue, 4 Apr 2023 13:54:03 +0000 Subject: [FieldTrip] COGNESTIC 2023 Message-ID: We are happy to announce the Cognitive Neuroimaging Skills Training In Cambridge (COGNESTIC) between 18-29 September 2023 at the MRC Cognition and Brain Sciences Unit. We will provide training in state-of-the-art methods for open neuroimaging analysis and related methods. Please visit https://urldefense.com/v3/__https://www.mrc-cbu.cam.ac.uk/cognestic-2023/__;!!HJOPV4FYYWzcc1jazlU!6hMsH6yXFWX6wTUQ7uuHq6Akb8L4Aa7d8AshNvIXH4xno5VoQ_Qb6P0_Py3qOA3t6IWEv0d8HQdqQzTsGmzirVK2haLduxsp$ for more information. The Cognitive Neuroimaging Skills Training In Cambridge (COGNESTIC) summer school will provide researchers with training in state-of-the-art methods for open neuroimaging analysis and related methods. We will use a variety of open-source software and data formats (such as NiPype, fMRIprep, MNE-Python, BIDS) to demonstrate and explain reproducible analysis pipelines for neuroimaging data. The sessions will provide practical demonstrations of these analysis pipelines, with opportunities for attendees to practice them hands-on. We will provide extensive online materials on the theoretical background of the methods in advance, e.g. in bespoke videos created by our tutors. Special guest lectures by principal investigators will showcase the application of neuroimaging methods in cognitive and clinical neuroscience. We will also offer tours of the CBU's lab facilities with an opportunity to discuss best practice in data acquisition. There will be ample time for attendees to interact with tutors and fellow attendees. The registration fee for COGNESTIC 2023 is £900. This will include lunches, refreshments and two social events, but not accommodation and dinners. Best wishes, Olaf et al. Olaf Hauk, PhD Senior Investigator Scientist MRC Cognition and Brain Sciences Unit University of Cambridge Phone: +44 1223 7 69490 Web: https://urldefense.com/v3/__https://www.neuroscience.cam.ac.uk/directory/profile.php?olafhauk__;!!HJOPV4FYYWzcc1jazlU!6hMsH6yXFWX6wTUQ7uuHq6Akb8L4Aa7d8AshNvIXH4xno5VoQ_Qb6P0_Py3qOA3t6IWEv0d8HQdqQzTsGmzirVK2hTp0FFMb$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From anuj.chavan3101 at gmail.com Tue Apr 4 22:57:12 2023 From: anuj.chavan3101 at gmail.com (Anuj Chavan) Date: Tue, 4 Apr 2023 13:57:12 -0700 Subject: [FieldTrip] Sensor to Source Conversion Message-ID: Dear Community, I have a source localization problem at hand. I have 64 EGI channel data (resting state, cleaned and preprocessed) (time series) and I am trying to localize it to 15 specific BESA locations(FL Frontal, left hemisphere FpM, FR, FM, CL, CM, CR, TPL, TAL,TAR,TPR, PM, PL, PR, OpM). I intend to obtain the time series at these said locations and use it for further research. I would appreciate any help including code snippets, pointers to functions or specific and detailed tutorials/guides I could follow and obtain the required time series. Thanks, Anuj -------------- next part -------------- An HTML attachment was scrubbed... URL: From mozulucan23 at ku.edu.tr Thu Apr 6 16:37:13 2023 From: mozulucan23 at ku.edu.tr (MAHMUT TAHA OZULUCAN) Date: Thu, 6 Apr 2023 17:37:13 +0300 Subject: [FieldTrip] Read Mri Message-ID: Hi, I am trying to use FT_READ_MRI function but this error keeps coming up. Not enough input arguments. Error in subs (line 67) elseif isa(f_unique_name, 'struct') I have transformed .DICOM files to .nii files because of the instructions of function. If you could help me I would really appreciate. Thank you for your time. Best Regards Taha -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Fri Apr 7 08:35:18 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 7 Apr 2023 06:35:18 +0000 Subject: [FieldTrip] Headmodel orientation eloreta In-Reply-To: References: Message-ID: <93123347-F798-45E9-AAEF-21F0C93FE77E@donders.ru.nl> Hi Ugo, On 1 Apr 2023, at 23:33, Ugo Bruzadin Nunes via fieldtrip > wrote: Dear fieldtrip community, I’m using some of eeglab’s dipfit settings to source-localize frequency activity, but this is mainly a fieldtrip issue. I hope anyone can help me and I appreciate any advice. I have two issues and one question. 1. When I plot the source localization, the orientation is 90 degrees wrong. When using dipfit in eeglab, the activity is correctly localized; but after doing all the dipfit processes – altered to plot frequency instead of component – frontal activity is being plot in the right ear. I thought something was wrong, so I artificially increased the activity at channel 12 (the anterior-most channel in my channel model), and the activity is coming from the ear in the eloreta instead. I can’t figure out where the rotation is incorrect and how I should approach the solution, since in EEGLAB the channels are correctly plotted. You need to check the coregistration between the anatomical image that you use for visualization/source reconstruction, and the electrodes. Also you need to check the coordinate system convention used for the description of the electrodes, volume conduction model, source model, anatomical image. There’s abundant information about this on the fieldtrip website, so please check it out there. 1. 2. For some reason, fieldtrip won’t accept the atlas. The error says my axis are 10mm in diameter, and the atlas is 150mm in each direction. I’m reading the ROI_MNI_V4 atlas in. Do I have to interpolate it? You don’t mention the error, just the textual feedback you get when you visualize a geometrical object. Also, it’s unclear what is meant with ‘fieldtrip won’t accept the atlas’. The ’some reason’ that you mention in your question/issue is at this point underspecified, so I doubt if anybody can say anything sensible about this. Also it is unclear for what reason you think that you need the atlas at this stage of your analysis. 1. 2. I am not sure the following code is localizing and plotting the correct frequencies. I don’t think it’s working, but I haven’t tested individual frequencies yet since I haven’t fixed the headmodel orientation issue. I agree that you should fix any upstream issue before you can move on to the next part. Good luck studying the online documentation. Jan-Mathijs Below is my code! Any feedback is welcome. Thank you so much in advance, Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Assistant Professor, Psychology Webster University Script/Code: EEG = pop_dipfit_settings( EEG, 'hdmfile',... 'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_vol.mat','coordformat','MNI','mrifile',... 'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_mri.mat','chanfile',... ['C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\elec\\standard_1005.elc ' ],... 'coord_transform',... [0.05476 -17.3653 -8.1318 0.075502 0.0031836 -1.5696 11.7138 12.7933 12.213] ,'chansel',[1:EEG.nbchan] ); atlas = ft_read_atlas('ROI_MNI_V4.nii'); %% compute spectral params (only need to be done once to get the right structures) EEGdata = eeglab2fieldtrip(EEG, 'preprocessing', 'none'); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 10; cfg.foilim = range; cfg.pad = 'nextpow2'; cfg.gpu = 'yes'; fftdata = ft_freqanalysis(cfg, EEGdata); if ~isfield(EEG,'lor') EEG.lor = struct(); end EEG.fftdata = fftdata; %% read headmodel p = fileparts(which('eeglab')); if ~isfield(EEG.lor,'HM') headmodel = load('-mat', EEG.dipfit.hdmfile); headmodel = headmodel.vol; EEG.lor.HM = headmodel; else headmodel = EEG.lor.HM; end cfg = []; cfg.elec = fftdata.elec; cfg.headmodel = headmodel; cfg.reducerank = 2; cfg.grid.resolution = 10; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'mm'; cfg.channel = { 'all' }; cfg.parallel = 'yes'; cfg.solver = 'cg'; [grid] = ft_prepare_leadfield(cfg); EEG.lor.grid = grid; mri = load('-mat', EEG.dipfit.mrifile); mri = ft_volumereslice([], mri.mri); EEG.lor.mri = mri; %% loops per frequency then plots counter = 0; numfreq = size(frequencies,2); EEGlor = EEG; vol = load('-mat', EEG.dipfit.hdmfile); for i = 1:numfreq atlas = ft_read_atlas('ROI_MNI_V4.nii'); freq = frequencies(i); cfg = struct(g.ft_sourceanalysis_params{:}); cfg.frequency = freq; cfg.grid = grid; cfg.headmodel = headmodel; cfg.method = 'eloreta'; cfg.atlas = atlas; cfg.roi = atlas.tissuelabel; cfg.eloreta.projectnoise = 'yes'; cfg.eloreta.lambda = 5; cfg.gpu = 'yes'; sourcemodel = ft_sourceanalysis(cfg, fftdata); EEGlor.lor.cfg(numfreq) = cfg; EEGlor.lor.freq(numfreq) = fftdata; EEGlor.lor.source(numfreq) = sourcemodel; %% load MRI and INTERPOLATE cfg = []; cfg.downsample = 2; cfg.parameter = 'avg.pow'; sourcemodel.oridimord = 'pos'; sourcemodel.momdimord = 'pos'; sourcemodel_int = ft_sourceinterpolate(cfg2, sourcemodel , mri); EEGlor.lor.source_int(numfreq) = sourcemodel_int; %% plot cfg = []; cfg.method = 'ortho'; cfg.funparameter = 'pow'; ft_sourceplot(cfg2,sourcemodel_int); textsc(sprintf('eLoreta source localization of %d frequency power',freq), 'title'); % end Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Professor, Psychology Webster University Office Location: ISB room 316 Office Number: (314) 968-7677 Ugo at webster.edu Ugo Ugo Bruzadin Nunes, Ph.D. Candidate (he/him) Visiting Professor, Psychology Webster University Office Location: ISB room 316 Office Number: (314) 968-7677 Ugo at webster.edu _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9p3MXx66w3sJ3BpeyB3zOOJ2rnhS9e86qfEPRENa5HarQKXxuGy3nqi93XHlcbveDNpFgmz9c-fVLPj_lof-45ijO_TyA5rwvhLYSg$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Fri Apr 7 08:50:41 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 7 Apr 2023 06:50:41 +0000 Subject: [FieldTrip] Read Mri In-Reply-To: References: Message-ID: <2D0AAE9E-2D49-49D8-9731-038F839FACB6@donders.ru.nl> Hi Taha, The error pops up, because you are doing something wrong. This is not a fieldtrip error, but a low level matlab error (https://urldefense.com/v3/__https://www.youtube.com/watch?v=ZpyvBm0WK34__;!!HJOPV4FYYWzcc1jazlU!_RXhADr8CgPCMNzZL--rsGpnBhkF-sUTxZHxVNQYagcGpootKojAtwE4Jz4ULWAFGTMdHz0WIyTvcfS_HLzjWpxAR4IcjDLcAezDLA$ ). Please use the normal strategy that one should use in case of errors: read and interpret the error message, use google/stack overflow, use the matlab debugger, and fix it. Good luck, Jan-Mathijs On 6 Apr 2023, at 16:37, MAHMUT TAHA OZULUCAN via fieldtrip > wrote: Hi, I am trying to use FT_READ_MRI function but this error keeps coming up. Not enough input arguments. Error in subs (line 67) elseif isa(f_unique_name, 'struct') I have transformed .DICOM files to .nii files because of the instructions of function. If you could help me I would really appreciate. Thank you for your time. Best Regards Taha _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5LRbhyto-iqyPIOnpj7wLkR_HKncz9JAs-XAK3P96duUHRR6hqXHizv6OPSt73Xvq3_FMzYOImaf4FZtqubInmESVgo2vCDYEyH3Ow$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Fri Apr 7 08:59:11 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Fri, 7 Apr 2023 06:59:11 +0000 Subject: [FieldTrip] Sensor to Source Conversion In-Reply-To: References: Message-ID: <9F20697B-4CF6-4D88-BA6E-1510B2507063@donders.ru.nl> Hi Anuj, I strongly urge you to study https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community/__;!!HJOPV4FYYWzcc1jazlU!8bbJ4UeEcBuQ7TqcAiGq8Y4lWsZfmP1hAD7knWnA_UC4CZJnF-aZ-1lJM__jKS2_zuClBcpX9vwJBSGoBoXkTHDmikj-Kuuaji7thQ$ and all the links therein, if you really appreciate input from us that goes beyond giving pointers to online documentation that you could have searched for yourself. This discussion forum is not meant as a kind of turbo-google or siri. I think you should search the fieldtrip documentation/tutorials/example scripts/frequently asked questions/published literature on EEG resting state source reconstruction to get inspired. Once you and your co-workers/supervisor etc. have settled on a certain analysis strategy, try it out, but still run into specific problems that may relate to concrete or conceptual fieldtrip functionality, then a well-formulated question may be escalated to this list. Good luck, Jan-Mathijs On 4 Apr 2023, at 22:57, Anuj Chavan via fieldtrip > wrote: Dear Community, I have a source localization problem at hand. I have 64 EGI channel data (resting state, cleaned and preprocessed) (time series) and I am trying to localize it to 15 specific BESA locations(FL Frontal, left hemisphere FpM, FR, FM, CL, CM, CR, TPL, TAL,TAR,TPR, PM, PL, PR, OpM). I intend to obtain the time series at these said locations and use it for further research. I would appreciate any help including code snippets, pointers to functions or specific and detailed tutorials/guides I could follow and obtain the required time series. Thanks, Anuj _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-uv4umUeWw4H27hG94YeA6UH9vrJAEIrOvv8iAypBhvCQmK3clFDIThsWeEIidOOELvJOcKA5e8v-9QlkiTwF0LikRDkwTuDg25w_Q$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From athanasios.vourvopoulos at tecnico.ulisboa.pt Mon Apr 10 10:24:37 2023 From: athanasios.vourvopoulos at tecnico.ulisboa.pt (Athanasios Vourvopoulos) Date: Mon, 10 Apr 2023 09:24:37 +0100 Subject: [FieldTrip] Special Issue in Advances in Principles, Methods and Applications of Brain-Computer Interaction (IF:3.847) Message-ID: <177f9d4c-0568-a127-9569-f4f8dec7a921@tecnico.ulisboa.pt> Special Issue: Advances in Principles, Methods and Applications of Brain-Computer Interaction URL: https://urldefense.com/v3/__https://www.mdpi.com/journal/sensors/special_issues/9NA0DXKG50__;!!HJOPV4FYYWzcc1jazlU!9qTmD4P2oR-kOEAvugJqdBaDGNl1wdHOzj_UTICCVerr4GhokVFkD_ZF5RKKmF4DoTmPzL5WKoavXl-JkcYa9UjJ0bS0hjJgIIpg6gvw$ Journal: Sensors (IF:3.847) Dear Colleagues, This Special Issue aims to collect papers on a broad spectrum of specific topics reflecting recent advances in the methodology, design and applicability of BCI. The following are indicative of the kind of topics under discussion: * Low-cost, portable, unobtrusive and robust sensors for brain–computer interfaces; * Open-source software platforms for BCI; * The combination of brain imaging technologies with physiological sensors * Brain–computer interface applications and user evaluation studies; * Novel signal processing and machine learning for BCI, with emphasis on transfer and deep learning methods; * New user training paradigms and advanced co-adaptive approaches for BCI learning; * Benchmarking studies and production of big datasets BCI methods. Dr. Serafeim Perdikis Dr. Athanasios Vourvopoulos /Guest Editors/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.grinberg at umu.se Tue Apr 11 09:09:10 2023 From: adam.grinberg at umu.se (Adam Grinberg) Date: Tue, 11 Apr 2023 07:09:10 +0000 Subject: [FieldTrip] PSD units Message-ID: Hello, My question concerns the Fieldtrip PSD function. I am running the code on some EEG data and comparing it with the MATLAB periodogram function. While the FFT produces similar graphical shape of the spectrogram, the units are different. The periodogram function's units are µV^2/Hz, which is the common output for power (before converting to Db). However, the values that I get with the Fieldtrip freqanalysis function seem to be ~120 times lower. I cannot understand what they are. I looked at the code and still do not get it. I suppose that this is due to some normalization method done but I am not certain as to the rationale for the particular one used. Tanks. /Adam ______________________________________________________________________________________ Adam Grinberg, PT, PhD Department of Community Medicine and Rehabilitation, Physiotherapy Umeå University Umeå, Sweden Tel: +46 (0) 90 786 96 30 -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Tue Apr 11 17:08:39 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 11 Apr 2023 15:08:39 +0000 Subject: [FieldTrip] PSD units In-Reply-To: References: Message-ID: <0FFBCD22-7F5B-4EE7-AC42-8260DB3568F7@donders.ru.nl> Hi Adam, What’s your question? I have some difficulty distilling it from your e-mail. I assume that you have visited the discussion list’s archive, where you will have noticed that questions regarding the units of the output of ft_freqanalysis pop up now and then. Nobody seems to have made an effort so far, to sort it out once and for all, by making a FAQ out of this. I think it would be great if you could start this piece of documentation by describing the normalisation that FT uses in ft_freqanalysis (and the underlying ft_specest_<> functions), and how this relates to plain matlab, or any other software package. Perhaps you could start by studying the difference between the power spectrum, and power spectral density. The fact that you use the term PSD in your e-mail, whereas - as far as I know - fieldtrip does not use this terminology, nor claims that it computes the PSD. Good luck, Jan-Mathijs On 11 Apr 2023, at 09:09, Adam Grinberg via fieldtrip > wrote: Hello, My question concerns the Fieldtrip PSD function. I am running the code on some EEG data and comparing it with the MATLAB periodogram function. While the FFT produces similar graphical shape of the spectrogram, the units are different. The periodogram function’s units are µV^2/Hz, which is the common output for power (before converting to Db). However, the values that I get with the Fieldtrip freqanalysis function seem to be ~120 times lower. I cannot understand what they are. I looked at the code and still do not get it. I suppose that this is due to some normalization method done but I am not certain as to the rationale for the particular one used. Tanks. /Adam ______________________________________________________________________________________ Adam Grinberg, PT, PhD Department of Community Medicine and Rehabilitation, Physiotherapy Umeå University Umeå, Sweden Tel: +46 (0) 90 786 96 30 _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5RV3s_lQGO_tsuGgo7zcEBucW8cr1i6mPkGsevulfd0lqL2ZKYY1PEjFVCEckP4wN0npvpixDOgKahPY-LyhBMYq7EeOEcRI1EwbUA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.kaskan at einsteinmed.edu Tue Apr 11 22:30:18 2023 From: peter.kaskan at einsteinmed.edu (Peter Kaskan) Date: Tue, 11 Apr 2023 20:30:18 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 148, Issue 24 In-Reply-To: References: Message-ID: Hello Jan-Mathijs, Thanks for the reply; I was traveling and just got back to this... In my initial, very rudimentary preprocessing script, cfg.dataset will take a single neuralynx file:       cfg.dataset = 'CSC4.ncs'; cfg.continuous = 'yes'; highpass, lowlass, demean, detrend etc.. filtContData = ft_preprocessing(cfg); But the question was how to reference one channel with another. I have been trying to implement your channellist and appenddata suggestion as you describe (below) using channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} and the subsequent data loop. However, my initial attempt left some errors related to Error using ft_checkconfig (line 163) The field cfg.datafile is required The field cfg.headerfile is required Error in ft_preprocessing (line 385)       cfg = ft_checkconfig(cfg, 'required', {'headerfile', 'datafile'}); After digging a little further in ft_preprocessing lines 446-447 % translate the channel groups (like 'all' and 'MEG') into real labels cfg.channel = ft_channelselection(cfg.channel, hdr); assert(~isempty(cfg.channel), 'the selection of channels is empty'); ... we rescued the error by resetting cfg.channel = CSC1.ncs; Do you know what is happening? If we use: channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} does the cfg.datafile and cfg.headerfile need to be defined some other way? Thanks, Peter ________________________________ From: fieldtrip on behalf of fieldtrip-request at science.ru.nl Sent: Monday, March 27, 2023 6:00 AM To: fieldtrip at science.ru.nl Subject: fieldtrip Digest, Vol 148, Issue 24 Today's Topics: 1. Re: re-referencing using neuralynx.csc channels (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 27 Mar 2023 08:20:40 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" Hi Peter, ft_read_data is a so-called ‘intermediate’ level fieldtrip function and not typically called directly by the casual user. I think your use case calls for the following strategy: channellist = {‘channel1’;’channel2’;…’channelN’}; for k = 1:numel(channellist) cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file data{k} = ft_preprocessing(cfg); end alldata = ft_appenddata([], data{:}); Once you have the alldata object, you can apply re-referencing. Perhaps indeed this is best done by creating a ‘montage’, and apply it to the data. Best wishes, Jan-Mathijs On 23 Mar 2023, at 22:12, Peter Kaskan via fieldtrip > wrote: Hello, I am writing a ft_preprocessing script; I can give it channel1.csc and proceed with filtering, defining trials etc. ...but, how do I re-reference to another channel? Is there a way to use ft_read_data to create a structure with all channels, and then tell it what channel I want to use as a reference? Or do I need to create a montage, and how do I do that with n #s of separate neuralynx.csc channels? Thanks - Peter Peter M. Kaskan, Ph.D. Assistant Professor Albert Einstein College of Medicine Leo M. Davidoff Department of Neurological Surgery 1410 Pelham Parkway South Kennedy Center Room 429B Bronx, NY 10461 phone: 718-430-2763 _______________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Wed Apr 12 08:30:21 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 12 Apr 2023 06:30:21 +0000 Subject: [FieldTrip] fieldtrip Digest, Vol 148, Issue 24 In-Reply-To: References: Message-ID: <018DFDF5-5510-4608-B56B-2D1655F0849B@donders.ru.nl> Hi Peter, Apologies, I was a bit sloppy in my earlier code snippet. I think it should have read something like this channellist = {‘channel1’;’channel2’;…’channelN’}; cfg = []; cfg. for k = 1:numel(channellist) %% NOT THIS: cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file cfg.dataset = sprintf(‘%s.ncs’,channellist{k}); data{k} = ft_preprocessing(cfg); end If each channel is represented as a single file, ft_preprocessing needs to be instructed in each iteration of the loop with a fresh cfg.dataset Once you have ‘appended’ the channels through ft_appenddata (note that this requires each of the channels' data structures to have the same number of samples) , you should be able to re-reference. I hope that this helps to get you on your way. Good luck, Jan-Mathijs On 11 Apr 2023, at 22:30, Peter Kaskan via fieldtrip > wrote: Hello Jan-Mathijs, Thanks for the reply; I was traveling and just got back to this... In my initial, very rudimentary preprocessing script, cfg.dataset will take a single neuralynx file:       cfg.dataset = 'CSC4.ncs'; cfg.continuous = 'yes'; highpass, lowlass, demean, detrend etc.. filtContData = ft_preprocessing(cfg); But the question was how to reference one channel with another. I have been trying to implement your channellist and appenddata suggestion as you describe (below) using channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} and the subsequent data loop. However, my initial attempt left some errors related to Error using ft_checkconfig (line 163) The field cfg.datafile is required The field cfg.headerfile is required Error in ft_preprocessing (line 385)       cfg = ft_checkconfig(cfg, 'required', {'headerfile', 'datafile'}); After digging a little further in ft_preprocessing lines 446-447 % translate the channel groups (like 'all' and 'MEG') into real labels cfg.channel = ft_channelselection(cfg.channel, hdr); assert(~isempty(cfg.channel), 'the selection of channels is empty'); ... we rescued the error by resetting cfg.channel = CSC1.ncs; Do you know what is happening? If we use: channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} does the cfg.datafile and cfg.headerfile need to be defined some other way? Thanks, Peter ________________________________ From: fieldtrip > on behalf of fieldtrip-request at science.ru.nl > Sent: Monday, March 27, 2023 6:00 AM To: fieldtrip at science.ru.nl > Subject: fieldtrip Digest, Vol 148, Issue 24 Today's Topics: 1. Re: re-referencing using neuralynx.csc channels (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 27 Mar 2023 08:20:40 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" > Hi Peter, ft_read_data is a so-called ‘intermediate’ level fieldtrip function and not typically called directly by the casual user. I think your use case calls for the following strategy: channellist = {‘channel1’;’channel2’;…’channelN’}; for k = 1:numel(channellist) cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file data{k} = ft_preprocessing(cfg); end alldata = ft_appenddata([], data{:}); Once you have the alldata object, you can apply re-referencing. Perhaps indeed this is best done by creating a ‘montage’, and apply it to the data. Best wishes, Jan-Mathijs On 23 Mar 2023, at 22:12, Peter Kaskan via fieldtrip > wrote: Hello, I am writing a ft_preprocessing script; I can give it channel1.csc and proceed with filtering, defining trials etc. ...but, how do I re-reference to another channel? Is there a way to use ft_read_data to create a structure with all channels, and then tell it what channel I want to use as a reference? Or do I need to create a montage, and how do I do that with n #s of separate neuralynx.csc channels? Thanks - Peter Peter M. Kaskan, Ph.D. Assistant Professor Albert Einstein College of Medicine Leo M. Davidoff Department of Neurological Surgery 1410 Pelham Parkway South Kennedy Center Room 429B Bronx, NY 10461 phone: 718-430-2763 _______________________________________________ _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8H-lRU5w5rb--EVlbOiAf99N0XMGrhyk-fsQJ4BQw56I7POkez-dEqFrtQ9SJ4BnZTgBsuTZW_xvbhw4oCE_CdjMrPU0P11VRlXGfw$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From hasnae.AGOURAM at univ-amu.fr Wed Apr 12 09:22:26 2023 From: hasnae.AGOURAM at univ-amu.fr (AGOURAM Hasnae) Date: Wed, 12 Apr 2023 07:22:26 +0000 Subject: [FieldTrip] Create a field trip structure manually from .mat file of raw data ? Message-ID: Dear fieldtrip commity, I have a mat file containing raw EEG data with the following fields: start, length, values, times, interval, scale, offset, units, and units of measurement. They have no correlation with any common raw data. Do you think I could manually create a field trip structure? [X] In fact, I attempted to design it and ended up with a structure that contained the fields hdr, label, time, trial, fsampel, and sampleinfo. [X][X] After I manually did the work of ft preprocessing() function, I wanted to epoch the data. To do this, I manually generated the 'trl' matrix by specifying the trial duration, however I got an error with ft_redefinetrial() function: "Unrecognized field name "dimord". Error in ft_redefinetrial (line 112) strcmp(data.dimord, 'rpt_chan_time') &&..." [X] Thanks in advance, Hasnae AGOURAM -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: raw_lfp_data_mat_file.png Type: image/png Size: 14966 bytes Desc: raw_lfp_data_mat_file.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip_data_structure_manually.png Type: image/png Size: 12714 bytes Desc: fieldtrip_data_structure_manually.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: header_data.png Type: image/png Size: 8189 bytes Desc: header_data.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: error_ft_redefinetrial.png Type: image/png Size: 5613 bytes Desc: error_ft_redefinetrial.png URL: From adam.grinberg at umu.se Wed Apr 12 09:40:32 2023 From: adam.grinberg at umu.se (Adam Grinberg) Date: Wed, 12 Apr 2023 07:40:32 +0000 Subject: [FieldTrip] PSD units In-Reply-To: <0FFBCD22-7F5B-4EE7-AC42-8260DB3568F7@donders.ru.nl> References: <0FFBCD22-7F5B-4EE7-AC42-8260DB3568F7@donders.ru.nl> Message-ID: Hi, I indeed wish to calculate the power spectral density of my signal. I.e., how the signal power is distributed across various frequencies. Fieldtrip's ft_freqanalysis function can indeed calculate this (even though they do not explicitly use this term. cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.tapsmofrq = 0.5; cfg.output = 'pow'; cfg.channel = {'F3', 'Fz', 'F4'}; theta_freq) = ft_freqanalysis(cfg, ft_data); Now, while power is generally represented in Watt, a common unit of power is are µV^2/Hz. This however is not the output that I get, but seems to be smaller by a factor of ~120. As I wish to publish in accordance with the convention, I at least wish to know what type of normalization/transformation Fieldtrip is performing and what the rationale for that is. /Adam ______________________________________________________________________________________ Adam Grinberg, PT, PhD Department of Community Medicine and Rehabilitation, Physiotherapy Umeå University Umeå, Sweden Tel: +46 (0) 90 786 96 30 From: fieldtrip On Behalf Of Schoffelen, J.M. (Jan Mathijs) via fieldtrip Sent: 11 April 2023 17:09 To: FieldTrip discussion list Cc: Schoffelen, J.M. (Jan Mathijs) Subject: Re: [FieldTrip] PSD units Hi Adam, What's your question? I have some difficulty distilling it from your e-mail. I assume that you have visited the discussion list's archive, where you will have noticed that questions regarding the units of the output of ft_freqanalysis pop up now and then. Nobody seems to have made an effort so far, to sort it out once and for all, by making a FAQ out of this. I think it would be great if you could start this piece of documentation by describing the normalisation that FT uses in ft_freqanalysis (and the underlying ft_specest_<> functions), and how this relates to plain matlab, or any other software package. Perhaps you could start by studying the difference between the power spectrum, and power spectral density. The fact that you use the term PSD in your e-mail, whereas - as far as I know - fieldtrip does not use this terminology, nor claims that it computes the PSD. Good luck, Jan-Mathijs On 11 Apr 2023, at 09:09, Adam Grinberg via fieldtrip > wrote: Hello, My question concerns the Fieldtrip PSD function. I am running the code on some EEG data and comparing it with the MATLAB periodogram function. While the FFT produces similar graphical shape of the spectrogram, the units are different. The periodogram function's units are µV^2/Hz, which is the common output for power (before converting to Db). However, the values that I get with the Fieldtrip freqanalysis function seem to be ~120 times lower. I cannot understand what they are. I looked at the code and still do not get it. I suppose that this is due to some normalization method done but I am not certain as to the rationale for the particular one used. Tanks. /Adam ______________________________________________________________________________________ Adam Grinberg, PT, PhD Department of Community Medicine and Rehabilitation, Physiotherapy Umeå University Umeå, Sweden Tel: +46 (0) 90 786 96 30 _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5RV3s_lQGO_tsuGgo7zcEBucW8cr1i6mPkGsevulfd0lqL2ZKYY1PEjFVCEckP4wN0npvpixDOgKahPY-LyhBMYq7EeOEcRI1EwbUA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ariana_lopes12 at hotmail.com Sat Apr 15 19:13:21 2023 From: ariana_lopes12 at hotmail.com (Ariana Lopes) Date: Sat, 15 Apr 2023 17:13:21 +0000 Subject: [FieldTrip] Fieldtrip Message-ID: Good afternoon, I have been trying to replicate the following tutorial but for EEG data: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/networkanalysis_old/__;!!HJOPV4FYYWzcc1jazlU!48K7JfnGiN-omLAyCiTPBaQkHWhMpO67hOYV8BuX0B2C8Z7nAvg_LWJ82O2xnEmPX4vdZQOdm0OmlpoH20l1ZF70Ij3pS_I$ The problem I am facing is that for the dataset I have, the steps I am recreating do not have the component ".grad" which is needed for the tutorial. I am kindly asking how is it possible for me to recreate this tutorial with the grad function, even though I do not have enough information to recreate it. Thanks for the help, Ariana Lopes -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Sun Apr 16 08:55:25 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 16 Apr 2023 06:55:25 +0000 Subject: [FieldTrip] Fieldtrip In-Reply-To: References: Message-ID: Hi Ariana, ‘grad’ is for MEG, ‘elec’ is for EEG, and ‘opto’ is for fNIRS. I suggest to work on this instead. https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/networkanalysis_eeg/__;!!HJOPV4FYYWzcc1jazlU!9N20tRiQBfypwY-jeJw_SH0-9D_iYLtTz3lEuz4_8r60WeEr6wfTt0nyu5eSuJkaRLEcE2jQrTOZAqcypX3KpBFZ8hJ6bGIMCrtXmw$ Good luck, Jan-Mathijs On 15 Apr 2023, at 19:13, Ariana Lopes via fieldtrip > wrote: Good afternoon, I have been trying to replicate the following tutorial but for EEG data: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/networkanalysis_old/__;!!HJOPV4FYYWzcc1jazlU!9N20tRiQBfypwY-jeJw_SH0-9D_iYLtTz3lEuz4_8r60WeEr6wfTt0nyu5eSuJkaRLEcE2jQrTOZAqcypX3KpBFZ8hJ6bGIPSt_hug$ The problem I am facing is that for the dataset I have, the steps I am recreating do not have the component ".grad" which is needed for the tutorial. I am kindly asking how is it possible for me to recreate this tutorial with the grad function, even though I do not have enough information to recreate it. Thanks for the help, Ariana Lopes _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-7avtmNbAU26G0vpfzjfUEohrH3Q0ihA-j7bMUfKn3zd6sJ3S9R9d_TSsbp6WpVylqu5NWnYkD7PXyjeRLrEyu4ZpLeZAd2Uodtv9Q$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Sun Apr 16 09:05:17 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Sun, 16 Apr 2023 07:05:17 +0000 Subject: [FieldTrip] Fieldtrip In-Reply-To: References: Message-ID: <41FEACD3-24CD-42F4-AA66-AF3D08B5E819@donders.ru.nl> Hi Ariana, I forgot to add this link: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described/__;!!HJOPV4FYYWzcc1jazlU!5DC12AZ0OITRCjjfmWnT0GtQNKJvqVUzhA7-bllbMoVoaMUKG5-4AqFmluAmC7yAvHEZ3Wvbkaa0RHrc9_Zocvw_N6_gh9pEoO4bVw$ with background information, but I assume that you already found that one. Best wishes, Jan-Mathijs On 15 Apr 2023, at 19:13, Ariana Lopes via fieldtrip > wrote: Good afternoon, I have been trying to replicate the following tutorial but for EEG data: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/networkanalysis_old/__;!!HJOPV4FYYWzcc1jazlU!5DC12AZ0OITRCjjfmWnT0GtQNKJvqVUzhA7-bllbMoVoaMUKG5-4AqFmluAmC7yAvHEZ3Wvbkaa0RHrc9_Zocvw_N6_gh9pVUwFFmw$ The problem I am facing is that for the dataset I have, the steps I am recreating do not have the component ".grad" which is needed for the tutorial. I am kindly asking how is it possible for me to recreate this tutorial with the grad function, even though I do not have enough information to recreate it. Thanks for the help, Ariana Lopes _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-7avtmNbAU26G0vpfzjfUEohrH3Q0ihA-j7bMUfKn3zd6sJ3S9R9d_TSsbp6WpVylqu5NWnYkD7PXyjeRLrEyu4ZpLeZAd2Uodtv9Q$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ariana_lopes12 at hotmail.com Sun Apr 16 14:41:52 2023 From: ariana_lopes12 at hotmail.com (Ariana Lopes) Date: Sun, 16 Apr 2023 12:41:52 +0000 Subject: [FieldTrip] Fieldtrip In-Reply-To: <41FEACD3-24CD-42F4-AA66-AF3D08B5E819@donders.ru.nl> References: <41FEACD3-24CD-42F4-AA66-AF3D08B5E819@donders.ru.nl> Message-ID: Thank you for the help. ________________________________ De: fieldtrip em nome de Schoffelen, J.M. (Jan Mathijs) via fieldtrip Enviado: 16 de abril de 2023 08:05 Para: FieldTrip discussion list Cc: Schoffelen, J.M. (Jan Mathijs) Assunto: Re: [FieldTrip] Fieldtrip Hi Ariana, I forgot to add this link: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described/__;!!HJOPV4FYYWzcc1jazlU!5KQ3eBFa4G6xpS7f_dysnUzFXiXJo_VF7ucbWdb0xRnKpLYz5ydH3H3bFT2blS1FJaoOcZj_eFlgom1Ij8OOnyrbAPbkY98$ with background information, but I assume that you already found that one. Best wishes, Jan-Mathijs On 15 Apr 2023, at 19:13, Ariana Lopes via fieldtrip > wrote: Good afternoon, I have been trying to replicate the following tutorial but for EEG data: https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/networkanalysis_old/__;!!HJOPV4FYYWzcc1jazlU!5KQ3eBFa4G6xpS7f_dysnUzFXiXJo_VF7ucbWdb0xRnKpLYz5ydH3H3bFT2blS1FJaoOcZj_eFlgom1Ij8OOnyrbJEYv9OI$ The problem I am facing is that for the dataset I have, the steps I am recreating do not have the component ".grad" which is needed for the tutorial. I am kindly asking how is it possible for me to recreate this tutorial with the grad function, even though I do not have enough information to recreate it. Thanks for the help, Ariana Lopes _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-7avtmNbAU26G0vpfzjfUEohrH3Q0ihA-j7bMUfKn3zd6sJ3S9R9d_TSsbp6WpVylqu5NWnYkD7PXyjeRLrEyu4ZpLeZAd2Uodtv9Q$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.rohe at fau.de Sun Apr 16 21:13:55 2023 From: tim.rohe at fau.de (Rohe, Tim) Date: Sun, 16 Apr 2023 19:13:55 +0000 Subject: [FieldTrip] =?iso-8859-1?q?PhD_position_Perceptual_Psychology_?= =?iso-8859-1?q?=28FAU_Erlangen-N=FCrnberg=2C_Germany=29?= Message-ID: <1347d6d9e96e4c4b9f96085521298fe9@fau.de> Dear FieldTrip community, I'm looking for a highly motivated PhD student to join my lab (for details, see below). Best wishes, Tim Rohe The Perceptual Psychology group at the Institute of Psychology at the Friedrich-Alexander-University Erlangen-Nürnberg is seeking a doctoral researcher (m/f/d; 75 % TV-L E 13 for the DFG Project "Olfactory-Visual Causal Inference in Perception and the Brain" as of 1.6.2023 or as soon as possible, limited for 3 years. The project investigates how people combine the appearance and smell of food into a multisensory perception using psychophysical, psycho-physiological and neurophysiological methods. Tasks in the project include - the planning and conduction of olfactory-visual studies with electroencephalography (EEG), electromyography (EMG) and facial-expression analysis - the analysis and presentation of data (e.g., at conferences) - writing manuscripts for publications in international journals - working in a team - co-supervision of student assistants and study theses Required Qualifications: The applicant should have a strong interest in the research topics of perceptual psychology, especially multisensory perception. In addition, she/he should have a strong interest in scientific work oriented towards open-science principles. In addition to a high level of social competence, team and communication skills and the ability to work independently and on one's own responsibility, the following qualifications are required: - Above-average degree in Psychology, Cognitive Neuroscience, or a related discipline relevant to the research question (M.Sc., Dipl., about to be completed or completed upon hire). - Very good knowledge of methods and statistics, experience with statistical software (e.g. JASP, R) - Knowledge in programming (e.g. in Matlab, Python/Psychopy and/or R) or willingness to acquire the knowledge - Good knowledge of German and English Desirable Qualifications: - Experience conducting research with human participants in behavioral and/or neuro-physiological experiments such as EEG - Experience with the analysis of behavioral and/or neurophysiological data, especially EEG data (e.g., in Matlab with EEGLab, Brainstorm or FieldTrip). We offer: - the collaboration in an innovative and creative research project - the possibility to do a doctorate under highly motivated supervision - integration into a friendly, growing research team that is oriented towards Open Science principles - remuneration according to the usual pay scale for scientific employees (TV-L E13, 75%, for 3 years) - Access to up-to-date research equipment in a multisensory laboratory with 64-channel EEG and devices for the presentation of visual, olfactory and auditory stimuli, facial expression analysis, psychophysiological measurements (e.g., EMG) as well as eye-tracking The Friedrich-Alexander-Universität Erlangen-Nürnberg aims to increase the proportion of women in research and teaching and therefore expressly invites applications from appropriately qualified women. Severely disabled persons will be given preference in the case of equal suitability. Earliest hiring date: June 1, 2023 Application deadline: April 30, 2023 Please send follow-up questions to Prof. Dr. Tim Rohe (tim.rohe at fau.de ). Please send your application documents including CV, letter of motivation (1 page) with a short description of own qualifications and research interests, copies of academic qualifications, contact details of at least 1 potential referee* and a writing sample (e.g. bachelor or master thesis) in electronic form in a single PDF file to Prof. Dr. Tim Rohe (tim.rohe at fau.de ) by April 30, 2023. ----- Prof. Dr. Tim Rohe Wahrnehmungspsychologie Institut für Psychologie Friedrich-Alexander Universität Erlangen-Nürnberg Nägelsbachstr. 49a 91052 Erlangen Email: tim.rohe at fau.de Tel: 09131/85-20864 https://urldefense.com/v3/__https://www.wahrnehmungspsychologie.phil.fau.de/__;!!HJOPV4FYYWzcc1jazlU!9bxwt-V5rO384XZsWg6e1hjesopCLz_hu3JpGJvqmIDhLusXoxwQ-eJ_U7wEHEV6r0tsMZAb4AqHDNCYgK7L6w$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From giovanna.aiello at hest.ethz.ch Tue Apr 18 11:37:52 2023 From: giovanna.aiello at hest.ethz.ch (Aiello Giovanna) Date: Tue, 18 Apr 2023 09:37:52 +0000 Subject: [FieldTrip] Partial Directed Coherence computation Message-ID: <6403b2781135498d8e9268411adfdc65@hest.ethz.ch> Good morning, I am interested in understanding the directed connectivity between the thalamus, where I am recording a Local Field Potential (in 1 channel) and the cortex, where I am recording EEGs (in 16 channels). My signal is epoched in 4-seconds windows, and I am not interested in understanding the evolution of the directed connectivity in time but rather just which structure is leading which. I have computed Partial Directed Connectivity (pdc) with the fieldtrip function ft_connectivityanalysis, feeding into the code the transformed, Fourier spectrum (complex double) of my signal (rpttap x channels x frequencies, where rpttap is repetitions (i.e., number of epochs) x tapers). My final matrix of pdc is 17 x 17 x frequencies (where frequencies are my frequencies of interest). The first 16 channels represent the EEG channels, the 17th channel is the LFP channel in the thalamus. Let’s call this matrix A. I have two questions: 1) Did I understand correctly that the element A( i, j, f ) for a given frequency f indicates the directed connectivity from element i to element j? (And not the other way around) 2) In my case, A( 1:16 , j , f ) is a column vector containing the same number! It looks like, independently on what EEG channel I am considering (unless I am considering the channel in the thalamus), the contribution of directed connectivity to a certain channel j is always the same. This also stays for the thalamus, so if I take A( 1:16, 17, f ), it seems like all the eeg channels have the same directed connectivity to the thalamus. Is that possible? I think it does not really make sense. Please notice that the numbers are not exactly the same, but differ in the 4th decimal digit. Thank you in advance for your help Giovanna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ZXI820 at student.bham.ac.uk Tue Apr 18 14:32:18 2023 From: ZXI820 at student.bham.ac.uk (Zlatomira Ilchovska) Date: Tue, 18 Apr 2023 12:32:18 +0000 Subject: [FieldTrip] cfg.offset cutting randomly trial length Message-ID: Good afternoon, I'm using cfg.offset as an option in ft_redefinetrial, for the purpose of offsetting my t=0 to the response time for each trial. My problem is that after doing this successfully, some of my trials are cut at the ends "randomly" (e.g., instead of being -0.15sec. +1.55sec. around the new zero point, some are quite randomly cut to, for instance, -0.01sec. +1.0sec. around the new zero time). I am sure that my original trial length before offsetting is long enough to allow for a -0.15sec. +1.55sec. around the new "offset" zero point. So it's not a matter of that. I can't seem to figure out where the problem is though. Here is the code I use: r500=[1.249;0.99;0.012;1.003;0.868;0.904;0.761;0.75;0.59;1.034;1.137;1.077;0.46;1.833;0.029;1.167;0.907;1.154;0.926;1.386;0.864;0.898;0.864;0.205;1.203;0.943;0.75;1.035;0.953;0.803;0.849;1.126;0.953;1.169;0.86;0.921;1.079;1.003;0.735;0.798;1.101;0.893;0.857;0.906;0.737;0.876;0.993;0.984;0.968;1.04;0.948;0.925;0.866;1.126;1.278;0.933;0.988;0.814;0.841;0.744;1.289;1.29;1.016;1.333;1.08;0.723;1.207;0.83;0.981;0.949;0.839;1.017;1.061;0.681;0.763;1.012;1.327;1.051;1.137;0.888;1.165;1.077;1.248;0.987;0.841;1.016;1.208;0.914;1.286;1.068;1.451;1.337;0.909;1.536;1.495;1.496;1.033;1.082;1.139;0.895;0.892;1.038;0.739;1.726;1.353;1.259;0.922;1.155;0.926;0.956;1.167;1.233;0.824;0.849;1.048;1.28;1.006;0.929;0.801;0.831;1.1;0.894;1.499;0.903;1.154;1.212;0.839;1.209;1.069;1.124;0.936;0.824;0.923;1.15;1.302;0.907;1.422;1.251;0.791;1.13;1.052;0.893;0.885;0.822;1.328;1.138;1.086;1.573;1.084;0.888;1.295;0.987;0.876;1.441;0.971;1.045;1.524;1.121;1.081;1.133;0.984;0.757;1.307;1.183;1.528;0.942;1.06;1.167;0.887;1.068;1.041;0.842;1.202;1.536;1.156;1.233;1.36;0.944;1.34;0.844;1.013;1.034;0.686;0.897;1.28;1.122;1.105;1.206;1.085;1.037;1.169;0.919;0.844;0.869;1.177;0.836;0.737;0.897;0.692;1.509;1.341;1.387;0.74;1.44;1.149;1.067;0.979;0.951;1.068;1.78;1.033;1.281;1.273;1.63;1.007;1.151;0.819;1.718;1.178;1.116;0.941;1.403;1.142;1.406;0.941;0.866;0.844;1.087;0.951;0.945;1.244;1.04;0.856;1.055;0.945;0.821;1.057] %the RTs for one example participant p500=[1;0;1;1;0;1;1;1;1;1;1;0;1;1;1;1;0;0;1;1;1;1;1;1;0;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;0;0;1;0;0;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;0;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0;0;1;0;1;1;0;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;0;1;1;1;1;0;1;1;1] %the correct trials for one example participant cfg=[]; cfg.trials=p500 data_RT_corr = ft_redefinetrial(cfg, data_RT) %here I just select the trials that are correct and hence have a response time rts_code = round(r500*500) %here I transform my RTs from seconds to samples (my sampling rate is 500 Hz) cfg.offset = rts_code data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr); %here is where I offset to the new t=0 for each trial % Now make the epochs until +1.55 sec after the new t=0: cfg = []; cfg.toilim = [-0.150 1.550] data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr_offset); %adjust the epoch length Any suggestions would be very much appreciated. Thank you! Best, Zlati PhD Researcher School of Psychology University of Birmingham Please note that I am currently working more flexibly, which may result in sending and responding to emails out of hours, but there is no expectation on you to do the same. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nirofir2 at gmail.com Tue Apr 18 15:23:36 2023 From: nirofir2 at gmail.com (Nir Ofir) Date: Tue, 18 Apr 2023 16:23:36 +0300 Subject: [FieldTrip] cfg.offset cutting randomly trial length In-Reply-To: References: Message-ID: Dear Zlatomira, Assuming that the response comes after t=0, and that the RTs are calculated with respect to t=0, you want to use the negative of the RT in cfg.offset. In your code now, taking the first trial for example, t=0 in *data_RT_corr_offset *corresponds to t=-1.249 in *data_RT_corr*, which is the opposite of what you want. Changing *cfg.offset = rts_code* into *cfg.offset = -rts_code* should do the trick. On Tue, Apr 18, 2023 at 3:43 PM Zlatomira Ilchovska via fieldtrip < fieldtrip at science.ru.nl> wrote: > Good afternoon, > > I'm using cfg.offset as an option in ft_redefinetrial, for the purpose of > offsetting my t=0 to the response time for each trial. My problem is that > after doing this successfully, some of my trials are cut at the ends > "randomly" (e.g., instead of being -0.15sec. +1.55sec. around the new zero > point, some are quite randomly cut to, for instance, -0.01sec. +1.0sec. > around the new zero time). I am sure that my original trial length before > offsetting is long enough to allow for a -0.15sec. +1.55sec. around the new > "offset" zero point. So it's not a matter of that. I can't seem to figure > out where the problem is though. Here is the code I use: > > *r500=[1.249;0.99;0.012;1.003;0.868;0.904;0.761;0.75;0.59;1.034;1.137;1.077;0.46;1.833;0.029;1.167;0.907;1.154;0.926;1.386;0.864;0.898;0.864;0.205;1.203;0.943;0.75;1.035;0.953;0.803;0.849;1.126;0.953;1.169;0.86;0.921;1.079;1.003;0.735;0.798;1.101;0.893;0.857;0.906;0.737;0.876;0.993;0.984;0.968;1.04;0.948;0.925;0.866;1.126;1.278;0.933;0.988;0.814;0.841;0.744;1.289;1.29;1.016;1.333;1.08;0.723;1.207;0.83;0.981;0.949;0.839;1.017;1.061;0.681;0.763;1.012;1.327;1.051;1.137;0.888;1.165;1.077;1.248;0.987;0.841;1.016;1.208;0.914;1.286;1.068;1.451;1.337;0.909;1.536;1.495;1.496;1.033;1.082;1.139;0.895;0.892;1.038;0.739;1.726;1.353;1.259;0.922;1.155;0.926;0.956;1.167;1.233;0.824;0.849;1.048;1.28;1.006;0.929;0.801;0.831;1.1;0.894;1.499;0.903;1.154;1.212;0.839;1.209;1.069;1.124;0.936;0.824;0.923;1.15;1.302;0.907;1.422;1.251;0.791;1.13;1.052;0.893;0.885;0.822;1.328;1.138;1.086;1.573;1.084;0.888;1.295;0.987;0.876;1.441;0.971;1.045;1.524;1.121;1.081;1.133;0.984;0.757;1.307;1.183;1.528;0.942;1.06;1.167;0.887;1.068;1.041;0.842;1.202;1.536;1.156;1.233;1.36;0.944;1.34;0.844;1.013;1.034;0.686;0.897;1.28;1.122;1.105;1.206;1.085;1.037;1.169;0.919;0.844;0.869;1.177;0.836;0.737;0.897;0.692;1.509;1.341;1.387;0.74;1.44;1.149;1.067;0.979;0.951;1.068;1.78;1.033;1.281;1.273;1.63;1.007;1.151;0.819;1.718;1.178;1.116;0.941;1.403;1.142;1.406;0.941;0.866;0.844;1.087;0.951;0.945;1.244;1.04;0.856;1.055;0.945;0.821;1.057] > **%the RTs for one example participant* > > *p500=[1;0;1;1;0;1;1;1;1;1;1;0;1;1;1;1;0;0;1;1;1;1;1;1;0;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;0;0;1;0;0;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;0;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0;0;1;0;1;1;0;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;0;1;1;1;1;0;1;1;1] > **%the correct trials for one example participant* > > * cfg=[];* > > *cfg.trials=p500 * > *data_RT_corr = ft_redefinetrial(cfg, data_RT) **%here I just select the > trials that are correct and hence have a response time* > > *rts_code = round(r500*500) **%here I transform my RTs from seconds to > samples (my sampling rate is 500 Hz)* > > *cfg.offset = rts_code data_RT_corr_offset = ft_redefinetrial(cfg, > data_RT_corr);** %here is where I offset to the new t=0 for each trial* > > *% Now make the epochs until +1.55 sec after the new t=0:* > *cfg = [];* > *cfg.toilim = [-0.150 1.550]* > *data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr_offset); **%adjust > the epoch length * > > Any suggestions would be very much appreciated. Thank you! > > Best, > > Zlati > > PhD Researcher > School of Psychology > University of Birmingham > > *Please note that I am currently working more flexibly, which may result > in sending and responding to emails out of hours, but there is no > expectation on you to do the same.* > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8AIOYuUW3fUIFxGorPBzKpyIlcoDPihyzeXdw-bxppU4IvCXW7fOxLs_BNFwrQD4jh_xqfvPTARwrOlD0KUq0A$ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ZXI820 at student.bham.ac.uk Tue Apr 18 15:59:02 2023 From: ZXI820 at student.bham.ac.uk (Zlatomira Ilchovska) Date: Tue, 18 Apr 2023 13:59:02 +0000 Subject: [FieldTrip] cfg.offset cutting randomly trial length In-Reply-To: References: Message-ID: Dear Nir, Thank you very much for this clarification! It does the job indeed. Hopefully the instructions of this option gets edited in future for more clarity. Best, Zlati PhD Researcher School of Psychology University of Birmingham Please note that I am currently working more flexibly, which may result in sending and responding to emails out of hours, but there is no expectation on you to do the same. ________________________________ From: Nir Ofir Sent: Tuesday, April 18, 2023 2:23 PM To: FieldTrip discussion list Cc: Zlatomira Ilchovska (PhD Psychology Lab FT) Subject: Re: [FieldTrip] cfg.offset cutting randomly trial length CAUTION: This email originated from outside the organisation. Do not click links or open attachments unless you recognise the sender and know the content is safe. Dear Zlatomira, Assuming that the response comes after t=0, and that the RTs are calculated with respect to t=0, you want to use the negative of the RT in cfg.offset. In your code now, taking the first trial for example, t=0 in data_RT_corr_offset corresponds to t=-1.249 in data_RT_corr, which is the opposite of what you want. Changing cfg.offset = rts_code into cfg.offset = -rts_code should do the trick. On Tue, Apr 18, 2023 at 3:43 PM Zlatomira Ilchovska via fieldtrip > wrote: Good afternoon, I'm using cfg.offset as an option in ft_redefinetrial, for the purpose of offsetting my t=0 to the response time for each trial. My problem is that after doing this successfully, some of my trials are cut at the ends "randomly" (e.g., instead of being -0.15sec. +1.55sec. around the new zero point, some are quite randomly cut to, for instance, -0.01sec. +1.0sec. around the new zero time). I am sure that my original trial length before offsetting is long enough to allow for a -0.15sec. +1.55sec. around the new "offset" zero point. So it's not a matter of that. I can't seem to figure out where the problem is though. Here is the code I use: r500=[1.249;0.99;0.012;1.003;0.868;0.904;0.761;0.75;0.59;1.034;1.137;1.077;0.46;1.833;0.029;1.167;0.907;1.154;0.926;1.386;0.864;0.898;0.864;0.205;1.203;0.943;0.75;1.035;0.953;0.803;0.849;1.126;0.953;1.169;0.86;0.921;1.079;1.003;0.735;0.798;1.101;0.893;0.857;0.906;0.737;0.876;0.993;0.984;0.968;1.04;0.948;0.925;0.866;1.126;1.278;0.933;0.988;0.814;0.841;0.744;1.289;1.29;1.016;1.333;1.08;0.723;1.207;0.83;0.981;0.949;0.839;1.017;1.061;0.681;0.763;1.012;1.327;1.051;1.137;0.888;1.165;1.077;1.248;0.987;0.841;1.016;1.208;0.914;1.286;1.068;1.451;1.337;0.909;1.536;1.495;1.496;1.033;1.082;1.139;0.895;0.892;1.038;0.739;1.726;1.353;1.259;0.922;1.155;0.926;0.956;1.167;1.233;0.824;0.849;1.048;1.28;1.006;0.929;0.801;0.831;1.1;0.894;1.499;0.903;1.154;1.212;0.839;1.209;1.069;1.124;0.936;0.824;0.923;1.15;1.302;0.907;1.422;1.251;0.791;1.13;1.052;0.893;0.885;0.822;1.328;1.138;1.086;1.573;1.084;0.888;1.295;0.987;0.876;1.441;0.971;1.045;1.524;1.121;1.081;1.133;0.984;0.757;1.307;1.183;1.528;0.942;1.06;1.167;0.887;1.068;1.041;0.842;1.202;1.536;1.156;1.233;1.36;0.944;1.34;0.844;1.013;1.034;0.686;0.897;1.28;1.122;1.105;1.206;1.085;1.037;1.169;0.919;0.844;0.869;1.177;0.836;0.737;0.897;0.692;1.509;1.341;1.387;0.74;1.44;1.149;1.067;0.979;0.951;1.068;1.78;1.033;1.281;1.273;1.63;1.007;1.151;0.819;1.718;1.178;1.116;0.941;1.403;1.142;1.406;0.941;0.866;0.844;1.087;0.951;0.945;1.244;1.04;0.856;1.055;0.945;0.821;1.057] %the RTs for one example participant p500=[1;0;1;1;0;1;1;1;1;1;1;0;1;1;1;1;0;0;1;1;1;1;1;1;0;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;0;0;1;0;0;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;0;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0;0;1;0;1;1;0;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;0;1;1;1;1;0;1;1;1] %the correct trials for one example participant cfg=[]; cfg.trials=p500 data_RT_corr = ft_redefinetrial(cfg, data_RT) %here I just select the trials that are correct and hence have a response time rts_code = round(r500*500) %here I transform my RTs from seconds to samples (my sampling rate is 500 Hz) cfg.offset = rts_code data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr); %here is where I offset to the new t=0 for each trial % Now make the epochs until +1.55 sec after the new t=0: cfg = []; cfg.toilim = [-0.150 1.550] data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr_offset); %adjust the epoch length Any suggestions would be very much appreciated. Thank you! Best, Zlati PhD Researcher School of Psychology University of Birmingham Please note that I am currently working more flexibly, which may result in sending and responding to emails out of hours, but there is no expectation on you to do the same. _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!4480cx1LzwzsXmG5sF0IUsm_9lhmU3BeZ6X5biyPQK7MTTJyANFzykzkSKtNbphe8NJGHpiz7RNnvw_N48PQI1TCHbeg$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From james-kenneth.moran at charite.de Wed Apr 19 10:49:47 2023 From: james-kenneth.moran at charite.de (Moran, James Kenneth) Date: Wed, 19 Apr 2023 08:49:47 +0000 Subject: [FieldTrip] Postdoctoral or PhD Position, Charite Berlin, memory dysfunction in Schizophrenia Message-ID: A postdoctoral or PhD position is available at the Psychiatric University Hospital of Charité - Universitätsmedizin Berlin in the research group Multisensory Integration (https://urldefense.com/v3/__http://www.multisensorymind.com__;!!HJOPV4FYYWzcc1jazlU!-yzVvF4iQScxKe62Q9C9SUcc96denRilioDGJsdsaEpEwlYBFfy040NwKyt99xRp5tuoal567GHw7ZyPorQQGgsw3TAWCi29QDM$ ) as part of the DFG grant project "Working memory disorders in schizophrenia: an investigation of multivariate activation patterns and neuronal synchrony". The project is led by Prof. Daniel Senkowski (Charité Berlin) in cooperation with Prof. Paul Sauseng (LMU Munich) and Prof. Radoslaw Cichy (FU Berlin) All Information and contact details can be found here: https://urldefense.com/v3/__https://multisensorymind.com/images/PostdocPhD_Charite.pdf__;!!HJOPV4FYYWzcc1jazlU!-yzVvF4iQScxKe62Q9C9SUcc96denRilioDGJsdsaEpEwlYBFfy040NwKyt99xRp5tuoal567GHw7ZyPorQQGgsw3TAWzU6FDdQ$ -------------------------------------------------------------- Dr. James Moran, M.Sc. (Psychology) AG Multisensory Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Telefon: +49-30-2311-1879 https://urldefense.com/v3/__http://www.multisensorymind.com__;!!HJOPV4FYYWzcc1jazlU!-yzVvF4iQScxKe62Q9C9SUcc96denRilioDGJsdsaEpEwlYBFfy040NwKyt99xRp5tuoal567GHw7ZyPorQQGgsw3TAWCi29QDM$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From varghese.mathew at res.christuniversity.in Wed Apr 19 16:27:13 2023 From: varghese.mathew at res.christuniversity.in (Varghese Mathew 1881002) Date: Wed, 19 Apr 2023 19:57:13 +0530 Subject: [FieldTrip] Help with definetrial for EGI .mff file Message-ID: Hi I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message Unrecognized field name "headerfile" . I would like to know how to go about this in EDF or .mff format. It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well. I am pasting the code I used, below. cfg=[] cfg.dataset = 'E:\FT\OP17.mff'; cfg.dataformat = 'egi_mff_v3' cfg.headerformat = 'egi_mff_v3' cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general_stimmod'; cfg = ft_definetrial(cfg) For modifying trialfun_general function [trl, event] = ft_trialfun_general_stimmod(cfg) event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); % Find trigger values trigger = [event(strcmp('stim', {event.type})).value]'; % Note: Replace 'STI101' with the label of the trigger channel that % contains the trigger values for your data % Define trial segments trl = []; for j = 1:length(trigger) if any(trigger(j) == [01 02 03 04]) trlbegin = event(j).sample; trlend = trlbegin + 1000; % define trial length as 1 second offset = 0; % no offset newtrl = [trlbegin trlend offset trigger(j)]; trl = [trl; newtrl]; end end Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background. Looking forward for a response, Sincerely -- Varghese Mathew -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Wed Apr 19 19:40:20 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 19 Apr 2023 17:40:20 +0000 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: Message-ID: Hi Mathew, I am a bit surprised that you think that you need to adjust the ft_trialfun_general. The idea is that this function is quite generic, and given the scenario that you sketch, you probably don’t need to change any fieldtrip function. The partial error that you report is difficult to evaluate, since it’s only partial. Right now it’s just random guessing as to what might be going on. The error looks as if MATLAB tries to access a structure’s field called headerfile, but for some reason in does not exist in the struct that it is evaluating. for instance, if you define on the matlab command line the following struct: x.a = 1; and then query x.b, you get the error you report. What is the full error stack, i.e. which line in which matlab function is throwing the error? And what is the code that you try to execute (i.e. the specification of the cfg, and the fieldtrip function you are calling). Good luck, Jan-Mathijs On 19 Apr 2023, at 16:27, Varghese Mathew 1881002 via fieldtrip > wrote: Hi I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message Unrecognized field name "headerfile" . I would like to know how to go about this in EDF or .mff format. It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well. I am pasting the code I used, below. cfg=[] cfg.dataset = 'E:\FT\OP17.mff'; cfg.dataformat = 'egi_mff_v3' cfg.headerformat = 'egi_mff_v3' cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general_stimmod'; cfg = ft_definetrial(cfg) For modifying trialfun_general function [trl, event] = ft_trialfun_general_stimmod(cfg) event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); % Find trigger values trigger = [event(strcmp('stim', {event.type})).value]'; % Note: Replace 'STI101' with the label of the trigger channel that % contains the trigger values for your data % Define trial segments trl = []; for j = 1:length(trigger) if any(trigger(j) == [01 02 03 04]) trlbegin = event(j).sample; trlend = trlbegin + 1000; % define trial length as 1 second offset = 0; % no offset newtrl = [trlbegin trlend offset trigger(j)]; trl = [trl; newtrl]; end end Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background. Looking forward for a response, Sincerely -- Varghese Mathew _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8eNI3v7br-aNv3JFKJb7V4Q_aWWLR3pG3xSWq653eKc8M3szkc7gmh51AkzytjbLsNllQtMkOdF4QKsVIokOhTwtxZRljnjlhEkwJA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Wed Apr 19 20:16:26 2023 From: julian.keil at gmail.com (Julian Keil) Date: Wed, 19 Apr 2023 20:16:26 +0200 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: Message-ID: Hi Varghese, have you tried reading the .mff with EEGLab? A while ago I worked with some older EGI data and reading directly to FieldTrip didn’t work. Using EEGLab with the MFFMatlabIO extension did the trick, and then you can use eeglab2fieldtrip to move over to FieldTrip. Here’s a link to the code I used, although I did a lot of preprocessing in EEGLab: https://urldefense.com/v3/__https://osf.io/uh5rk__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIi7R5RY6w$ Good Luck, Julian > Am 19.04.2023 um 16:27 schrieb Varghese Mathew 1881002 via fieldtrip : > > Hi > I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message Unrecognized field name "headerfile" . > I would like to know how to go about this in EDF or .mff format. > It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well. > I am pasting the code I used, below. > cfg=[] > cfg.dataset = 'E:\FT\OP17.mff'; > cfg.dataformat = 'egi_mff_v3' > cfg.headerformat = 'egi_mff_v3' > cfg.trialdef.eventtype = 'stim'; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim =1; > cfg.trialdef.eventvalue = {'01''02''03''04'}; > cfg.trialfun = 'ft_trialfun_general_stimmod'; > cfg = ft_definetrial(cfg) > > > For modifying trialfun_general > > function [trl, event] = ft_trialfun_general_stimmod(cfg) > event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); > % Find trigger values > trigger = [event(strcmp('stim', {event.type})).value]'; > % Note: Replace 'STI101' with the label of the trigger channel that > % contains the trigger values for your data > % Define trial segments > trl = []; > for j = 1:length(trigger) > if any(trigger(j) == [01 02 03 04]) > trlbegin = event(j).sample; > trlend = trlbegin + 1000; % define trial length as 1 second > offset = 0; % no offset > newtrl = [trlbegin trlend offset trigger(j)]; > trl = [trl; newtrl]; > end > end > Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background. > Looking forward for a response, > > Sincerely > -- > Varghese Mathew > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIjXO0okaA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From marta.stojanovic at student.uva.nl Fri Apr 21 11:08:48 2023 From: marta.stojanovic at student.uva.nl (=?utf-8?B?TWFydGEgU3RvamFub3ZpxIc=?=) Date: Fri, 21 Apr 2023 09:08:48 +0000 Subject: [FieldTrip] Error with toilim in ft_entropyanalysis Message-ID: <47DC52D6-F510-45E9-AFF6-98AEF5F328BC@student.uva.nl> Hi Fieldtrip community, I’m reaching out with an issue I receive when running ft_entropyanalysis. The error I receive pertains to the trial limits/how a trial is defined using ft_redefinetrial. My data input to ft_entropyanalysis is a raw struct (or rather a dummy raw struct where I reshaped previous output to fit the ft_rawdatatype), with the essential fields of trial, time, and label. My data has 145 trials, so my trial and time fields are 1x145 cells. I parcellated MEG data in my project based on the Brainnetome atlas with 246 parcels, and the trials have 1018 timepoints. The fields in the trial 1x145 cell are therefore 246x1018 doubles, and in the time cell 1x1018 doubles. These shapes of the data should fit the desired input shapes. I receive the following error when I run the function: ‘’’ Index in position 1 exceeds array bounds (must not exceed 1). Error in ft_redefinetrial (line 180) if cfg.toilim(i,1)>data.time{i}(end) || cfg.toilim(i,2) From kloosterman at mpib-berlin.mpg.de Fri Apr 21 12:33:35 2023 From: kloosterman at mpib-berlin.mpg.de (Kloosterman, Niels) Date: Fri, 21 Apr 2023 10:33:35 +0000 Subject: [FieldTrip] =?utf-8?q?Error_with_toilim_in_ft=5Fentropyanalysis_?= =?utf-8?q?=28Marta_Stojanovi=C4=87=29?= In-Reply-To: References: Message-ID: <964034B1-6E89-4199-938F-DEB65E735818@mpib-berlin.mpg.de> Dear Marta, Thanks for your interest in ft_entropyanalysis. To answer your question it would be good to see the exact cfg structure that you used. The lines where your error occurs are for selecting particular timepoints in each trial for computing time-resolved entropy across the trials. For this a time window is selected around this time point and these segments are concatenated. It could be that a time point you requested goes outside the trial when the time window around it is applied. It could also be that your last trial is not complete (check for nans in data.trial{end}). Hope this helps! Best, Niels Dr. Niels Kloosterman Vertretungsprofessor in Algemeine Psychologie und Kognitive Neurowissenschaften Charlotte Fresenius Hochschule Hamburg niels.kloosterman at charlotte-fresenius-uni.de On 21. Apr 2023, at 12:00, fieldtrip-request at science.ru.nl wrote: Caution: This is an external email and may be malicious. Please take care when clicking links or opening attachments. Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit https://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Error with toilim in ft_entropyanalysis (Marta Stojanović) ---------------------------------------------------------------------- Message: 1 Date: Fri, 21 Apr 2023 09:08:48 +0000 From: Marta Stojanović To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Error with toilim in ft_entropyanalysis Message-ID: <47DC52D6-F510-45E9-AFF6-98AEF5F328BC at student.uva.nl> Content-Type: text/plain; charset="utf-8" Hi Fieldtrip community, I’m reaching out with an issue I receive when running ft_entropyanalysis. The error I receive pertains to the trial limits/how a trial is defined using ft_redefinetrial. My data input to ft_entropyanalysis is a raw struct (or rather a dummy raw struct where I reshaped previous output to fit the ft_rawdatatype), with the essential fields of trial, time, and label. My data has 145 trials, so my trial and time fields are 1x145 cells. I parcellated MEG data in my project based on the Brainnetome atlas with 246 parcels, and the trials have 1018 timepoints. The fields in the trial 1x145 cell are therefore 246x1018 doubles, and in the time cell 1x1018 doubles. These shapes of the data should fit the desired input shapes. I receive the following error when I run the function: ‘’’ Index in position 1 exceeds array bounds (must not exceed 1). Error in ft_redefinetrial (line 180) if cfg.toilim(i,1)>data.time{i}(end) || cfg.toilim(i,2) ------------------------------ Subject: Digest Footer _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8ev3VUJGCaaQBEzxwJCYWUi1upzTzwI11Ig_go6UIq7o4B68pQtUhVd9ZMRhyAvIl_z-qraaP6qS1-OE15N4WmK4CKPYaXfyaAUj$ ------------------------------ End of fieldtrip Digest, Vol 149, Issue 14 ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From martastojanovic1 at net.hr Fri Apr 21 12:53:59 2023 From: martastojanovic1 at net.hr (Marta Stojanovic) Date: Fri, 21 Apr 2023 12:53:59 +0200 Subject: [FieldTrip] =?utf-8?q?Error_with_toilim_in_ft=5Fentropyanalysis_?= =?utf-8?q?=28Marta_Stojanovi=C4=87=29?= Message-ID: <20230421125359.FB543D73@net.hr> Hi Niels,   Thanks so much for your reply. I've managed to resolve the issue thanks to Julian Kosciessa's help in the meantime - the error was to do with how I set up cfg.timwin (it was a 2-element rather than 1-element vector for the time window). Thanks a lot for your suggestions nonetheless.   While I no longer receive the error I previously reached out with, I now have another error that I would appreciate your help with:   ''' Index exceeds the number of array elements (0).   Error in ft_entropyanalysis (line 315)             nchan = size(data_sel_unfilt.trial{1},1); '''   data_sel_unfilt is equal to the output of redefining the data using ft_redefinetrial: data_sel_unfilt = ft_redefinetrial(tmp cfg,data), line 299 in ft_entropyanalysis. My size(data_sel_unfilt.trial{1},1) is equal to 246 (the number of parcels).   I'm not sure why the number of array elements is 0 or where in the code to check that.   Thanks, Best, Marta ______________________________________________________________ > Od: "Kloosterman, Niels via fieldtrip" > Za: "fieldtrip at science.ru.nl" > Datum: 21.04.2023 12:35 > Naslov: Re: [FieldTrip] Error with toilim in ft_entropyanalysis (Marta Stojanović) > Dear Marta,Thanks for your interest in ft_entropyanalysis. To answer your question it would be good to see the exact cfg structure that you used. The lines where your error occurs are for selecting particular timepoints in each trial for computing time-resolved entropy across the trials. For this a time window is selected around this time point and these segments are concatenated. It could be that a time point you requested goes outside the trial when the time window around it is applied. It could also be that your last trial is not complete (check for nans in data.trial{end}).    Hope this helps!Best,NielsDr. Niels KloostermanVertretungsprofessor in Algemeine Psychologie und Kognitive NeurowissenschaftenCharlotte Fresenius Hochschule Hamburgniels.kloosterman at charlotte-fresenius-uni.de On 21. Apr 2023, at 12:00, fieldtrip-request at science.ru.nl wrote: Caution: This is an external email and may be malicious. Please take care when clicking links or opening attachments. Send fieldtrip mailing list submissions to        fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to        fieldtrip-request at science.ru.nl You can reach the person managing the list at        fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics:   1. Error with toilim in ft_entropyanalysis (Marta Stojanović) ---------------------------------------------------------------------- Message: 1 Date: Fri, 21 Apr 2023 09:08:48 +0000 From: Marta Stojanović To: "fieldtrip at science.ru.nl" Subject: [FieldTrip] Error with toilim in ft_entropyanalysis Message-ID: <47DC52D6-F510-45E9-AFF6-98AEF5F328BC at student.uva.nl> Content-Type: text/plain; charset="utf-8" Hi Fieldtrip community, I’m reaching out with an issue I receive when running ft_entropyanalysis. The error I receive pertains to the trial limits/how a trial is defined using ft_redefinetrial. My data input to ft_entropyanalysis is a raw struct (or rather a dummy raw struct where I reshaped previous output to fit the ft_rawdatatype), with the essential fields of trial, time, and label. My data has 145 trials, so my trial and time fields are 1x145 cells. I parcellated MEG data in my project based on the Brainnetome atlas with 246 parcels, and the trials have 1018 timepoints. The fields in the trial 1x145 cell are therefore 246x1018 doubles, and in the time cell 1x1018 doubles. These shapes of the data should fit the desired input shapes. I receive the following error when I run the function: ‘’’ Index in position 1 exceeds array bounds (must not exceed 1). Error in ft_redefinetrial (line 180)    if cfg.toilim(i,1)>data.time{i}(end) ||    cfg.toilim(i,2) ------------------------------ End of fieldtrip Digest, Vol 149, Issue 14 ****************************************** ---------- _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5grw-9pmw6cp_lD6dRSdtwJxiTi7gJbo5dHBe7xbJmHm8_8Em2wmjVWuX5Fuzqu9AMwaTYgcaBK5UDJs6hAdINmEgeeT5Ks$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From varghese.mathew at res.christuniversity.in Sat Apr 22 06:33:44 2023 From: varghese.mathew at res.christuniversity.in (Varghese Mathew 1881002) Date: Sat, 22 Apr 2023 10:03:44 +0530 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: Message-ID: Thank you so much for the response. I have tried using ft_trialfun_general in the following code datapath='E:\FT\OFP1.mff' EGIformat= 'egi_mff_v3' cfg = []; cfg.dataset = datapath; cfg.dataformat = EGIformat cfg.headerformat = EGIformat cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general'; cfg = ft_definetrial(cfg) I am getting a following response Error using ft_definetrial no trials were defined, see FT_DEFINETRIAL for help This made me think if I should change the trialfun_general. Is there something I have missed and also is there any standard format to define trials on Netstation files (.mff)? Thank you again for the response. Sincerely Varghese Mathew On Wed, Apr 19, 2023 at 11:12 PM Schoffelen, J.M. (Jan Mathijs) via fieldtrip wrote: > Hi Mathew, > > I am a bit surprised that you think that you need to adjust the > ft_trialfun_general. The idea is that this function is quite generic, and > given the scenario that you sketch, you probably don’t need to change any > fieldtrip function. The partial error that you report is difficult to > evaluate, since it’s only partial. Right now it’s just random guessing as > to what might be going on. The error looks as if MATLAB tries to access a > structure’s field called headerfile, but for some reason in does not exist > in the struct that it is evaluating. > > for instance, if you define on the matlab command line the following > struct: > > x.a = 1; > > and then query x.b, you get the error you report. > > What is the full error stack, i.e. which line in which matlab function is > throwing the error? And what is the code that you try to execute (i.e. the > specification of the cfg, and the fieldtrip function you are calling). > > Good luck, > Jan-Mathijs > > > On 19 Apr 2023, at 16:27, Varghese Mathew 1881002 via fieldtrip < > fieldtrip at science.ru.nl> wrote: > > Hi > I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have > tried using .mff file directly and after converting to EDF. However, I am > getting error in defining trials. Mostly I get an error message Unrecognized > field name "headerfile" . > I would like to know how to go about this in EDF or .mff format. > It will also be helpful if someone can help with how to modify > ft_trialfun_general for .mff file as well. > I am pasting the code I used, below. > cfg=[] > cfg.dataset = 'E:\FT\OP17.mff'; > cfg.dataformat = 'egi_mff_v3' > cfg.headerformat = 'egi_mff_v3' > cfg.trialdef.eventtype = 'stim'; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim =1; > cfg.trialdef.eventvalue = {'01''02''03''04'}; > cfg.trialfun = 'ft_trialfun_general_stimmod'; > cfg = ft_definetrial(cfg) > > > For modifying trialfun_general > > function [trl, event] = ft_trialfun_general_stimmod(cfg) > event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); > % Find trigger values > trigger = [event(strcmp('stim', {event.type})).value]'; > % Note: Replace 'STI101' with the label of the trigger channel that > % contains the trigger values for your data > % Define trial segments > trl = []; > for j = 1:length(trigger) > if any(trigger(j) == [01 02 03 04]) > trlbegin = event(j).sample; > trlend = trlbegin + 1000; % define trial length as 1 second > offset = 0; % no offset > newtrl = [trlbegin trlend offset trigger(j)]; > trl = [trl; newtrl]; > end > end > Please help with the issue, as I am trying to pick up analysis using > Fieldtrip and I do not have a coding background. > Looking forward for a response, > > Sincerely > -- > Varghese Mathew > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8eNI3v7br-aNv3JFKJb7V4Q_aWWLR3pG3xSWq653eKc8M3szkc7gmh51AkzytjbLsNllQtMkOdF4QKsVIokOhTwtxZRljnjlhEkwJA$ > > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!_9NGX1FdVvV4Pdgiy8ysA_I5wM3SCcL_XPNdsdJK726UVos8SXmZ_ywxEgeNUPtvZSHD1JXL9M5YGNoofKVf7XKoo0QYpJlEKwWN3uy7PCax$ > -- Varghese Mathew Mobile No. 9535395896 -------------- next part -------------- An HTML attachment was scrubbed... URL: From varghese.mathew at res.christuniversity.in Sat Apr 22 06:42:06 2023 From: varghese.mathew at res.christuniversity.in (Varghese Mathew 1881002) Date: Sat, 22 Apr 2023 10:12:06 +0530 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: Message-ID: Thank you so much for the suggestion and code. I will try this out. I am just getting used to understanding the codes and this will help. Sincerely On Wed, Apr 19, 2023 at 11:48 PM Julian Keil via fieldtrip < fieldtrip at science.ru.nl> wrote: > Hi Varghese, > > have you tried reading the .mff with EEGLab? > A while ago I worked with some older EGI data and reading directly to > FieldTrip didn’t work. Using EEGLab with the MFFMatlabIO extension did the > trick, and then you can use eeglab2fieldtrip to move over to FieldTrip. > Here’s a link to the code I used, although I did a lot of preprocessing in > EEGLab: https://urldefense.com/v3/__https://osf.io/uh5rk__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KBa_J9YQ$ > > > Good Luck, > > Julian > > Am 19.04.2023 um 16:27 schrieb Varghese Mathew 1881002 via fieldtrip < > fieldtrip at science.ru.nl>: > > Hi > I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have > tried using .mff file directly and after converting to EDF. However, I am > getting error in defining trials. Mostly I get an error message Unrecognized > field name "headerfile" . > I would like to know how to go about this in EDF or .mff format. > It will also be helpful if someone can help with how to modify > ft_trialfun_general for .mff file as well. > I am pasting the code I used, below. > cfg=[] > cfg.dataset = 'E:\FT\OP17.mff'; > cfg.dataformat = 'egi_mff_v3' > cfg.headerformat = 'egi_mff_v3' > cfg.trialdef.eventtype = 'stim'; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim =1; > cfg.trialdef.eventvalue = {'01''02''03''04'}; > cfg.trialfun = 'ft_trialfun_general_stimmod'; > cfg = ft_definetrial(cfg) > > > For modifying trialfun_general > > function [trl, event] = ft_trialfun_general_stimmod(cfg) > event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); > % Find trigger values > trigger = [event(strcmp('stim', {event.type})).value]'; > % Note: Replace 'STI101' with the label of the trigger channel that > % contains the trigger values for your data > % Define trial segments > trl = []; > for j = 1:length(trigger) > if any(trigger(j) == [01 02 03 04]) > trlbegin = event(j).sample; > trlend = trlbegin + 1000; % define trial length as 1 second > offset = 0; % no offset > newtrl = [trlbegin trlend offset trigger(j)]; > trl = [trl; newtrl]; > end > end > Please help with the issue, as I am trying to pick up analysis using > Fieldtrip and I do not have a coding background. > Looking forward for a response, > > Sincerely > -- > Varghese Mathew > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KNN_tQeI$ > > > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KNN_tQeI$ > -- Varghese Mathew Mobile No. 9535395896 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikexcohen at gmail.com Sat Apr 22 12:09:35 2023 From: mikexcohen at gmail.com (Mike X Cohen) Date: Sat, 22 Apr 2023 11:09:35 +0100 Subject: [FieldTrip] Course announcements: Neural time series and multivariate analyses Message-ID: Dear friends and colleagues, I am pleased to announce my new, shiny, improved summer schools! This year in the alluring Bucharest (Romania). *** NEW THIS YEAR *** I have developed several lectures and demos on integrating ChatGPT-4 (and AI-assistance more generally) into coding, writing, and analysis. Both summer-school courses include new discussions and coding/writing exercises aimed at effective and ethical use of ChatGPT in neuroscience research and data analysis. *** I will teach two separate week-long courses on neuroscience data analysis: One about time-frequency/synchronization/statistics (*note: this same course is offered twice due to popular demand!*), and one about linear algebra and dimension-reduction/source-separation. Below is the direct link to the course pages with application information. Please pass this link around to your colleagues/students who might be interested in one or both of these courses. https://urldefense.com/v3/__https://sincxpress.com/summerschool.html__;!!HJOPV4FYYWzcc1jazlU!5f2zQJ0fzspFANAifFIGAe_fdngNVA3AGByJu5IXBjfL4mkLIKOti4rlWMroITk4KGqWRLXoSVTtkUWZLUdNSSh7$ Analyzing neural time series data (26-30 June *AND* 14-18 August). Fourier transform, convolution, time-frequency analysis, synchronization, nonparametric statistics, simulating time series data. (Note: the August session is recommended for people taking both courses.) Linear algebra for neuroscientists (21-25 August). Matrix algebra, least-squares model fitting, eigendecomposition, multivariate source separation, simulating multicomponent and multichannel time series data. https://urldefense.com/v3/__https://sincxpress.com/summerschool.html__;!!HJOPV4FYYWzcc1jazlU!5f2zQJ0fzspFANAifFIGAe_fdngNVA3AGByJu5IXBjfL4mkLIKOti4rlWMroITk4KGqWRLXoSVTtkUWZLUdNSSh7$ Please note that applications, if accepted, are selected on a first-come-first-serve basis, and that the number of participants for each course is limited to 30. The courses are currently filling up but are not yet at capacity. If you have questions about the courses, please feel free to contact me. I look forward to welcoming you to Bucharest this summer! -- Mike X Cohen, PhD Fresh look: mikexcohen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mansourehfahimi at gmail.com Mon Apr 24 13:18:21 2023 From: mansourehfahimi at gmail.com (Mansoureh Fahimi) Date: Mon, 24 Apr 2023 12:18:21 +0100 Subject: [FieldTrip] SPM M/EEG Course May/June 2023 - reminder Message-ID: Dear colleagues, Please find below a reminder for the SPM for MEG/EEG course this year! We are pleased to announce our biannual *SPM for MEG/EEG* this year which is hosted by University College London and will take place from *Tuesday, May 30 to Friday, 2nd of June, 2023.* The course will be held in person at Queen Square, London, UK (exact details to be announced). This is the first in-person edition of the course after the COVID-19 pandemic, and we will aim to organize one in-person event per year from now on. The course will present instructions on the analysis of MEG and EEG data. The first three days will combine theoretical presentations with practical demonstrations of the different data analysis methods implemented in SPM. On the last day, participants will have the opportunity to work on SPM tutorial data sets or on their own data under the supervision of the course faculty. A social event for all participants will also be organized on Wednesday evening. The course is suitable for both beginners and more advanced users. The topics that will be covered range from pre-processing and statistical analysis to source localization and dynamic causal modelling. Registration is now open. For full details see D07 Statistical Parametric Mapping For MEG/EEG 2023 | UCL Online Store where you can also register. Registration includes lunch and refreshments, and the social event. Wearing a face mask is not mandatory, but will be provided for those who want to wear one. Available places are limited so please register as early as possible if you would like to attend! The registration fee is £400 for students and £600 for standard participants. We are looking forward to meeting you in person, The SPM M/EEG course team -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Mon Apr 24 14:31:41 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 24 Apr 2023 12:31:41 +0000 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: Message-ID: <4E22B6C8-1A20-4612-83C4-753B8D8EE359@donders.ru.nl> Hi Mathew, Thanks for the additional information. Note that ft_definetrial/ft_trialfun_general will only work according to expectation if eventtype and eventvalue are correctly specified. Their correct specification depends on how the events and their values are represented in the data file. This is something I don’t know for the format you use, but it could be that ’stim’ should read ’Stim’, and/or that the event values ahould be numeric( e.g., [1 2 3 4], rather than {’01’ ’02’ ’03’ ’04’}. If you are unsure about how values/types should be defined for your data, you should use the ft_trialfun_show function: datapath='E:\FT\OFP1.mff' EGIformat= 'egi_mff_v3' cfg = []; cfg.dataset = datapath; cfg.dataformat = EGIformat cfg.headerformat = EGIformat cfg.trialfun = 'ft_trialfun_general’; cfg=ft_definetrial(cfg); This will give you some feedback on the screen, which you can use for a properly formatted call to ft_definetrial with trialfun = ‘ft_trialfun_general’ Good luck, Jan-Mathijs On 22 Apr 2023, at 06:33, Varghese Mathew 1881002 > wrote: Thank you so much for the response. I have tried using ft_trialfun_general in the following code datapath='E:\FT\OFP1.mff' EGIformat= 'egi_mff_v3' cfg = []; cfg.dataset = datapath; cfg.dataformat = EGIformat cfg.headerformat = EGIformat cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general'; cfg = ft_definetrial(cfg) I am getting a following response Error using ft_definetrial no trials were defined, see FT_DEFINETRIAL for help This made me think if I should change the trialfun_general. Is there something I have missed and also is there any standard format to define trials on Netstation files (.mff)? Thank you again for the response. Sincerely Varghese Mathew On Wed, Apr 19, 2023 at 11:12 PM Schoffelen, J.M. (Jan Mathijs) via fieldtrip > wrote: Hi Mathew, I am a bit surprised that you think that you need to adjust the ft_trialfun_general. The idea is that this function is quite generic, and given the scenario that you sketch, you probably don’t need to change any fieldtrip function. The partial error that you report is difficult to evaluate, since it’s only partial. Right now it’s just random guessing as to what might be going on. The error looks as if MATLAB tries to access a structure’s field called headerfile, but for some reason in does not exist in the struct that it is evaluating. for instance, if you define on the matlab command line the following struct: x.a = 1; and then query x.b, you get the error you report. What is the full error stack, i.e. which line in which matlab function is throwing the error? And what is the code that you try to execute (i.e. the specification of the cfg, and the fieldtrip function you are calling). Good luck, Jan-Mathijs On 19 Apr 2023, at 16:27, Varghese Mathew 1881002 via fieldtrip > wrote: Hi I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message Unrecognized field name "headerfile" . I would like to know how to go about this in EDF or .mff format. It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well. I am pasting the code I used, below. cfg=[] cfg.dataset = 'E:\FT\OP17.mff'; cfg.dataformat = 'egi_mff_v3' cfg.headerformat = 'egi_mff_v3' cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general_stimmod'; cfg = ft_definetrial(cfg) For modifying trialfun_general function [trl, event] = ft_trialfun_general_stimmod(cfg) event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); % Find trigger values trigger = [event(strcmp('stim', {event.type})).value]'; % Note: Replace 'STI101' with the label of the trigger channel that % contains the trigger values for your data % Define trial segments trl = []; for j = 1:length(trigger) if any(trigger(j) == [01 02 03 04]) trlbegin = event(j).sample; trlend = trlbegin + 1000; % define trial length as 1 second offset = 0; % no offset newtrl = [trlbegin trlend offset trigger(j)]; trl = [trl; newtrl]; end end Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background. Looking forward for a response, Sincerely -- Varghese Mathew _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8eNI3v7br-aNv3JFKJb7V4Q_aWWLR3pG3xSWq653eKc8M3szkc7gmh51AkzytjbLsNllQtMkOdF4QKsVIokOhTwtxZRljnjlhEkwJA$ _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8_wC7u9_KaczcCnCf3ooRNrWX-mbD7Ns99LEi4vjEAQfIIMMokruDHPkk3MEBAu3USnzvZS29jZLrWyi5M6bLWFQcKFnUrlvo5-b3Q$ -- Varghese Mathew Mobile No. 9535395896 -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Mon Apr 24 14:41:56 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Mon, 24 Apr 2023 12:41:56 +0000 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: <4E22B6C8-1A20-4612-83C4-753B8D8EE359@donders.ru.nl> References: <4E22B6C8-1A20-4612-83C4-753B8D8EE359@donders.ru.nl> Message-ID: apologies for the multiple postings: i made a typo in my previous message: the line that reads ’ft_trialfun_general’, should of course read ’ft_trialfun_show’. Best wishes, Jan-Mathijs On 24 Apr 2023, at 14:31, Jan Mathijs Schoffelen > wrote: Hi Mathew, Thanks for the additional information. Note that ft_definetrial/ft_trialfun_general will only work according to expectation if eventtype and eventvalue are correctly specified. Their correct specification depends on how the events and their values are represented in the data file. This is something I don’t know for the format you use, but it could be that ’stim’ should read ’Stim’, and/or that the event values ahould be numeric( e.g., [1 2 3 4], rather than {’01’ ’02’ ’03’ ’04’}. If you are unsure about how values/types should be defined for your data, you should use the ft_trialfun_show function: datapath='E:\FT\OFP1.mff' EGIformat= 'egi_mff_v3' cfg = []; cfg.dataset = datapath; cfg.dataformat = EGIformat cfg.headerformat = EGIformat cfg.trialfun = 'ft_trialfun_general’; cfg=ft_definetrial(cfg); This will give you some feedback on the screen, which you can use for a properly formatted call to ft_definetrial with trialfun = ‘ft_trialfun_general’ Good luck, Jan-Mathijs On 22 Apr 2023, at 06:33, Varghese Mathew 1881002 > wrote: Thank you so much for the response. I have tried using ft_trialfun_general in the following code datapath='E:\FT\OFP1.mff' EGIformat= 'egi_mff_v3' cfg = []; cfg.dataset = datapath; cfg.dataformat = EGIformat cfg.headerformat = EGIformat cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general'; cfg = ft_definetrial(cfg) I am getting a following response Error using ft_definetrial no trials were defined, see FT_DEFINETRIAL for help This made me think if I should change the trialfun_general. Is there something I have missed and also is there any standard format to define trials on Netstation files (.mff)? Thank you again for the response. Sincerely Varghese Mathew On Wed, Apr 19, 2023 at 11:12 PM Schoffelen, J.M. (Jan Mathijs) via fieldtrip > wrote: Hi Mathew, I am a bit surprised that you think that you need to adjust the ft_trialfun_general. The idea is that this function is quite generic, and given the scenario that you sketch, you probably don’t need to change any fieldtrip function. The partial error that you report is difficult to evaluate, since it’s only partial. Right now it’s just random guessing as to what might be going on. The error looks as if MATLAB tries to access a structure’s field called headerfile, but for some reason in does not exist in the struct that it is evaluating. for instance, if you define on the matlab command line the following struct: x.a = 1; and then query x.b, you get the error you report. What is the full error stack, i.e. which line in which matlab function is throwing the error? And what is the code that you try to execute (i.e. the specification of the cfg, and the fieldtrip function you are calling). Good luck, Jan-Mathijs On 19 Apr 2023, at 16:27, Varghese Mathew 1881002 via fieldtrip > wrote: Hi I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message Unrecognized field name "headerfile" . I would like to know how to go about this in EDF or .mff format. It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well. I am pasting the code I used, below. cfg=[] cfg.dataset = 'E:\FT\OP17.mff'; cfg.dataformat = 'egi_mff_v3' cfg.headerformat = 'egi_mff_v3' cfg.trialdef.eventtype = 'stim'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim =1; cfg.trialdef.eventvalue = {'01''02''03''04'}; cfg.trialfun = 'ft_trialfun_general_stimmod'; cfg = ft_definetrial(cfg) For modifying trialfun_general function [trl, event] = ft_trialfun_general_stimmod(cfg) event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); % Find trigger values trigger = [event(strcmp('stim', {event.type})).value]'; % Note: Replace 'STI101' with the label of the trigger channel that % contains the trigger values for your data % Define trial segments trl = []; for j = 1:length(trigger) if any(trigger(j) == [01 02 03 04]) trlbegin = event(j).sample; trlend = trlbegin + 1000; % define trial length as 1 second offset = 0; % no offset newtrl = [trlbegin trlend offset trigger(j)]; trl = [trl; newtrl]; end end Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background. Looking forward for a response, Sincerely -- Varghese Mathew _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8eNI3v7br-aNv3JFKJb7V4Q_aWWLR3pG3xSWq653eKc8M3szkc7gmh51AkzytjbLsNllQtMkOdF4QKsVIokOhTwtxZRljnjlhEkwJA$ _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!_GGSSfpdqUVSSa9hQHt7yETrA52ddHpoPl5XyDulshwz6P9RCV8rz4RVx7XfwoHcYJufCFb4VmhqGDIg_cIdXe19JMLcwOdRxdbYNQ$ -- Varghese Mathew Mobile No. 9535395896 -------------- next part -------------- An HTML attachment was scrubbed... URL: From hasnae.AGOURAM at univ-amu.fr Mon Apr 24 16:03:28 2023 From: hasnae.AGOURAM at univ-amu.fr (AGOURAM Hasnae) Date: Mon, 24 Apr 2023 14:03:28 +0000 Subject: [FieldTrip] How to detect the artifacts in continuous eeg data prior to segmenting with Fieldtrip Message-ID: Hi Fieldtrip community, I have a question regarding the artifcat identification based on continouis data prior to epoching (because I am not going to epoch my data ). In this case I can not use the function ft_rejectvisual, which is specific to epoched data, but I am going to use ft_databrowser () to mark the artifact segements. I use the following code: % Define the configuration for the data browser cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'yes'; cfg.artfctdef.visual.artifact = 1; % enable artifact marking mode cfg.artfctdef.visual.continuous = 'yes'; % mark continuous segments cfg.artfctdef.visual.channel = {'all'}; % mark artifacts across all channels cfg.artfctdef.visual.feedback = 'yes'; % show the marked artifacts % Launch the data browser and mark segments with artifacts cfg.artfctdef.reject = 'complete'; % mark complete segments as artifacts cfg = ft_databrowser(cfg, data); % Retrieve the marked artifacts artifacts = cfg.artfctdef.visual.artifact; But, I have an error : Output argument "trl" (and possibly others) not assigned a value in the execution with "artifact2trl" function. Before epoching, has anyone tried to reject artifacts using continuous data. Do you have any insight into this error? Many thanks, Hasnae AGOURAM -------------- next part -------------- An HTML attachment was scrubbed... URL: From z65.juhasz at gmail.com Tue Apr 25 09:12:12 2023 From: z65.juhasz at gmail.com (Zoltan Juhasz) Date: Tue, 25 Apr 2023 09:12:12 +0200 Subject: [FieldTrip] Special Issue: Special Issue in Computational Challenges of High-Density Biosensor Data Analysis (Sensors, IF:3.847) Message-ID: Special Issue: Special Issue in Computational Challenges of High-Density Biosensor Data Analysis URL: https://urldefense.com/v3/__https://www.mdpi.com/journal/sensors/special_issues/877773G6P8__;!!HJOPV4FYYWzcc1jazlU!9FgzDtgle6n5DzBFQjFccYg39Ck6A8pP9eePIyJ3ZD6VTaSDjhyKesYeka83pYEaRSwXjljxVI1wzUDCY0qtwYee$ Journal: Sensors (IF:3.847) Dear Colleagues, This Special Issue aims to solicit research papers addressing the computational challenges of modern, high-density biosensor data processing. The proliferation of high-density biosensor (EEG, MEG, EMG, ECoG, fNIRS) measurement systems present growing problems in data analysis due to the increases in dataset size. Routine analysis is typically performed by scripting environments and algorithms originally designed for single-core computing systems that cannot fully utilize the capabilities of modern computing systems. The aim of this Special Issue is to explore how the fundamental changes in computer architecture (multi-core revolution, GPU and FPGA accelerators, cloud computing, supercomputers) affect multi-sensor biosignal data processing. This Issue welcomes original research articles and review papers that - demonstrate the efficient use of these new data processing techniques, - analysis algorithms, and - novel data analysis system architecture designs that demonstrate efficient use of multi-core, GPU, cloud, and other HPC systems. - Case studies of very large dataset analysis studies, - implementations using accelerators and/or HPC systems, - performance analysis of advanced signal processing methods, and - reports on clinical application experiments are especially welcome. Dr. Zoltan Juhasz Dr. Istvan Vassanyi Guest Editors -------------- next part -------------- An HTML attachment was scrubbed... URL: From yiye at eln.upv.es Tue Apr 25 09:50:31 2023 From: yiye at eln.upv.es (yiye at eln.upv.es) Date: Tue, 25 Apr 2023 09:50:31 +0200 Subject: [FieldTrip] Leadfield magnitude with openmeeg method Message-ID: <005301d9774a$9c7181b0$d5548510$@eln.upv.es> Dear Colleagues, I attempted to solve volumen conduction problem for another organ rather than brain using openmeeg method. The geometry was expressed in mm. As for conductivity, the leadfield value (magnitude order 10^-5) was about 1000 times higher than expected when I introduced the tissue conductivity in siemen/metre. Then I thought that maybe I should express the conductivity in siemens/mm, and multiplied by 0.001 the tissue conductivity, curiosly the leadfield value increased 1000 times (magnitude order 10^-2). Analogly, when I multiplied by 1000 the tissue conductivity, the leadfield decreased 1000 times (magnitude order 10^-8). This phenomenon is very strange because I expected to have higher surface potential for higher tissue conductivity. The last experiment I did is that I set the tissue resistivity in ohmio.meter in tissue conductivity field, the leadfield value was in expected range. The surface potential distribution I obtained was physically interpretable, the surface potential amplitude is the unique issue that generating confusion. How should I set the tissue conductivity of ft_prepare_headmodel when using openmeeg method? Best regards ********************************** Yiyao Ye Lin Universitat Politècnica de València, Departamento de Ingeniería Electrónica, Ed, 7F, 4 planta, 46022, València, València, España -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjy.barnett.20 at ucl.ac.uk Tue Apr 25 14:12:07 2023 From: benjy.barnett.20 at ucl.ac.uk (Barnett, Benjy) Date: Tue, 25 Apr 2023 12:12:07 +0000 Subject: [FieldTrip] Trial by Trial Source Reconstruction for Decoding Message-ID: Hi all, I’m trying to implement some MVPA decoding analyses in source space using MEG data collected on a CTF system. I have gone through different tutorials to perform the source reconstruction (namely https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/__;!!HJOPV4FYYWzcc1jazlU!6dJY9xn9eTEqqGoXULa_OMBzAvS3Cl7jDWxpxhESR-a61x1hEJWt38h4sKsVfLMoG9DIkPTj6qamNi18fKgf9dtYDIaRLfHvTw$ ; https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/__;!!HJOPV4FYYWzcc1jazlU!6dJY9xn9eTEqqGoXULa_OMBzAvS3Cl7jDWxpxhESR-a61x1hEJWt38h4sKsVfLMoG9DIkPTj6qamNi18fKgf9dtYDIZKqhJFug$ ). To train my decoder, I will obviously need trial by trial activity estimates for each of the virtual channels. The issue is that these tutorials, and most other information I can find, only go into how to extract condition-level source estimates. I have an idea of how to do this for individual trials, but it’s such a shift from the tutorials I wondered if I could check whether my plan will work conceptually and technically. My current code (to obtain condition level estimates) is as follows: % Compute Covariance Matrix cfg = []; cfg.covariance = 'yes'; avg = ft_timelockanalysis(cfg,meg_data); %meg_data = datazero + datanotzero; cfg.keeptrials = 'yes'; avgzero = ft_timelockanalysis(cfg,datazero); %condition 1 = ‘zero' avgnotzero = ft_timelockanalysis(cfg,datanotzero); %condition 2 = ’not zero' %Calculate spatial filter for each voxel over all data cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.headmodel = headmodel_new; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.lambda = '5%'; cfg.lcmv.weightnorm = 'unitnoisegain'; cfg.lcmv.fixedori = 'yes'; cfg.channel = {'MEG'}; cfg.senstype = 'MEG'; sourceavg = ft_sourceanalysis(cfg, avg); %compute filters over all trials %Now apply this filter to zero and not-zero data separately cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.sourcemodel.filter = sourceavg.avg.filter; cfg.headmodel = headmodel_new; sourcezero = ft_sourceanalysis(cfg, avgzero); sourcenotzero = ft_sourceanalysis(cfg, avgnotzero); Would I be correct to simply alter this pipeline so that I perform the call to ft_timelockanalysis and estimate the covariance matrix for each trial individually, rather than each condition? Then I was planning to simply run the ft_sourceanalysis function on each of these trials individually, keeping track of which trial belongs to which condition for later use in decoding. I can then go into the source output from the sourceanalysis and extract the .mom field to get the virtual channel data per trial, which I plan to then enter into the decoder. Does this make sense conceptually? It seems a logical step from the beamforming of condition level signals, but I’ve come to learn it’s rarely that simple! I hope that all makes sense, Benjy -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjy.barnett.20 at ucl.ac.uk Tue Apr 25 14:32:46 2023 From: benjy.barnett.20 at ucl.ac.uk (Barnett, Benjy) Date: Tue, 25 Apr 2023 12:32:46 +0000 Subject: [FieldTrip] Trial by Trial Source Reconstruction for Decoding In-Reply-To: References: Message-ID: Sorry for multiple posting, please ignore - I have just noticed the cfg.rawtrials option in ft_sourceanalysis, which makes this much simpler. Thank you On Apr 25, 2023, at 1:12 PM, Barnett, Benjy via fieldtrip > wrote: ⚠ Caution: External sender Hi all, I’m trying to implement some MVPA decoding analyses in source space using MEG data collected on a CTF system. I have gone through different tutorials to perform the source reconstruction (namely https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/__;!!HJOPV4FYYWzcc1jazlU!4HiCPnTY4ZHLBQO-35S-qTzf4nEOOD1IKhyJGLDYrHsrcjodns47ZrpV1HfVBgHidCK45KCLe79g6tzsGhQWqnFMt5BoIWV1xA$ ; https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/__;!!HJOPV4FYYWzcc1jazlU!4HiCPnTY4ZHLBQO-35S-qTzf4nEOOD1IKhyJGLDYrHsrcjodns47ZrpV1HfVBgHidCK45KCLe79g6tzsGhQWqnFMt5DgySA0Xg$ ). To train my decoder, I will obviously need trial by trial activity estimates for each of the virtual channels. The issue is that these tutorials, and most other information I can find, only go into how to extract condition-level source estimates. I have an idea of how to do this for individual trials, but it’s such a shift from the tutorials I wondered if I could check whether my plan will work conceptually and technically. My current code (to obtain condition level estimates) is as follows: % Compute Covariance Matrix cfg = []; cfg.covariance = 'yes'; avg = ft_timelockanalysis(cfg,meg_data); %meg_data = datazero + datanotzero; cfg.keeptrials = 'yes'; avgzero = ft_timelockanalysis(cfg,datazero); %condition 1 = ‘zero' avgnotzero = ft_timelockanalysis(cfg,datanotzero); %condition 2 = ’not zero' %Calculate spatial filter for each voxel over all data cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.headmodel = headmodel_new; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.lambda = '5%'; cfg.lcmv.weightnorm = 'unitnoisegain'; cfg.lcmv.fixedori = 'yes'; cfg.channel = {'MEG'}; cfg.senstype = 'MEG'; sourceavg = ft_sourceanalysis(cfg, avg); %compute filters over all trials %Now apply this filter to zero and not-zero data separately cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.sourcemodel.filter = sourceavg.avg.filter; cfg.headmodel = headmodel_new; sourcezero = ft_sourceanalysis(cfg, avgzero); sourcenotzero = ft_sourceanalysis(cfg, avgnotzero); Would I be correct to simply alter this pipeline so that I perform the call to ft_timelockanalysis and estimate the covariance matrix for each trial individually, rather than each condition? Then I was planning to simply run the ft_sourceanalysis function on each of these trials individually, keeping track of which trial belongs to which condition for later use in decoding. I can then go into the source output from the sourceanalysis and extract the .mom field to get the virtual channel data per trial, which I plan to then enter into the decoder. Does this make sense conceptually? It seems a logical step from the beamforming of condition level signals, but I’ve come to learn it’s rarely that simple! I hope that all makes sense, Benjy _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!4HiCPnTY4ZHLBQO-35S-qTzf4nEOOD1IKhyJGLDYrHsrcjodns47ZrpV1HfVBgHidCK45KCLe79g6tzsGhQWqnFMt5BvVIyIiw$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.kaskan at einsteinmed.edu Tue Apr 25 23:06:13 2023 From: peter.kaskan at einsteinmed.edu (Peter Kaskan) Date: Tue, 25 Apr 2023 21:06:13 +0000 Subject: [FieldTrip] re-referencing using neuralynx.csc channels In-Reply-To: References: Message-ID: Thanks for your help Jan-Matijs, I implemented your corrected loop and I am now reading in multiple .csc channels using       alldata = ft_appenddata([], data{:}); I think I read somewhere that one should define re-referencing before running ft_preprocessing. However, ft_preprocessing occurs within this loop: for k = 1:numel(channellist) cfg.dataset = sprintf('%s.ncs',channellist{k}); data{k} = ft_preprocessing(cfg); end It seems like I should insert this in the loop (above, before ft_preprocessing), because I want to use channel 84 as a reference for each channel. cfg.reref = 'yes'; cfg.refchannel = 'CSC84.ncs'; But this construction throws errors: Error using preproc (line 279) reference channel was not found Error in ft_preprocessing (line 599) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Any guidance you can provide? Thank you! ------------------------------ Message: 2 Date: Tue, 11 Apr 2023 20:30:18 +0000 From: Peter Kaskan To: "fieldtrip at science.ru.nl" Subject: Re: [FieldTrip] fieldtrip Digest, Vol 148, Issue 24 Hello Jan-Mathijs, Thanks for the reply; I was traveling and just got back to this... In my initial, very rudimentary preprocessing script, cfg.dataset will take a single neuralynx file:       cfg.dataset = 'CSC4.ncs'; cfg.continuous = 'yes'; highpass, lowlass, demean, detrend etc.. filtContData = ft_preprocessing(cfg); But the question was how to reference one channel with another. I have been trying to implement your channellist and appenddata suggestion as you describe (below) using channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} and the subsequent data loop. However, my initial attempt left some errors related to Error using ft_checkconfig (line 163) The field cfg.datafile is required The field cfg.headerfile is required Error in ft_preprocessing (line 385)       cfg = ft_checkconfig(cfg, 'required', {'headerfile', 'datafile'}); After digging a little further in ft_preprocessing lines 446-447 % translate the channel groups (like 'all' and 'MEG') into real labels cfg.channel = ft_channelselection(cfg.channel, hdr); assert(~isempty(cfg.channel), 'the selection of channels is empty'); ... we rescued the error by resetting cfg.channel = CSC1.ncs; Do you know what is happening? If we use: channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} does the cfg.datafile and cfg.headerfile need to be defined some other way? Thanks, Peter ________________________________ From: fieldtrip on behalf of fieldtrip-request at science.ru.nl Sent: Monday, March 27, 2023 6:00 AM Hi Peter, ft_read_data is a so-called ‘intermediate’ level fieldtrip function and not typically called directly by the casual user. I think your use case calls for the following strategy: channellist = {‘channel1’;’channel2’;…’channelN’}; for k = 1:numel(channellist) cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file data{k} = ft_preprocessing(cfg); end alldata = ft_appenddata([], data{:}); Once you have the alldata object, you can apply re-referencing. Perhaps indeed this is best done by creating a ‘montage’, and apply it to the data. Best wishes, Jan-Mathijs On 23 Mar 2023, at 22:12, Peter Kaskan via fieldtrip > wrote: Hello, I am writing a ft_preprocessing script; I can give it channel1.csc and proceed with filtering, defining trials etc. ...but, how do I re-reference to another channel? Is there a way to use ft_read_data to create a structure with all channels, and then tell it what channel I want to use as a reference? Or do I need to create a montage, and how do I do that with n #s of separate neuralynx.csc channels? Thanks - Peter ------------------------------ Message: 3 Date: Wed, 12 Apr 2023 06:30:21 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" Hi Peter, Apologies, I was a bit sloppy in my earlier code snippet. I think it should have read something like this channellist = {‘channel1’;’channel2’;…’channelN’}; cfg = []; cfg. for k = 1:numel(channellist) %% NOT THIS: cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file cfg.dataset = sprintf(‘%s.ncs’,channellist{k}); data{k} = ft_preprocessing(cfg); end If each channel is represented as a single file, ft_preprocessing needs to be instructed in each iteration of the loop with a fresh cfg.dataset Once you have ‘appended’ the channels through ft_appenddata (note that this requires each of the channels' data structures to have the same number of samples) , you should be able to re-reference. I hope that this helps to get you on your way. Good luck, Jan-Mathijs -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Wed Apr 26 07:36:12 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 26 Apr 2023 05:36:12 +0000 Subject: [FieldTrip] re-referencing using neuralynx.csc channels In-Reply-To: References: Message-ID: Hi Peter, Re-referencing can only be done once the channel that will be used as a reference has been read into the matlab workspace. You will need one round of ft_preprocessing for that. It is not a necessary prerequisite to specify the rereferencing upon the first call to ft_preprocessing. In your use case, you need to read in the data in a for loop, because of the particular way in which your data is represented (i.e. one channel per file). ft_preprocessing can then be applied to the ‘appended’ data, with the reference channel of choice (which in your case will be ‘CSC84’ (without the .ncs I think). Good luck, Jan-Mathijs On 25 Apr 2023, at 23:06, Peter Kaskan via fieldtrip > wrote: Thanks for your help Jan-Matijs, I implemented your corrected loop and I am now reading in multiple .csc channels using       alldata = ft_appenddata([], data{:}); I think I read somewhere that one should define re-referencing before running ft_preprocessing. However, ft_preprocessing occurs within this loop: for k = 1:numel(channellist) cfg.dataset = sprintf('%s.ncs',channellist{k}); data{k} = ft_preprocessing(cfg); end It seems like I should insert this in the loop (above, before ft_preprocessing), because I want to use channel 84 as a reference for each channel. cfg.reref = 'yes'; cfg.refchannel = 'CSC84.ncs'; But this construction throws errors: Error using preproc (line 279) reference channel was not found Error in ft_preprocessing (line 599) [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx), tim, cfg, begpadding, endpadding); Any guidance you can provide? Thank you! ------------------------------ Message: 2 Date: Tue, 11 Apr 2023 20:30:18 +0000 From: Peter Kaskan > To: "fieldtrip at science.ru.nl" > Subject: Re: [FieldTrip] fieldtrip Digest, Vol 148, Issue 24 Hello Jan-Mathijs, Thanks for the reply; I was traveling and just got back to this... In my initial, very rudimentary preprocessing script, cfg.dataset will take a single neuralynx file:       cfg.dataset = 'CSC4.ncs'; cfg.continuous = 'yes'; highpass, lowlass, demean, detrend etc.. filtContData = ft_preprocessing(cfg); But the question was how to reference one channel with another. I have been trying to implement your channellist and appenddata suggestion as you describe (below) using channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} and the subsequent data loop. However, my initial attempt left some errors related to Error using ft_checkconfig (line 163) The field cfg.datafile is required The field cfg.headerfile is required Error in ft_preprocessing (line 385)       cfg = ft_checkconfig(cfg, 'required', {'headerfile', 'datafile'}); After digging a little further in ft_preprocessing lines 446-447 % translate the channel groups (like 'all' and 'MEG') into real labels cfg.channel = ft_channelselection(cfg.channel, hdr); assert(~isempty(cfg.channel), 'the selection of channels is empty'); ... we rescued the error by resetting cfg.channel = CSC1.ncs; Do you know what is happening? If we use: channellist = {'CSC1.ncs'; 'CSC2.ncs'; 'CSC3.ncs'} does the cfg.datafile and cfg.headerfile need to be defined some other way? Thanks, Peter ________________________________ From: fieldtrip > on behalf of fieldtrip-request at science.ru.nl > Sent: Monday, March 27, 2023 6:00 AM Hi Peter, ft_read_data is a so-called ‘intermediate’ level fieldtrip function and not typically called directly by the casual user. I think your use case calls for the following strategy: channellist = {‘channel1’;’channel2’;…’channelN’}; for k = 1:numel(channellist) cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file data{k} = ft_preprocessing(cfg); end alldata = ft_appenddata([], data{:}); Once you have the alldata object, you can apply re-referencing. Perhaps indeed this is best done by creating a ‘montage’, and apply it to the data. Best wishes, Jan-Mathijs On 23 Mar 2023, at 22:12, Peter Kaskan via fieldtrip > wrote: Hello, I am writing a ft_preprocessing script; I can give it channel1.csc and proceed with filtering, defining trials etc. ...but, how do I re-reference to another channel? Is there a way to use ft_read_data to create a structure with all channels, and then tell it what channel I want to use as a reference? Or do I need to create a montage, and how do I do that with n #s of separate neuralynx.csc channels? Thanks - Peter ------------------------------ Message: 3 Date: Wed, 12 Apr 2023 06:30:21 +0000 From: "Schoffelen, J.M. (Jan Mathijs)" > Hi Peter, Apologies, I was a bit sloppy in my earlier code snippet. I think it should have read something like this channellist = {‘channel1’;’channel2’;…’channelN’}; cfg = []; cfg. for k = 1:numel(channellist) %% NOT THIS: cfg.channel = channellist{k}; % or something equivalent, at least instructing the reading function to grab a channel specific file cfg.dataset = sprintf(‘%s.ncs’,channellist{k}); data{k} = ft_preprocessing(cfg); end If each channel is represented as a single file, ft_preprocessing needs to be instructed in each iteration of the loop with a fresh cfg.dataset Once you have ‘appended’ the channels through ft_appenddata (note that this requires each of the channels' data structures to have the same number of samples) , you should be able to re-reference. I hope that this helps to get you on your way. Good luck, Jan-Mathijs _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8VkSVyWbeCmfBJiAtBB12ouWee--iAf4--1ZgohZyMP23AdtlAZbqHCY_eLiftS64yKk9nEy1Yt01h28F4J2m9v3ZwcSO0LI7wq-DQ$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janmathijs.schoffelen at donders.ru.nl Wed Apr 26 08:10:01 2023 From: janmathijs.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Wed, 26 Apr 2023 06:10:01 +0000 Subject: [FieldTrip] Trial by Trial Source Reconstruction for Decoding In-Reply-To: References: Message-ID: Hi Benjy, I would recommend against using the ‘rawtrial’ option. This in retrospect is a poorly implemented functionality in FieldTrip and does not work well (if at all) in concrete situations. I would recommend to use ft_virtualchannel to obtain your single trial time courses. I think that this has been discussed at other threads in this discussion forum, so it should be possible to find some information about this. Also, if your intention is to be able to classify zero from notzero trials, you will probably fool yourself if you NOT compute the covariance across all trials combined, and do a single call to ft_sourceanalysis to obtain a set of common spatial filters. Currently, your pasted code computes the covariance and spatial filters per condition, which will already serve as a booster to make the 2 conditions more dissimilar. Good luck, Jan-Mathijs On 25 Apr 2023, at 14:32, Barnett, Benjy via fieldtrip > wrote: Sorry for multiple posting, please ignore - I have just noticed the cfg.rawtrials option in ft_sourceanalysis, which makes this much simpler. Thank you On Apr 25, 2023, at 1:12 PM, Barnett, Benjy via fieldtrip > wrote: ⚠ Caution: External sender Hi all, I’m trying to implement some MVPA decoding analyses in source space using MEG data collected on a CTF system. I have gone through different tutorials to perform the source reconstruction (namely https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/__;!!HJOPV4FYYWzcc1jazlU!4cSRAdA5lfctmjIb3wJ6BEPS-Ph4hKydOKFStlmspDg5prKPEMNUxCDuA1754_sycJjwL16-vsvkuKoOpvzD73CtWcD5qIY0QiCPKA$ ; https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/__;!!HJOPV4FYYWzcc1jazlU!4cSRAdA5lfctmjIb3wJ6BEPS-Ph4hKydOKFStlmspDg5prKPEMNUxCDuA1754_sycJjwL16-vsvkuKoOpvzD73CtWcD5qIZWVDQ7mA$ ). To train my decoder, I will obviously need trial by trial activity estimates for each of the virtual channels. The issue is that these tutorials, and most other information I can find, only go into how to extract condition-level source estimates. I have an idea of how to do this for individual trials, but it’s such a shift from the tutorials I wondered if I could check whether my plan will work conceptually and technically. My current code (to obtain condition level estimates) is as follows: % Compute Covariance Matrix cfg = []; cfg.covariance = 'yes'; avg = ft_timelockanalysis(cfg,meg_data); %meg_data = datazero + datanotzero; cfg.keeptrials = 'yes'; avgzero = ft_timelockanalysis(cfg,datazero); %condition 1 = ‘zero' avgnotzero = ft_timelockanalysis(cfg,datanotzero); %condition 2 = ’not zero' %Calculate spatial filter for each voxel over all data cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.headmodel = headmodel_new; cfg.lcmv.keepfilter = 'yes'; cfg.lcmv.lambda = '5%'; cfg.lcmv.weightnorm = 'unitnoisegain'; cfg.lcmv.fixedori = 'yes'; cfg.channel = {'MEG'}; cfg.senstype = 'MEG'; sourceavg = ft_sourceanalysis(cfg, avg); %compute filters over all trials %Now apply this filter to zero and not-zero data separately cfg = []; cfg.method = 'lcmv'; cfg.sourcemodel = sourcemodel_new; cfg.sourcemodel.filter = sourceavg.avg.filter; cfg.headmodel = headmodel_new; sourcezero = ft_sourceanalysis(cfg, avgzero); sourcenotzero = ft_sourceanalysis(cfg, avgnotzero); Would I be correct to simply alter this pipeline so that I perform the call to ft_timelockanalysis and estimate the covariance matrix for each trial individually, rather than each condition? Then I was planning to simply run the ft_sourceanalysis function on each of these trials individually, keeping track of which trial belongs to which condition for later use in decoding. I can then go into the source output from the sourceanalysis and extract the .mom field to get the virtual channel data per trial, which I plan to then enter into the decoder. Does this make sense conceptually? It seems a logical step from the beamforming of condition level signals, but I’ve come to learn it’s rarely that simple! I hope that all makes sense, Benjy _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!4cSRAdA5lfctmjIb3wJ6BEPS-Ph4hKydOKFStlmspDg5prKPEMNUxCDuA1754_sycJjwL16-vsvkuKoOpvzD73CtWcD5qIaIbWPhPg$ _______________________________________________ fieldtrip mailing list https://mailman.science.ru.nl/mailman/listinfo/fieldtrip https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9VKw5aAkcqyFPaSPE2qsPhnkgzk6tmjf-ll1wgLUr-bAskClg_DnP0eVgOlsbQ8Ez8ewmq9_2rsSSisJDFRupORjwY_Y-1owr6Dtww$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From hasnae.AGOURAM at univ-amu.fr Wed Apr 26 08:50:12 2023 From: hasnae.AGOURAM at univ-amu.fr (AGOURAM Hasnae) Date: Wed, 26 Apr 2023 06:50:12 +0000 Subject: [FieldTrip] Reject the muscular and visual artifacts from resting-state continuous data Message-ID: Hi Fieldtrip community, I have a question regarding a tutorial on your Fieldtrip website (https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/workshop/madrid2019/tutorial_cleaning/__;!!HJOPV4FYYWzcc1jazlU!7IMAHz8WCuvGuqu4n9XXz-zA1TJdccWCrfrOSJnpA2Tisxo48IM-Lh9GuXFmOzqfdI0s84nj_FryUlXQJQhUq_KG6jUi9_9grw$ ), specifically in the section on rejecting muscular and visual artifacts. When I use the provided code to reject segment artifacts from resting-state continuous data, the result is a new matrix of data that is no longer one trial, but rather contains multiple trials and times, depending on how many segments are rejected. If I try to make it continuous, there are NaN values in the place of the rejected sampling points. I was wondering how you handle this case. Do you work with the cleaned data that contains multiple trials and times, or do you do something else? The provided code is : cfg = []; cfg.artfctdef.minaccepttim = 0.010; cfg.artfctdef.reject = 'partial'; if isfield(artif.artfctdef,'visual') cfg.artfctdef.visual.artifact = artif.artfctdef.visual.artifact; end if isfield(artif.artfctdef,'muscle') cfg.artfctdef.muscle.artifact = artif.artfctdef.muscle.artifact; end data = ft_rejectartifact(cfg, data); Many thanks Hasnae AGOURAM -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.delooff at ru.nl Wed Apr 26 08:57:14 2023 From: peter.delooff at ru.nl (Looff, P.C. de (Peter)) Date: Wed, 26 Apr 2023 06:57:14 +0000 Subject: [FieldTrip] PhD position Donders Message-ID: Dear fieldtrip list, Apologies for any cross postings, but we have a PhD position available from a collaboration between Donders (CogAff), RadboudUMC and Tilburg that might be of interest to you. https://urldefense.com/v3/__https://werkenbijfivoor.nl/vacatures/details/phd-student-in-digital-phenotyping-and-implementation-with-wearables-in-forensic-psychiatry/__;!!HJOPV4FYYWzcc1jazlU!_7zGTMbYPgUSxsuSXpe0UUMc-cBZTZkW-35FET_RasKlOa9KeDOwqrWpdWKNxni6gXcF9LAAf_HL9NKFT7t0n1Enc2w$ PhD Student in Digital Phenotyping and implementation with wearables in Forensic Psychiatry We are seeking a highly motivated PhD student to join our interdisciplinary team of researchers in the field of forensic psychiatry and digital phenotyping. The successful candidate will work with the team on developing several stress, sleep, and physical activity algorithms based on data from the Healthy Brain Study (HBS). The HBS is a prospective longitudinal cohort study that utilizes careful digital phenotyping in 1000 healthy participants. HBS combines bio-sampling, neuro-imaging and ecological momentary assessments to carefully assess several physiological, cognitive, affective and behavioural outcomes in both the laboratory and in real life with wearables. The PhD student will work on integrating these algorithms in an existing open source application for wearables in collaboration with patients and staff members from Forensic Psychiatry that will provide tailored, personalized insights and can be implemented in treatment settings. The PhD student will also carefully design several single case experiments to assess the efficacy and value of the open source application in (forensic) psychiatric treatment. This project is a collaboration between Donders Institute Radboud, Tilburg University, Fivoor, and de Borg and will be embedded in the infrastructure of the Donders Institute, providing a unique and stimulating learning environment for young researchers, including a high-profile graduate school and in-house methodological expert courses. All the best, Peter de Looff -------------- next part -------------- An HTML attachment was scrubbed... URL: From varghese.mathew at res.christuniversity.in Wed Apr 26 20:20:16 2023 From: varghese.mathew at res.christuniversity.in (Varghese Mathew 1881002) Date: Wed, 26 Apr 2023 23:50:16 +0530 Subject: [FieldTrip] Help with definetrial for EGI .mff file In-Reply-To: References: <4E22B6C8-1A20-4612-83C4-753B8D8EE359@donders.ru.nl> Message-ID: Thank you so much. I was able to find out the eventtype and event value and this has helped in proceeding with the analysis. Looking forward to the analysis. Sincerely On Mon, Apr 24, 2023 at 6:13 PM Schoffelen, J.M. (Jan Mathijs) via fieldtrip wrote: > apologies for the multiple postings: i made a typo in my previous message: > the line that reads ’ft_trialfun_general’, should of course read > ’ft_trialfun_show’. > > Best wishes, > Jan-Mathijs > > > On 24 Apr 2023, at 14:31, Jan Mathijs Schoffelen < > janmathijs.schoffelen at donders.ru.nl> wrote: > > Hi Mathew, > > Thanks for the additional information. > > Note that ft_definetrial/ft_trialfun_general will only work according to > expectation if eventtype and eventvalue are correctly specified. Their > correct specification depends on how the events and their values are > represented in the data file. This is something I don’t know for the format > you use, but it could be that ’stim’ should read ’Stim’, and/or that the > event values ahould be numeric( e.g., [1 2 3 4], rather than {’01’ ’02’ > ’03’ ’04’}. If you are unsure about how values/types should be defined for > your data, you should use the ft_trialfun_show function: > > > datapath='E:\FT\OFP1.mff' > EGIformat= 'egi_mff_v3' > cfg = []; > cfg.dataset = datapath; > cfg.dataformat = EGIformat > cfg.headerformat = EGIformat > cfg.trialfun = 'ft_trialfun_general’; > cfg=ft_definetrial(cfg); > > > This will give you some feedback on the screen, which you can use for a > properly formatted call to ft_definetrial with trialfun > = ‘ft_trialfun_general’ > > Good luck, > Jan-Mathijs > > On 22 Apr 2023, at 06:33, Varghese Mathew 1881002 < > varghese.mathew at res.christuniversity.in> wrote: > > Thank you so much for the response. > I have tried using ft_trialfun_general in the following code > datapath='E:\FT\OFP1.mff' > EGIformat= 'egi_mff_v3' > cfg = []; > cfg.dataset = datapath; > cfg.dataformat = EGIformat > cfg.headerformat = EGIformat > cfg.trialdef.eventtype = 'stim'; > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim =1; > cfg.trialdef.eventvalue = {'01''02''03''04'}; > cfg.trialfun = 'ft_trialfun_general'; > cfg = ft_definetrial(cfg) > > I am getting a following response > > Error using ft_definetrial > no trials were defined, see FT_DEFINETRIAL for help > > This made me think if I should change the trialfun_general. Is there > something I have missed and also is there any standard format to define > trials on Netstation files (.mff)? > > Thank you again for the response. > > Sincerely > Varghese Mathew > > > On Wed, Apr 19, 2023 at 11:12 PM Schoffelen, J.M. (Jan Mathijs) via > fieldtrip wrote: > >> Hi Mathew, >> >> I am a bit surprised that you think that you need to adjust the >> ft_trialfun_general. The idea is that this function is quite generic, and >> given the scenario that you sketch, you probably don’t need to change any >> fieldtrip function. The partial error that you report is difficult to >> evaluate, since it’s only partial. Right now it’s just random guessing as >> to what might be going on. The error looks as if MATLAB tries to access a >> structure’s field called headerfile, but for some reason in does not exist >> in the struct that it is evaluating. >> >> for instance, if you define on the matlab command line the following >> struct: >> >> x.a = 1; >> >> and then query x.b, you get the error you report. >> >> What is the full error stack, i.e. which line in which matlab function is >> throwing the error? And what is the code that you try to execute (i.e. the >> specification of the cfg, and the fieldtrip function you are calling). >> >> Good luck, >> Jan-Mathijs >> >> >> On 19 Apr 2023, at 16:27, Varghese Mathew 1881002 via fieldtrip < >> fieldtrip at science.ru.nl> wrote: >> >> Hi >> I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have >> tried using .mff file directly and after converting to EDF. However, I am >> getting error in defining trials. Mostly I get an error message Unrecognized >> field name "headerfile" . >> I would like to know how to go about this in EDF or .mff format. >> It will also be helpful if someone can help with how to modify >> ft_trialfun_general for .mff file as well. >> I am pasting the code I used, below. >> cfg=[] >> cfg.dataset = 'E:\FT\OP17.mff'; >> cfg.dataformat = 'egi_mff_v3' >> cfg.headerformat = 'egi_mff_v3' >> cfg.trialdef.eventtype = 'stim'; >> cfg.trialdef.prestim = 1; >> cfg.trialdef.poststim =1; >> cfg.trialdef.eventvalue = {'01''02''03''04'}; >> cfg.trialfun = 'ft_trialfun_general_stimmod'; >> cfg = ft_definetrial(cfg) >> >> >> For modifying trialfun_general >> >> function [trl, event] = ft_trialfun_general_stimmod(cfg) >> event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3'); >> % Find trigger values >> trigger = [event(strcmp('stim', {event.type})).value]'; >> % Note: Replace 'STI101' with the label of the trigger channel that >> % contains the trigger values for your data >> % Define trial segments >> trl = []; >> for j = 1:length(trigger) >> if any(trigger(j) == [01 02 03 04]) >> trlbegin = event(j).sample; >> trlend = trlbegin + 1000; % define trial length as 1 second >> offset = 0; % no offset >> newtrl = [trlbegin trlend offset trigger(j)]; >> trl = [trl; newtrl]; >> end >> end >> Please help with the issue, as I am trying to pick up analysis using >> Fieldtrip and I do not have a coding background. >> Looking forward for a response, >> >> Sincerely >> -- >> Varghese Mathew >> >> _______________________________________________ >> fieldtrip mailing list >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8eNI3v7br-aNv3JFKJb7V4Q_aWWLR3pG3xSWq653eKc8M3szkc7gmh51AkzytjbLsNllQtMkOdF4QKsVIokOhTwtxZRljnjlhEkwJA$ >> >> >> _______________________________________________ >> fieldtrip mailing list >> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!51zCYkAFZoqmWL9eer8ycUfaK7yAxppbGAdqlDDqNJKsJF_MSdudTtoyv-xxwSGGryAXHcc87pmsUrsRHBILnCGZkWJIrbi0HR1aKdrXGHci$ >> >> > > > -- > Varghese Mathew > Mobile No. 9535395896 > > > > _______________________________________________ > fieldtrip mailing list > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip > https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!51zCYkAFZoqmWL9eer8ycUfaK7yAxppbGAdqlDDqNJKsJF_MSdudTtoyv-xxwSGGryAXHcc87pmsUrsRHBILnCGZkWJIrbi0HR1aKdrXGHci$ > -- Varghese Mathew Mobile No. 9535395896 -------------- next part -------------- An HTML attachment was scrubbed... URL: From erfan1994vi at gmail.com Sat Apr 29 11:04:05 2023 From: erfan1994vi at gmail.com (Erfan Vi) Date: Sat, 29 Apr 2023 12:34:05 +0330 Subject: [FieldTrip] Independent component analysis (ICA) to remove EOG artifacts Message-ID: Dear FieldTrip users, I have used an example script in the FieldTrip site to remove EOG artifacts for MEG data example located at https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/example/ica_eog/__;!!HJOPV4FYYWzcc1jazlU!8RVcT7vt9rwPHgbzvPH5IFv1KhvliFf9uclvd7fGeD9y3jTEiNhEtGq3rVOa03BcW9lZ3qoBc324h57I8PtCyKZbyA$ using ICA. But I got poor results as below image. Any one can help me? Thank you, [image: ICA.jpg] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ICA.jpg Type: image/jpeg Size: 184363 bytes Desc: not available URL: