Mensen / ept_TFCE-matlab

Advanced EEG Statistics
27 stars 9 forks source link

"Reference to non-existent field 'DataFile'." #5

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello,

I have not been able to find any documentation on how the toolbox is to be used, apart from some hints in your PhD dissertation and the example files on your website. I had a bit of faith in my common sense, though, so I downloaded your example data files and wanted to open them in the toolbox to see what kind of data is expected and what kind of actions are available. However, when I run ept_TFCE_Toolbox (after addpathing the appropriate directories), click 'Review Data File', and select 'exampledata_1.mat', MATLAB returns an error message:

Warning: Variable 'DataFile' not found. 
> In ept_EditSummary at 5
  In ept_TFCE_Toolbox>PB_EditSummary_Callback at 101
  In gui_mainfcn at 96
  In ept_TFCE_Toolbox at 42
  In @(hObject,eventdata)ept_TFCE_Toolbox('PB_EditSummary_Callback',hObject,eventdata,guidata(hObject)) 
Reference to non-existent field 'DataFile'.

Error in ept_EditSummary (line 7)
Labels   = Data.DataFile;

Error in ept_TFCE_Toolbox>PB_EditSummary_Callback (line 101)
ept_EditSummary

Error in gui_mainfcn (line 96)
        feval(varargin{:});

Error in ept_TFCE_Toolbox (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)ept_TFCE_Toolbox('PB_EditSummary_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating uicontrol Callback

I thought that maybe I might need to click the big 'Create Summary File' button first, but this produces a different error when attempting to load your example data and might simply be a result of me being stupid.

Have I found a bug, or am I just being stupid anyway? This is MATLAB r2015b (same issue on r2012a, we don't have anything older/later available here)

Mensen commented 7 years ago

Sorry for the delay. Its been a while since I've used that GUI and so there are bugs and bad-coding styles from many years ago there.

Some of them fixed in the latest commit now... However, I wouldn't totally recommend using the GUI interface for analysing your data at the moment anyway. I still use the result viewer though (although admittedly it looks a little out-dated as well).

The example data you have, if you just open it in matlab normally, you'll see its just a participants/trials -by - channels - by - samples/frequency bins matrix. This is the format you need your own data in and this can usually be achieved by some permutation of what you usually have anyways (e.g. EEGLAB's default is channeltimetrials.

I usually use the script to run the TFCE(T-test)... something along the lines of:

ept_TFCE(dataset1, dataset2, ...             % the two trial/participant * channel * sample matrices to be compared
electrode_location_variable,...
'type', 'i', ...                             % change to 'd' if performing dependent t-test
'nPerm', 5000,...
'rSample', sampling_rate, ...
'saveName', 'ept_Results.mat');

Let me know how you get on. Happy to help.

ghost commented 7 years ago

OK, thanks, running it manually like that allows it to proceed (after recompiling the mex files). Thanks.