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
faq:how_can_i_process_continuous_data_without_triggers [2010/01/29 16:12]
robert
faq:how_can_i_process_continuous_data_without_triggers [2017/08/17 11:21] (current)
Line 1: Line 1:
-{{tag>​preprocessing raw faq}}+{{tag>​preprocessing ​continuous ​raw faq}}
  
 ====== How can I process continuous data without triggers? ====== ====== How can I process continuous data without triggers? ======
Line 5: Line 5:
 Most of the FieldTrip documentation is written for a cognitive neuroscience audience, i.e. researchers that usually are performing experiments in which different stimuli are presented and where the subject performs different mental tasks. ​ Most of the FieldTrip documentation is written for a cognitive neuroscience audience, i.e. researchers that usually are performing experiments in which different stimuli are presented and where the subject performs different mental tasks. ​
  
-However, you can also use FieldTrip for analyzing continuous data that does not contain any triggers. One way for processing continuous data is to read it as a single, very long data segment. That is done by skipping **[[:​reference:​definetrial]]** and by calling **[[:​reference:​preprocessing]]** like this+However, you can also use FieldTrip for analyzing continuous data that does not contain any triggers. One way for processing continuous data is to read it as a single, very long data segment. That is done by skipping **[[:​reference:​ft_definetrial|ft_definetrial]]** and by calling **[[:​reference:​ft_preprocessing|ft_preprocessing]]** like this
  
   cfg = [];   cfg = [];
   cfg.dataset = '​yourfile.ext';​   cfg.dataset = '​yourfile.ext';​
   ...                               % further specification of filter settings etc.    ...                               % further specification of filter settings etc. 
-  data = preprocessing(cfg);+  data = ft_preprocessing(cfg);
  
 This will give you a raw data structure containing all continuous data represented as a single, very long trial. You can plot it with This will give you a raw data structure containing all continuous data represented as a single, very long trial. You can plot it with
Line 16: Line 16:
   plot(data.time{1},​ data.trial{1});​   plot(data.time{1},​ data.trial{1});​
  
-For some analyses, e.g. spectral power estimation, it is better to have the data in smaller chucks. You can segment the continuous data after reading it into Matlab using **[[:​reference:​redefinetrial]]** or while reading it in using the following configuration:​+For some analyses, e.g. spectral power estimation, it is better to have the data in smaller chucks. You can segment the continuous data after reading it into Matlab using **[[:​reference:​ft_redefinetrial|ft_redefinetrial]]** or while reading it in using the following configuration:​
  
   cfg = [];   cfg = [];
   cfg.dataset ​             = '​yourfile.ext';​   cfg.dataset ​             = '​yourfile.ext';​
-  cfg.trialfun ​            = 'trialfun_general';+  cfg.trialfun ​            = 'ft_trialfun_general';
   cfg.trialdef.triallength = 1;                   % in seconds   cfg.trialdef.triallength = 1;                   % in seconds
   cfg.trialdef.ntrials ​    = inf;                 % i.e. the complete file   cfg.trialdef.ntrials ​    = inf;                 % i.e. the complete file
-  cfg = definetrial(cfg); ​                        % this creates 1-second data segments+  cfg = ft_definetrial(cfg); ​                        % this creates 1-second data segments
  
   ...                                             % further specification of filter settings etc.    ...                                             % further specification of filter settings etc. 
-  data = preprocessing(cfg);+  data = ft_preprocessing(cfg);
  
-This uses the **trialfun_general** function to segment the data. This function is included in FieldTrip, type //help trialfun_general//​ for more details.+This uses the **ft_trialfun_general** function to segment the data. This function is included in FieldTrip, type //help trialfun_general//​ for more details.
  
 =====  An example for making overlapping segments ===== =====  An example for making overlapping segments =====
Line 36: Line 36:
 cfg.dataset ​    = '​yourfile.ext';​ cfg.dataset ​    = '​yourfile.ext';​
  
-hdr             ​= ​read_header(cfg.dataset);​+hdr             ​= ​ft_read_header(cfg.dataset);​
 begsample ​      = 1:​256:​hdr.nSamples; ​            % slide with 256 samples begsample ​      = 1:​256:​hdr.nSamples; ​            % slide with 256 samples
 endsample ​      = begsample + 512 - 1;            % the segment length is 512 samples endsample ​      = begsample + 512 - 1;            % the segment length is 512 samples
Line 46: Line 46:
 cfg.trl(sel,​ :) = [];                             % remove the segments that are beyond the end of the file cfg.trl(sel,​ :) = [];                             % remove the segments that are beyond the end of the file
  
-data = preprocessing(cfg);+data = ft_preprocessing(cfg);
 </​code>​ </​code>​