I appreciate the quick reply, thank you! I'll work on the compiling everything to submit the report. As a quick update, a colleague had a version of EP Toolkit from 2019 and I don't run into the same error with that, and it also doesn't appear to flag all of my channels as bad. So, I'm at least doing some data exploring with that at the moment.
No problem at all! I'll work on the compiling everything to submit the report. As a quick update, a colleague had a version of EP Toolkit from 2019 and I don't run into the same error with that, and it also doesn't appear to flag all of my channels as bad. So, I'm at least doing some data exploring with that at the moment.
Rank of data is zero? Something peculiar is going on, that's for sure! I'll need you to submit a full bug report so that I can look into it. At the start of the tutorial pdf is a section on bug reports that tells you what I'll need to troubleshoot.
Dr Dien (and other EP Toolkit users), I'm currently trying to run a tsPCA decomposition on averaged ERP data (34 data channels referenced to the averaged mastoids) from two different conditions. It appears that I can get the data read into EP Toolkit without any issue, but when I go to run the temporal PCA I get the error message below that seems to suggest that some data/parameter is missing somewhere. I'm not sure if the error is related to: * The Mastoid reference channels not being included in...
Dr Dien (and other EP Toolkit users), I'm currently trying to run a tsPCA decomposition on averaged ERP data (34 data channels referenced to the averaged mastoids) from two different conditions. It appears that I can get the data read into EP Toolkit without an issues, but when I go to run the temporal PCA I get the error message below that seems to suggest that some data/parameter is missing somewhere. I'm not sure if the error is related to: * The Mastoid reference channels not being included in...
I can see how the warning message could be ambiguous. I'll clarify it for the next release.
It doesn't sound like you followed the installation instructions. Please take another look at them. Cheers! Joe On 6/27/24 17:07, PJ Brancaleone wrote: I am attempting to launch the EP toolkit for the 1st time. I have downloaded the most recent version (EP_Toolkit 2993) and unzipped the contents into where I have my other EEG applications like eeglab as recommended in the tutorial pdf. Then, I opened Matlab and clicked "add to path" -> "Current folder", then tried to run the ep command. When I do,...
or to put it another way, it is telling you that you are supposed to use the "Add with Subfolders" button. Your not using it is in fact the problem. Be sure to read the instructions regarding EEGlab and FieldTrip as well.
It doesn't sound like you followed the installation instructions. Please take another look at them. Cheers! Joe
I am attempting to launch the EP toolkit for the 1st time. I have downloaded the most recent version (EP_Toolkit 2993) and unzipped the contents into where I have my other EEG applications like eeglab as recommended in the tutorial pdf. Then, I opened Matlab and clicked "add to path" -> "Current folder", then tried to run the ep command. When I do, it returns the following: Error: The rest of the EP Toolkit is not on the path. Did you use the 'Add with Subfolders' button rather than the 'Add Folder'...
If you mean the values of the factor pattern and factor structure matrices, you can obtain them using the Edit function.
thank you very much for your reply, I have a further question, is there any method to get the exact value of beta weight for every tempo factors over the time window?
In the case of the tutorial, this was handled by choosing the "autoPCA" option. It chooses the peak time point as the time window, which in this example was "192-196 ms." The "176-224 ms" you are quoting was for the windowing of the averaged data, not the PCA data. That would be chosen in the normal manner. In this case, the rationale was 25 ms on either side of 200 ms, for a 50ms long window, which is reasonable for an N2. If you're wondering why the numbers aren't multiples of five, it is because...
Dear Professor Dien I read the tutorial again, on the page 130, the introduction about " Windowing Subject Average Data", the introduction said "The time window also needs to be specified. Let's try a 176-224 ms window (although this tutorial dataset is too small to look for significant effects) by entering in samples 70 to 81". my question is how this time window "176-224 ms" was selected for tf04sp01?
Ah, that makes more sense! It depends on what kind of reliability you want. The EP Toolkit is already set up to provide SME and Dependibility measures for ERP measures. Truth to tell, I don't think either of these provide what you have in mind. They are both pretty specialized in their nature. PCA is layering another level of complexity, so I don't know of anyone who uses reliability measures with them, except for between session reliability (at the subject level). The EP Toolkit automatically provides...
I apologize for the delayed reply. My advisor was out of town and I wanted to wait until he came back so that I cold confirm with him before responding. I was mistaken and the PCA was applied to subject averages (average of all trials for a given condition within each subject) rather than individual trials. So, it seems like we won’t be able to use these data for split-half reliability. Sorry, I should have known this earlier. I guess we’d need to do the PCA at the item level to be able to look at...
Well, first I need you to be much more precise about how this dataset was generated. The devil is in the details, as they say. Please confirm that it was applied to individual trials, and then if so, describe how this was conducted. You're not describing a conventional EP Toolkit analysis, so there are many possibilities here.
Thank you for your quick response! I believe the PCA was applied to the individual trials. And, what we are trying to calculate is the reliability for the amplitude measures from the different temporospatial factors. With mean amplitude-based ERPs, we just compute the ERP for even and odd trials separately and then calculate split-half reliability. We weren’t sure if this type of thing would be possible for PCA derived factors (without physically conducting the PCA separately on the even and odd...
and which part of the statistics are you trying to do the split-half reliability on? The PCA solution itself or the ANOVAs?
Hi, sure! I'll need more information to fully respond though. So first of all, was your PCA applied to the subject averages or to the individual trials? And for the split-half reliability, do you indeed need the reliability at the trial level? I ask, because computing the PCA at the subject level, but then trying to do trial-level things with the average-level results would be tricky. Joe
Hello, I was wondering if you know of a good way to calculate split-half reliability of PCA temporal/spatial factors derived from the EP Toolkit? E.g., Is there a way we can export trial-level data for each of our conditions (in this case gains vs. losses in a monetary reward task)? Thank you!
No problem. Once the temporal PCA has been performed, it no longer matters what time points are chosen for the window. All time points reflect the same factor scores. You'll get the exact same p-values no matter what time points you choose. Please see my 2004 and 2012 papers for more explanation of the math behind this process. Joe
Dear Professor Dien I am sorry that I didn't clarify myself clearly. In the paper, as a quoted “Mean voltage data was extracted from two spatial regions of interest (ROI) defined by the selected temporospatial factor from the principal components analysis (TF01SF1-Island PCA; TF01SF1-Non-island PCA) over a time window defined with a 0.6 beta weight criterion... This gave a frontal ROI with a time window of 588–792 ms for the Island PCA and a posterior ROI with a time window of 612–796 ms for the...
Thanks for your kind words! I'm afraid I don't really understand your question. You set a window in the Windowing function. You enter in the start and end ms of the window you want.
Dear Professor Dien I am a newer with ERP and PCA analysis, while I was doing data analysis with my experiment, I found a paper using this toolbox to do the PCA analysis,which enlightened my data results. In this paper, the author described her process of PCA as follows: Following Dien et al. (2007)’s recommendations for principal components analysis of ERP data, we conducted a temporal PCA followed by a spatial independent components analysis (ICA) of each temporal component. ...Mean voltage data...
The problem has been sovled, and it works well with the fix. Thank you very much!
oops! oversight in the code generating cell means and standard errors for the output file. I'm sending you a fix.
Dear Prof Dien, I am trying to conduct a robust ANOVA analysis on my data with 3 groups(A, B, C) x 2 valence (pface, nface ) x 2 congruency (C, I). However, I receive the following error message when the level of between-subject factor is 3: Index exceeds the number of array elements. Index must not exceed 3. Error in ep_ADF (line 834) sampleN=sum(newNX(find(groupContrast{betweenGroup}))); Error in ep (line 8288) ep_ADF(Y, ANOVAdata.subjects, trimOption, EPmain.preferences.anova, ANOVAmethod, factorNames,...
Great! I run the complet procedure with the fix, from importing the average files to run the ANOVAs and everything is all right. Thank you very much!
Ah got it! Sorry, when I get a figure with things circled, I'm used to it being the "after" errors being highlighted, not the "before" good values. This was a bug due to the subject specs not being handled right when there are multiple sessions per subject. I just sent you the fix. Give it a try and let me know if you run into any further issues!
Hi. Yes, the .ept averaged and the PCA files are right. The error emerge when I 'window' the PCA file to analyze data with the AutoPCA option. The subjects specifications (group and sex) are incorrectly assigned in the output (.txt) file. You can see the differences in the screenshots copyed in the .docx file. Regards,
Okay, well my initial inspection shows no difference between the subject specs in the .ept average file and in the .ept PCA file. So what is the problem? There's no difference before and after the autoPCA as far as I can tell.
Hi, I've just added the required information: the original average file (ML_rec_12AV_reproc_2022_12.ept), and also the first-step temporal PCA file (ML_rec_12AV_ACPt_reproc_2022_12.ept). Moreover, I have added two doc files with useful (I hope) information, according to your indications for bug reports. Please, let me know if you need something else.
Hi, in order to troubleshoot, I need the before as well as the after, so to speak. The way it works is I run it through the same steps as you did and see at what point it goes awry. I can't do this if I don't have a copy of the average file that you performed the PCA upon. See the instructions in the Tutorial on how to perform a bug report.
Sorry, try this other site https://nubeusc-my.sharepoint.com/:f:/g/personal/rodriguez_holguin_usc_es/EnmraVRXVKFFufUP4sosXCkBBihUnkw1gjYRkLvnCQpZCw?e=UfCG2B Thanks! O 11/01/2023 ás 5:02, Joe Dien escribiu: Hi, sorry for the delay! I was out sick. I can't access your files because I don't have an account on your University's system. You need to set the file so that it is public access. Bad assignment of between-subject factor levels when windowing PCA data (AutoPCA) https://sourceforge.net/p/erppcatoolkit/discussion/767176/thread/2ff2a6655e/?limit=25#9993...
Hi, sorry for the delay! I was out sick. I can't access your files because I don't have an account on your University's system. You need to set the file so that it is public access.
Thanks in advance for your help!
Hi, Dien I've found a problem when windowing PCA data by AutoPCA with the specification of between-subject factors: the assignment (sex, group) to the cases is not correct. I'm not sure what I am doing bad. In the link below you can find (1) the spatiotemporal ACP file (.ept) and my electrode configuration file (.ced) to read it; (2) the output of the AutoPCA for the first factor, where the assignment of the between-subject levels to subjects is incorrect; and (3) a doc with some screen-shots, including...
Hi there, I am trying to run the PCA analysis by merging ERP formats to a single file using the single file mode function. However, the 'recognized function or variable 'inputFormat'. error message keeps showing up (see below) :-(. I suppose this is a tiny bug...but I have no clue how to solve this...Could anyone provide a clue? I am running the analysis in Windows 10 environment with Matlab version 2022a. Thank you so much in advance! HN *Loading summary information about datasets in working set...
That'd be a "depends" I'm afraid. So for example, a channel interpolation is only as good as the surrounding channels. Channels on the edge of the montage are more likely to have issues because of the missing information about what is outside of the montage. Choosing only channels in common avoids the interpolation issues but will rob the PCA of much of its power as temporal PCA relies heavily on the differences in topography across the channels to distinguish between ERP components, so the less...
Thank you so much for your response, I do have a small follow up question: 9 of the labs record with 64 channels, 4 can only record 32. Is it recommended to just use "similar" electrodes and then standardize them, or is it acceptable to interpolate the missing channels for the less dense setup? Thanks for your help
Yes, definitely standardize the recordings first. You can use the Edit function to do both. The Samples pane allows you to resample as desired and the Channel Coordinates button of the Overview pane allows you to interpolate the channels from one montage to another. Then you'll be ready to go!
We are planning to perform a PCA on selected ERPs using your toolkit on a consolidated EEG data from different labs. The data were collected using different recording systems, resulting in different sampling rates (500/512), electrode numbers (64/32) and electrode configurations. I was wondering what would be the best approach go with the PCA? Should I first standardize all the recordings (i.e., selecting only common channels, downsample the data etc.) before proceeding to performing the PCA or is...
Okay, I think I've fixed everything and have sent you the link to a fixed version. I'll include the changes in the next EP Toolkit release. It should now provide better support for .fif files and EGI Hydrocel-33 channel systems.
Great! It runs perfect! Thank you very much for all your help this weeks. I think I will finally let you rest!
No problem! It was a genuine bug, if a bit of a specialized scenario. Fixed now. The ANOVA bug seems to come up because I broke the between-group code for more than one factor when I added the support for conventional ANOVAs. I'm sending you a fix for you to try out.
All my fault, Dien! I am embarrassed to bother you uselessly. You couldn't replicate my error with good reason: After testing and testing again (because your fix didn't work) I realised the problem was with my File Preferences: I had checked the "No internal CED" checkbox. I had misunderstood the tutorial and thought that this option only applied when importing external files. Therefore, the published v.296 did not need any fix in this regard. The only question now (if you still want to hear me)...
I still can't replicate how your file runs into the triggering conditions of having no eloc info but I'm sending you a possible fix. Try it out and let me know.
Hi Dr. Dien, I'm trying to avoid the .fif import issue by first converting my files to EEGLAB .set files with Python-MNE. I can now load in data for one subject! However, I think this introduces some formatting issues that don't allow single file mode to work properly. I'll email along the files and error message.
Hi again, Thanks so much for offering to look at this. I sent along the requested items with the subject "EP Toolkit: Read epoched .fif" to your email. Please let me know if you don't see this. Thanks, Arlene
Mmmm, I think I sent you the correct files but maybe not. Anyway, I redid it now from the beginning: A new spatiotemporal PCA file (20220526_ML_rec_12av_ACPst.ept) and the error test file (resulting of running 'READ' after putting a breakpoint on line 4452 of the ep_readData file): 20220526_test.mat You can find this new two files in my sharepoint. Thanks again for your patience!
Okay, I'm starting to narrow in on what is going on with your PCA file. But there is something that still doesn't add up. The error is happening because, according to your test file, the PCA file didn't have the eloc electrode coordinates info but did have the name of the CED file and when it tried to get the info from it, it got thrown because that bit of code wasn't expecting to be doing this for a PCA file, which normally inherits the eloc information from the original average file. What is confusing...
Happy to look at it! I'll need a copy of the file, a screenshot of your settings, the output of "ver", and the startup text after you type in ep. See tutorial section on bug reports.
Hi Dr. Dien, I'm trying to read an epoched .fif file into the Toolkit, but I've run into the following error. Unrecognized function or variable 'addRefFlag'. Error in ep_readData (line 4188) if addRefFlag Error in ep>readFiles (line 13459) EPdata=ep_readData(inArg); Error in ep (line 5224) readFiles(theHandles,importFormat,dataType); Error while evaluating UIControl Callback. I've tinkered around with the settings, but keep seeing this same error. I'm happy to provide any additional info. Thanks...
Other issue (sorry!): The final v2.96 version crashs again when running robust-ANOVA with between-subject factors (the issue you had solve on may, 8th). You can find the relevant files (settings, version, test.mat file) in the sharepoint (subdirectory 20220520_rANOVA_between_fail_v296). Below you can see the error message in the command window: Commencing ANOVA run. This may take some time. You may monitor its progress by opening the html output file with a browser and periodically reloading it....
Done (hoping well). You can find the output in '20220520_reading_ept_test.mat'
With the files you sent me, I can see that the crash is happening because the code has somehow gotten to a spot that it should not have reached and on my computer is working fine. If you are willing to invest some more time in figuring this out, could you put a breakpoint on line 4452 of the ep_readData file (click on the line number and a red dot will appear) and then try reading the file again? When it stops (because it has reached the breakpoint), save the contents of the workspace again like...
Thanks for your interest, I am really bothering you a lot! I just uploaded to the OneDrive folder above a couple of screenshots with the version information (2.96) and the test files with error information from two computers (PC1 and PC2). I have to say that I just installed the toolkit on a 3rd PC, at home, and... I can read the file! therefore, I am even more confused now, but I can continue my work. And sorry for my bad English, yes, of course I meant PCA :-( Really, I'm so grateful to you for...
I just released 2.96, which includes a fix for the unexpectedly large History records that you ran into.
I assume you mean "PCA" not "ACP"? Anyway, I see the crash in your video but I still can't replicate it so I can't fix it. Could you send me the output of "ver"? Also the messages you get in the command window when you start up the EP Toolkit. Also, in the tutorial troubleshooting section, it explains how to use Stop on Errors to send me a test file containing the state of the variables at the moment of the crash. That would be extremely helpful.
Sorry, the zip file is too large; you can find it in the link above
I'm sorry to hear you can't replicate my error. I read ACP files with the Read function. I replicate the whole process today, from importing BV averaged data (txt files) to the two-steps spatio-temporal ACP (now I didn't add specs to avoid increasing the files weigth). In the zip-file attached, you find see the 3 .ept files, and also a video-screen-capture where you can see that I can read the file with the imported EEG data and the one with the temporal ACP, but if fails when reading the spatio-temporal...
Glad to hear it fixed the problem! I wasn't able to replicate your error with the new file. You'll need to give me more information. Were you just reading it using the Read function? Could you send a screencap? As for the size, I used the new Memory pane of the Edit function and it revealed that the reason it is so large is because of the new History logging. It looks like you made a bunch of edits to the file (adding specs information) and it is logging each time you added a single value and it...
Hi! Now ANOVA runs fine, but... problem to read saved ACP files appears again. You can see the error message below Moreover, I notice something weird: the ACP files created with 2.96beta are very heavy (from 3 MB with v295 to 375 MB with v296). The only difference between them is the specification of the session. Is this ok? I can not attach the file because of its weight. Hope you can download it from this link: https://nubeusc-my.sharepoint.com/:f:/g/personal/rodriguez_holguin_usc_es/EjIem9OvSG5ChAFwImV0YfsBlahI_wcaR-Z5FhgrQohm7Q?e=cpK0ds...
Okay, I figured it out! It was a bug introduced by my effort to support ANOVA text files without headers. Download the fixed beta from the link I gave you and try it out.
Here is the screenshot.
I have indeed increased the number of bootstrapping runs. For some analyses, I found it was needed to maintain the desired level of stability. Needless to say, faster computers helpful! I'll also need a screenshot of your ANOVA function settings.
Yep that's right! Use the Edit function to look at them. There is a session field that keeps track of which session they come from.
Hi again, Joe Trying v.296beta, I have found a problem when running between-subjects (or mixed-model) ANOVA (robust). It runs fine with within-subject factors, but gives an error message when introducing a between-subject one. This is the error message (I also attach below one of my windowed data): I had not this problem with v.2.95 Error using horzcat Dimensions of arrays being concatenated are not consistent. Error in ep_loadANOVA (line 156) specList=[specList find(~cellfun(@isempty,betweenVars.betweenName))];...
Thank you for the fast reply! It works fine now.
Oops! That was part of the backward compatibility code for the History field. Try downloading it again from the link I gave you. It should be fixed now. Yes please do report the ANOVA problem if you're still having it with the beta build. This is the time to do it!
Great! it runs now. Please, could you tell me if the file structure is now correct? I have doubts because it appears to be reading two files (one for each session) from a subject as if they were two subjects. I attach one file with 5 subjects (3 of them with 2 sessions, the other 2 with one session)
Thank you, Dien! It seems fixed, I can read my .ept files with the new beta-release. However, it seems to fail to "Edit" files (only with previously created .ept files: I can edit a new .epet file built with 2.96-beta). The error message is copy below, and one file that I cannot edit is attached. Moving to other issue: I am having problems with ANOVA (robust) with between-subjects factors with 2.96-beta. May I open another topic or wait to your new release? Unrecognized function or variable 'newHist'....
I just tried it. It works like a charm! Thank you for add that information!
Awesome! Thank you, Joe!
You're in luck! I was just getting the next release ready so I took a moment to add the edit information to the Trials subpane of the Edit function. I'm sending you the beta to try out.
Thank you for the fast reply! Is that information stored in some variable? I wish I could extract that information without going through each trial for the Bad Trial checkbox.
Simplest is to use the View > Scan function and look at the Bad Trial checkbox.
Okay, fixed! It'll be in the EP Toolkit beta I e-mailed you. If you downloaded it prior to getting this message, then download it again. Joe
I tried reading it and didn't have any problems. It may be an issue I've already fixed. I'm going to send you a copy of my current beta so you can see if it fixes your problem. I'm getting ready to post a new release in a few days.
Dear Joe, After tha preprocesing, is there a way find out which trials are marked bad? Best, Chao
Dear Dr. Dean, sorry to bother you again, I have difficulties to identify the two sessions of a test-retest when importing .txt files (averaged). I have separate files for each subject, task condition and sesion. I specified, in the Subject, Cell and Session fields, the characters in the file names corresponding to those tags (s1_s1_c1.txt). But, when reading files corresponding to the session2, a warning is provided: "the file sn_sn_cn duplicated the data for subject 's1' for cell 'c1', and so once...
Thanks, Here you are. Do you need need the .ced or the .ept with the ERP data files?
No problem! I'll need a copy of the file. Joe
Dear Dr. Dean I get an error message when reading an .ept file resulting from the second step of a two-steps PCA, previously saved. The error message when trying to read the file is: Index in position 1 exceeds array bounds (must not exceed 1). Error in ep_addEloc (line 516) if ~squeeze(any(any(any(any(sum(EPdataIn.data(EEGchans,:,:,:,:,:,:),1)))))) Error in ep_readData (line 4441) [EPdata]=ep_addEloc(whichCED,EPdata.eloc,EPdata.fileFormat,EPdata,silent); Error in ep>readFiles (line 12626) EPdata=ep_readData(inArg);...
In my case, the following commads in Terminal app solved the problem. FT_PATH='/Users/XXXXX/Documents/MATLAB/fieldtrip-20220310' sudo xattr -r -d com.apple.quarantine $FT_PATH sudo find $FT_PATH -name *.mexmaci64 -exec spctl --add {} \; FT_PATH is your path to the fieldtrip. I hope this helps.
I'm sorry, I don't understand the question. What would be the reason for needing to reamp via the Edit function instead of just selecting the montage in the dropdown menu? You've explained why you don't want to do the former but not why the latter doesn't work for you.
Hi Dr. Dien, Can you explain the new settings for the electrode montage in the toolkit? Is there a way to select a specific montage when reading in the files rather than those from the dropdown menu (e.g., GSN or Hydrocel)? Otherwise I have to remap the electrodes using the Edit dataset which takes a long time. Any help would be appreciated!
OK, thanks for letting me know. I'll figure out a solution, or get my hands on that version. Thanks!!
OK, thanks for letting me know. I'll figure out a solution, or get my hands on that version. Thanks!!
Sure! Just use the Subject pane of the Edit function. See the tutorial for more information.
I'm sorry, I only support Matlab 2018b and onwards. FYI, the problem is that 2015 doesn't support string type variables.
Hi Joe, I've tried opening the beta version but I've stumbled at the first hurdle: when I type ep into the command window I get this error message: ep Error: File: ep_writeData.m Line: 2055 Column: 29 The input character is not valid in MATLAB statements or expressions. Error in ep (line 950) EPmain.fileFormatSaveList=ep_writeData; I've made sure all of the subfolders are set in the directory etc, but there seems to be a line of the ep_writeData.m that matlab doesn't like. I'm using Matlab 2015b...