Example 3: Decoding Visual Attention with real-time FMRI

[under construction- this is a rough sketch]

We will now describe how to build a real-time fMRI (functional magentic resonance imaging) neurofeedback experiment using BrainStream. Real-time fMRI experiments are very different compared to real-time EEG experiments. This is because in real-time fMRI, the fMRI scanner cannot be controlled using BrainStream meaning that data acquistion cannot be started or stopped by BrainStream and no hardware markers can be sent to the scanner.

function event = init_stiminfo(event)

% read DataFolder
data_folder = bs_get_blockvalue('Experiment','DataFolder');
% add stims folder to Matlab path
addpath(exGenPath(fullfile(data_folder,'stims')));

% tasks should be defined via topic 'Experiment' and key 'Tasks'
for n = 1 : numel(event.tasks)
   task = event.tasks{n};
   if any(strcmp(task,{'classifier'}))
      % doesn't require stimulus definitions
      continue
   end
   
   % try to load stimulus definitions for this task
   try
      event.stiminfos.(task) = eval(['get_stiminfo_' task]);
   catch err
      error('Missing or failed loading definitions for task %s (%s)',task,err.message);
   end
end

This function intiliazes the stimulus material for each task. Becasue during the 'Classifier' task (in which the traning data is used to trainn the classsifier,) no stimulus is presented therefore, the code skips loading any stimulus related info during this task.

(from table)

bs_trace('scan_count','add'), bs_trace( 'epoch_count', 'add'), bs_trace( 'sequence_count','add'), bs_trace('alphaLevel','add')   
bs_trace.m traces the variable and when these variables change (globally) then it logs the value of the varialbes in the log file. Hence it allows to track what happens to each varaialbe and when.
Edit | Attach | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 03 Jan 2013 - 12:34:54 - AdnanNiazi
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback