Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reference:ft_artifact_tms [2013/08/28 12:20]
131.174.45.108
reference:ft_artifact_tms [2018/08/23 14:43] (current)
Line 1: Line 1:
-===== FT_ARTIFACT_TMS ===== +=====  FT_ARTIFACT_TMS =====
-Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_artifact_tms”.+
  
-<code matlab+Note that this reference documentation is identical to the help that is displayed in MATLAB when you type "help ft_artifact_tms"​. 
- ​ft_artifact_tms reads the data segments of interest from file and + 
-  ​identifies tms artifacts.+<html><​pre
 +  <a href=/​reference/​ft_artifact_tms><​font color=green>​FT_ARTIFACT_TMS</​font></​a> ​reads the data segments of interest from file and identifies artefacts in 
 +  ​EEG recordings that were done during TMS stimulation.
    
   Use as   Use as
     [cfg, artifact] = ft_artifact_tms(cfg)     [cfg, artifact] = ft_artifact_tms(cfg)
   with the configuration options   with the configuration options
-    cfg.dataset +    cfg.dataset ​    = string with the filename 
-    cfg.headerfile +  or 
-    cfg.datafile+    cfg.headerfile ​ = string with the filename 
 +    cfg.datafile ​   = string with the filename 
 +  and optionally 
 +    cfg.headerformat 
 +    cfg.dataformat
    
   Alternatively you can use it as   Alternatively you can use it as
     [cfg, artifact] = ft_artifact_tms(cfg,​ data)     [cfg, artifact] = ft_artifact_tms(cfg,​ data)
 +  where the input data is a structure as obtained from <a href=/​reference/​ft_preprocessing><​font color=green>​FT_PREPROCESSING</​font></​a>​.
    
   In both cases the configuration should also contain   In both cases the configuration should also contain
-    cfg.trl ​        = structure that defines the data segments of interest. See FT_DEFINETRIAL +    cfg.trl ​        = structure that defines the data segments of interest. See <a href=/​reference/​ft_definetrial><​font color=green>​FT_DEFINETRIAL</​font></​a>​ 
-    cfg.continuous ​ = '​yes'​ or '​no'​ whether the file contains continuous +    cfg.continuous ​ = '​yes'​ or '​no'​ whether the file contains continuous data (default ​  = '​yes'​) 
-    ​data (default ​  = '​yes'​) +  and 
-    cfg.method ​     = '​detect'​, TMS-artifacts are detected by preprocessing +    cfg.method ​     = '​detect' ​or '​marker', ​see below.
-                      the data to be sensitive to transient high gradients, typical for +
-                      TMS-pulses. +
-                      ​'​marker', ​TMS-artifact onset and offsets are based on+
                       markers written in the EEG.                       markers written in the EEG.
     cfg.prestim ​    = scalar, time in seconds prior to onset of detected     cfg.prestim ​    = scalar, time in seconds prior to onset of detected
Line 32: Line 35:
   METHOD SPECIFIC OPTIONS AND DESCRIPTIONS   METHOD SPECIFIC OPTIONS AND DESCRIPTIONS
    
-  ​DETECT +  ​With cfg.method='​detect',​ TMS-artifacts are detected by preprocessing the data to be 
-  The data is preprocessed (again) with the following configuration parameters, +  ​sensitive to transient high gradients, typical for TMS-pulses. ​ The data is preprocessed 
-  ​which are optimal for identifying tms artifacts.+  ​(again) with the following configuration parameters, which are optimal for identifying tms 
 +  ​artifacts. ​This acts as a wrapper around ft_artifact_zvalue
     cfg.artfctdef.tms.derivative ​ = '​yes'​     cfg.artfctdef.tms.derivative ​ = '​yes'​
-  
   Artifacts are identified by means of thresholding the z-transformed value   Artifacts are identified by means of thresholding the z-transformed value
   of the preprocessed data.   of the preprocessed data.
-    cfg.artfctdef.tms.channel ​    = Nx1 cell-array with selection of channels, see FT_CHANNELSELECTION for details+    cfg.artfctdef.tms.channel ​    = Nx1 cell-array with selection of channels, see <a href=/​reference/​ft_channelselection><​font color=green>​FT_CHANNELSELECTION</​font></​a> ​for details
     cfg.artfctdef.tms.cutoff ​     = z-value at which to threshold (default = 4)     cfg.artfctdef.tms.cutoff ​     = z-value at which to threshold (default = 4)
     cfg.artfctdef.tms.trlpadding ​ = 0.1     cfg.artfctdef.tms.trlpadding ​ = 0.1
     cfg.artfctdef.tms.fltpadding ​ = 0.1     cfg.artfctdef.tms.fltpadding ​ = 0.1
-    cfg.artfctdef.tms.artpadding ​ = 0.01 (Be aware that if one artifact +    cfg.artfctdef.tms.artpadding ​ = 0.01  
-    ​falls within this specified range of another artifact, both artifact +  ​Be aware that if one artifact falls within this specified range of another artifact, both 
-    will be counted as one. Depending on cfg.prestim and cfg.poststim you +  ​artifact ​will be counted as one. Depending on cfg.prestim and cfg.poststim you may not mark 
-    ​may not mark enough data as artifactual.)+  ​enough data as artifactual.)
    
-  ​MARKER +  ​With cfg.method='​marker',​ TMS-artifact onset and offsets are based on markers/​triggers that 
-  This method acts as a wrapper around FT_DEFINETRIAL to determine on- and +  ​are written into the EEG dataset. ​This method acts as a wrapper around ​<a href=/​reference/​ft_definetrial><​font color=green>​FT_DEFINETRIAL</​font></​a> ​to 
-  ​offsets of TMS pulses by reading markers in the EEG.+  ​determine on- and offsets of TMS pulses by reading markers in the EEG.
     cfg.trialfun ​           = function name, see below (default = '​ft_trialfun_general'​)     cfg.trialfun ​           = function name, see below (default = '​ft_trialfun_general'​)
     cfg.trialdef.eventtype ​ = '​string'​     cfg.trialdef.eventtype ​ = '​string'​
     cfg.trialdef.eventvalue = number, string or list with numbers or strings     cfg.trialdef.eventvalue = number, string or list with numbers or strings
-  +  ​The cfg.trialfun option is a string containing the name of a function that you wrote 
-  ​The cfg.trialfun option is a string containing the name of a function +  ​yourself and that <a href=/​reference/​ft_artifact_tms><​font color=green>​FT_ARTIFACT_TMS</​font></​a> ​will call. The function should take the cfg-structure as 
-  ​that you wrote yourself and that ft_artifact_tms will call. The +  ​input and should give a NxM matrix with M equal to or larger than 3) in the same format as 
-  ​function should take the cfg-structure as input and should give a +  "​trl"​ as the output. You can add extra custom fields to the configuration structure to 
-  ​NxM matrix with M equal to or larger than 3) in the same format as +  ​pass as arguments to your own trialfun. ​ Furthermore,​ inside the trialfun you can use the 
-  "​trl"​ as the output. You can add extra custom fields to the +  ​<a href=/​reference/​ft_read_event><​font color=green>​FT_READ_EVENT</​font></​a> ​function to get the event information from your data file.
-  ​configuration structure to pass as arguments to your own trialfun. +
-  ​Furthermore,​ inside the trialfun you can use the FT_READ_EVENT +
-  function to get the event information from your data file.+
    
   The output argument "​artifact"​ is a Nx2 matrix comparable to the   The output argument "​artifact"​ is a Nx2 matrix comparable to the
-  "​trl"​ matrix of FT_DEFINETRIAL. The first column of which specifying the+  "​trl"​ matrix of <a href=/​reference/​ft_definetrial><​font color=green>​FT_DEFINETRIAL</​font></​a>​. The first column of which specifying the
   beginsamples of an artifact period, the second column contains the   beginsamples of an artifact period, the second column contains the
   endsamples of the artifactperiods.   endsamples of the artifactperiods.
Line 76: Line 76:
   corresponding to the input structure.   corresponding to the input structure.
    
-  See also ft_rejectartifact,​ ft_artifact_clip,​ ft_artifact_ecg,​ ft_artifact_eog,​ +  See also <a href=/​reference/​ft_rejectartifact><​font color=green>​FT_REJECTARTIFACT</​font></​a>​<a href=/​reference/​ft_artifact_clip><​font color=green>​FT_ARTIFACT_CLIP</​font></​a>​<a href=/​reference/​ft_artifact_ecg><​font color=green>​FT_ARTIFACT_ECG</​font></​a>​<a href=/​reference/​ft_artifact_eog><​font color=green>​FT_ARTIFACT_EOG</​font></​a>​
-  ft_artifact_jump,​ ft_artifact_muscle,​ ft_artifact_threshold,​ ft_artifact_zvalue +  ​<a href=/​reference/​ft_artifact_jump><​font color=green>​FT_ARTIFACT_JUMP</​font></​a>​<a href=/​reference/​ft_artifact_muscle><​font color=green>​FT_ARTIFACT_MUSCLE</​font></​a>​<a href=/​reference/​ft_artifact_threshold><​font color=green>​FT_ARTIFACT_THRESHOLD</​font></​a>​<a href=/​reference/​ft_artifact_zvalue><​font color=green>​FT_ARTIFACT_ZVALUE</​font></​a>​ 
-  </code>+</pre></​html>​