Dear Peyman,
On Thu, Nov 12, 2009 at 1:54 PM, Peyman Adjamian <[log in to unmask]> wrote:
> At the moment I am interested in some sensor space analysis and
> time-frequency plots as I can do beamformer analysis using the CTF routines.
>
> One thing I have noticed when reading the data is that the information
> regarding the trials are not read into the Graphics window as the trial
> names do not appear. Does the software not read the MarkerFile.mrk file in
> the dataset? Is there a way that this file can be read or is it necessary to
> name each trial during pre-processing stage?
Yes this is something we are aware of and it'll hopefully be fixed in
the near future. In the meantime you can look at the workarounds I
have recently suggested to Krish Singh who had a similar problem. He
had 3 conditions called 'Horizontal', 'Vertical' and 'Oblique' but you
can easily modify the code for your circumstances.
Here are two ways to get those trial types. The first way is to
specify trials at conversion using the
events specific to each trial type.
-------
spm('defaults', 'eeg');
S = [];
S.dataset = '.\MA_short1.ds\MA_short1.meg4';
S.continuous = 0;
S.usetrials = 0;
S.timeonset = 0;
S.pretrig = -1290; % Here you need to be careful not to go outside trial
S.posttrig = 1290; % boundaries even by a single sample
S.trialdef(1).conditionlabel = 'Horizontal';
S.trialdef(1).eventtype = 'Horizontal';
S.trialdef(1).eventvalue = [];
S.trialdef(2).conditionlabel = 'Oblique';
S.trialdef(2).eventtype = 'Oblique';
S.trialdef(2).eventvalue = [];
S.trialdef(3).conditionlabel = 'Vertical';
S.trialdef(3).eventtype = 'Vertical';
S.trialdef(3).eventvalue = [];
S.reviewtrials = 0;
S.save = 0;
S.outfile = 'espm8_MA_short1';
S.channels = 'meg';
S = spm_eeg_channelselection(S);
[S.trl, S.conditionlabel] = spm_eeg_definetrial(S);
D = spm_eeg_convert(S);
-----------------
The second way is to convert with 'just read' but then recode the
trial labels based on the events in those trials:
---------------
D = spm_eeg_load('spm8_MA_short1.mat');
for i = 1:D.ntrials
ev = D.events(i);
types = {ev{1}(:).type};
ind = find(ismember(types, {'Horizontal', 'Vertical', 'Oblique'}));
D = conditions(D, i, types{ind});
end
--------------
Best,
Vladimir
|