[Eeglablist] Processing Startle in EEGlab

Tara Miskovich miskovi2 at uwm.edu
Mon Sep 14 11:43:58 PDT 2015


Thank you Steve,

Sorry for the delay, I have been trying to play around with the issue, but
still appear stuck. I think I fixed the "*Error using horzcat *CAT
arguments dimensions are not consistent." error, and I resampled to 1000hz
so the the first issue shouldn't be there.

Now I am getting the "Warning: Concatenation involves an empty array with
an incorrect number of rows. This may not be allowed in a future release."
error again, and nothing is being calculated for the STLResponse.

I attached the google drive link for the data and the script. Thank you so
much, I cannot figure out how to get past this issue.

Tara
​
 StartleProcessing
<https://docs.google.com/a/ucdavis.edu/folderview?id=0B-sCc9Ecpq99QnRvc3FLYThIQlE&usp=drive_web>
​

On Tue, Sep 8, 2015 at 1:54 AM, Stephen Politzer-Ahles <
stephen.politzer-ahles at ling-phil.ox.ac.uk> wrote:

> Hm, it's strange that the first warning message changed (first it was
> "Warning: Concatenation involves an empty array with an incorrect number of
> rows", now "Warning: Out of range or non-integer values truncated during
> conversion to character.") when I don't think it's related to the line that
> I suggested. Did you make any other changes higher up in the code?
>
> As for the last error message, I suspect that's related to the last line
> of code (if the number of elements in STLResponse is different than the
> number in EEG.event.type, or if one of them needs to be transposed). You
> could try running through the code one line at a time to see where the
> error pops up. If that doesn't take care of it and no one else has a
> solution, you might need to try sharing the data (either via the EEGLAB
> Bugzilla, or via a link on e.g. Dropbox or Google Drive; the list doesn't
> allow attachments) so we can replicate the issue.
>
> Best,
> Steve
>
> On Mon, Sep 7, 2015 at 10:34 PM, Tara Miskovich <miskovi2 at uwm.edu> wrote:
>
>> Thanks for the response Steve. Thanks for catching that—it isn't exactly
>> 1000. I ran the code you gave me and now this pops up. Thank you so much
>> for the help with this.
>>
>> pop_epoch():64 epochs selected
>> Epoching...
>> pop_epoch():64 epochs generated
>> pop_epoch(): checking epochs for data discontinuity
>> pop_rmbase(): Removing baseline...
>> Warning: Out of range or non-integer values truncated during conversion
>> to character.
>>
>> Then I get:
>>
>> *Error using horzcat*
>> CAT arguments dimensions are not consistent.
>>
>> On Sat, Sep 5, 2015 at 4:03 PM, Stephen Politzer-Ahles <
>> stephen.politzer-ahles at ling-phil.ox.ac.uk> wrote:
>>
>>> Hello Tara,
>>>
>>> It's hard to tell without seeing the data, but this sort of thing might
>>> happen when the timepoints in your data are not exactly e.g. 20 and 100 ms
>>> (which might be the case if your sampling rate was not 1000 Hz). Is the
>>> issue fixed if you replace the line in question with the following?
>>>
>>> STLResponse = squeeze(max(EEG.data(1,find(EEG.times>=20 &
>>> EEG.times<=100),:)));
>>>
>>> Best,
>>> Steve
>>>
>>> On Sat, Sep 5, 2015 at 8:17 PM, Tara Miskovich <miskovi2 at uwm.edu> wrote:
>>>
>>>> Hello all,
>>>>
>>>> I am having difficulty with a script I obtained for processing startle
>>>> data in EEGlab:
>>>>
>>>> %% High pass filter
>>>>         [HP28_1,HP28_2] = butter(2,28/(EEG.srate/2),'high');    %
>>>> generate filter coefficient for 4th order 28Hz High pass Butterworth filter
>>>>         EEG.data = filtfilt(HP28_1,HP28_2,EEG.data);  %apply that
>>>> filter to ORB channel; filter order is divided by 2 because we use the
>>>> filtfilt function to avoid phase shifts in the data
>>>>
>>>> %% Rectify
>>>>         EEG.data = abs(EEG.data); %the 'abs' function rectifies the data
>>>>
>>>> %% Low pass filter
>>>>         [LP30_1,LP30_2] = butter(2,30/(EEG.srate/2),'low');    %
>>>> generate filter coefficient for 4th order 30Hz Low pass Butterworth filter
>>>>         EEG.data = filtfilt(LP30_1,LP30_2,EEG.data);  %%apply that
>>>> filter to ORB channel; filter order is divided by 2 because we use the
>>>> filtfilt function to avoid phase shifts in the data
>>>>
>>>> %% Epoch and baseline correct
>>>>         EventCodes = num2cell(unique([EEG.event.type])); %Extract event
>>>> codes for epoching
>>>>         EEG = pop_epoch( EEG, EventCodes, [-0.05 0.25], 'epochinfo',
>>>> 'yes');  %Epoch file for events that indicate startle probes
>>>>         EEG = pop_rmbase( EEG, [-50   0]); %Baseline correct
>>>>
>>>> %% Mark and reject trials with excessive artificat
>>>>         Artifact = squeeze(max(EEG.data(1,1:find(EEG.times==0),:)) -
>>>> min( EEG.data(1,1:find(EEG.times==0),:)) > 40); %Identify trials with
>>>> greater than 40 microvolt deflections in baseline
>>>>         EEGNA = pop_select(EEG,'notrial', find(Artifact)); %Reject
>>>> these trials
>>>>
>>>> %% Score startle peaks
>>>>         STLResponse =
>>>> squeeze(max(EEG.data(1,find(EEG.times==20):find(EEG.times==100),:)));
>>>> %Identify peak response of startle trials in scoring window
>>>>         STLResponse = [[EEG.event.type]' STLResponse]; %Store peak
>>>> values by event type
>>>>
>>>> I get the following output:
>>>>
>>>> pop_epoch():64 epochs selected
>>>> Epoching...
>>>> pop_epoch():64 epochs generated
>>>> pop_epoch(): checking epochs for data discontinuity
>>>> pop_rmbase(): Removing baseline...
>>>> Warning: Concatenation involves an empty array with an incorrect number
>>>> of rows.
>>>> This may not be allowed in a future release.
>>>>
>>>> I am not sure what is the issue here, but after "STLResponse =
>>>> squeeze(max(EEG.data(1,find(EEG.times==20):find(EEG.times==100),:)));
>>>> %Identify peak response of startle trials in scoring window" I end up with
>>>> an empty 0 by 64 matrix.
>>>>
>>>> I am just a little new to this and can't seem to figure out what is
>>>> going on here.
>>>>
>>>> Thank you!
>>>> Tara
>>>>
>>>>
>>>> _______________________________________________
>>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>>> To unsubscribe, send an empty email to
>>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>>> For digest mode, send an email with the subject "set digest mime" to
>>>> eeglablist-request at sccn.ucsd.edu
>>>>
>>>
>>>
>>
>>
>> --
>> Thank you,
>>
>> Tara A. Miskovich, M.S.
>> Affective Neuroscience Laboratory
>> Department of Psychology
>> University of Wisconsin-Milwaukee
>> 334 Garland Hall
>> miskovi2 at uwm.edu
>>
>
>


-- 
Thank you,

Tara A. Miskovich, M.S.
Affective Neuroscience Laboratory
Department of Psychology
University of Wisconsin-Milwaukee
334 Garland Hall
miskovi2 at uwm.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150914/4060c089/attachment.html>


More information about the eeglablist mailing list