''Authors: Jeremy Moreau'' <> This tutorial introduces dipole fitting and visualisation in Brainstorm. You will need to have completed the introductory tutorials up to "Tutorial 16: Average response" before undertaking this tutorial. == Fitting dipoles using process FieldTrip: ft_dipolefitting == This process wraps the FieldTrip function'' ft_dipolefitting''. For background information on the implementation of the dipole modelling see [[http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting|the FieldTrip dipole fitting tutorial]] or watch [[https://youtu.be/pFdCWsqPEFg|this video]]. Note that in order to use this process you will need to [[http://www.fieldtriptoolbox.org/download|have FieldTrip installed]] and added to your Matlab path. We will be fitting dipoles to the auditory ERFs computed in "Tutorial 16: Average response". In this first step, we will fit a single dipole to the peak of the M100 ERF component. {{attachment:tut_dipolefitting_m100_traces.png}} * Open the protocol TutorialIntroduction and switch to the "functional data" view. * Expand the run 02 folder (not the Raw link), and drag the average time series "Avg: standard" into the Process1 box. * Click on "Run" and select the process Sources -> FieldTrip: ft_dipolefitting. {{attachment:tut_dipolefitting_processbox_s.png}} * Enter M100 in the "File tag" field, 100 - 100 in the "Time window" fields, and leave all other options as they are. Press "Run" and wait (you may want to look at the Matlab console to see the progress). {{attachment:tut_dipolefitting_proccessbox2.png}} * Once the process is done computing a new dipole file will appear in your database under the average time series on which it was computed. Before continuing to visualising the dipoles, let's compute a second dipole around the M50 component. This time we'll fit a moving dipole over a 20ms time window around the peak of the M50. {{attachment:tut_dipolefitting_processbox3.png}} == Visualising dipole files == == FieldTrip: ft_dipolefitting process opitons == '''File tag: '''Text string that will be added at the end of the comment field of the dipole file. '''Time window: '''Time window over which to run the dipole fit. If you want to fit a dipole to a single time point enter the same time value in the start and end field. '''Sensor type or names: ''' Type of sensor (e.g. MEG, EEG) or comma separated list of sensor names (e.g. MLF42) to use in the dipole fit. It is not currently possible to select multiple sensor types at once (e.g. both MEG and EEG). '''Dipole type: '''For each time sample within the selected time window, the moving dipole option fits a dipole with a different position and orientation, whereas the regional dipole option fits a dipole with a different orientation but always the same position. '''Number of dipoles to fit: '''The number of dipoles that will be fit at each time point. '''Left-right symmetry constraint:''' Selecting this option imposes a left-right symmetry constraint when fitting two dipoles. You may want to use this when you have a reason to believe that bilateral activation may be occuring (e.g. because you are delivering a stimulus bilaterally).