Dear Gemma,
The message you got could explain the 123 vs 124 issue as one trial
was excluded because it wasn't fully recorded. This can happen when
you have a long baseline before the event or long activation period
after the event which go out of the file bounds. The 168 trials
problem is something else and a possible reason again might be some
difference e.g. in the event labels or codes in that specific file
that doesn't match your trial definition. If you send me your sorting
script and one epoched dataset on which it fails I can look at it. You
can use yousendit.com or dropbox.
Best,
Vladimir
On Tue, Aug 7, 2012 at 12:26 PM, Gemma Barnacle
<[log in to unmask]> wrote:
> Hi Vladimir,
>
> Many thanks for your feedback regarding my EEG question. Since I received the feedback via the mailing list I have tried a few things but sorting using the script will still not work. I have tried sorting and averaging the data using the GUI in SPM and this seems to work just fine. I saved the script this generated and compared it to my own script and corrected any differences however, it still doesn't seem to sort the conditions in the same order for each participant. Could there be another reason that this is not working?
>
> I noticed when investigating the files for each participant before the stages of sorting and averaging that some trials are missing. There should be 224 trials for every participant but for example - one participant has 223 and one has 168. Could this be related to my problem? It seems illogical that it would be related seeing as using the GUI worked fine but I can't think why the trials would not be there. I did notice an error when pre-processing the participant with 223 trials as follows:
>
> SPM8: spm_eeg_definetrial (v3833) 17:58:44 - 24/07/2012
> ----------------------------------------------------------------
> Warning: Mdffspm8_gemma_msc_0004.mat: Events 1 not extracted - out of bounds
>> In spm_eeg_epochs at 174
> checkmeeg: data type is missing or incorrect, assigning default
>
> But as I don't watch the screen all of the time while the script is running I don't know if similar things have happened to the other participant's data, and I don't know why this has happened.
>
> Any feedback that you have would be hugely appreciated.
>
> Many thanks again,
>
> Gemma.
>
> ________________________________________
> From: Vladimir Litvak [[log in to unmask]]
> Sent: 30 July 2012 12:19
> To: Gemma Barnacle
> Cc: [log in to unmask]
> Subject: Re: [SPM] EEG sorting not working
>
> Dear Gemma,
>
> It's hard to see from this piece of code what the problem is. But for
> instance, you could check the variable 'condlist' and where it comes
> from. If the contents of condlist have nothing in common with the
> condition labels of the actual datasets then the sorting will not
> work.
>
> Best,
>
> Vladimir
>
> On Mon, Jul 30, 2012 at 12:03 PM, Gemma B
> <[log in to unmask]> wrote:
>> Hi,
>>
>> I wonder if anyone can help... I am running an EEG analysis script in MATLAB using SPM using a script my MSc supervisor gave me. I am having a problem when I get to the sorting stage. I ran my script (including sorting) with no MATLAB errors and went on to create my design matrix for my statistical tests but when I came to select the scans to input for statistical analysis the filenames of the scans relating to any one condition were different across participants. (The folders for each condition had been created in the same order but the filenames inside were not consistent across participants). It seems to me that the scans have not been sorted but I don't know why or how to fix this (being somewhat a MATLAB novice). Please see a section of the script I was given below:
>>
>> if sorting==1
>> prefix='aedff';
>> file=[prefix 'spm8_gemma_msc_' subj_dir(2:5) '.mat'];
>> S = [];
>> S.D = file;
>> % for k=1:length(condition_labels)
>> % a(k)=cellstr(num2str(condition_labels(k)))
>> % end
>> S.condlist = condlist;
>> spm_eeg_sort_conditions(S)
>> end
>>
>> N.B. I have obviously checked that I have inputted sorting=1.
>>
>> It seems odd to me that the script doesn't contain the command 'sort'?
>>
>> Thanks in advance for any help you can offer.
>>
>> Best,
>>
>> Gemma.
|