<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
<!--
body{margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;}
-->
</style>
</head>
<body marginleft="10" marginright="10" margintop="10" marginbottom="10">
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Sorry, the previously posted example was wrong. Below is a correction to the previous example.</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"><b>Does the error shown below mean that you can only define trials based on the raw data files, and you can not define trials based on the data, which has already been converted to FieldTrip data?</b></font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">If so, I assume that it's necessary to:</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">1. Apply <i>ft_definetrial</i> on each one of the splitted raw fif files. </font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">2. In the first two rows in the trial definition matrix from the second splitted file (i.e. the trial begin sample and trial end sample) add the number of samples in the preceeding raw fif file + 1. </font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">3. Use <i>vertcat </i>to concatenate the corrected trial definition matrices from both files into one trial definition.</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">4. Then use <i>ft_redefinetrial</i> to apply the concatenated trial definitions on the concatenated data.</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"><b>Have anyone tried succesfully to concatenate trial definitions and apply them on concatenated data </b>(in cases with raw fif files splitted into 2 files due to 2 GB file limitation during raw data recording)<b>?</b></font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Greetings</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels.</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">>> cfg = [];</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.dataset = dfull</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialfun = 'ft_trialfun_general' % this is the default</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.eventtype = 'STI101'; % trigger channel</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.eventvalue = [1 2 3 4 5]; % the values of the stimulus triggers</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.prestim = 0.250; % time window before stimulus in seconds</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.poststim = 0.500; % time window after stimulus in seconds</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">trl = ft_definetrial(cfg);</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg = </font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> dataset: [1x1 struct]</font></div>
<br />
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg = </font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> dataset: [1x1 struct]</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> trialfun: 'ft_trialfun_general'</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">Warning: -clear </font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">> In utilities/private/warning_once at 116</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> In utilities/private/ft_preamble_init at 26</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> In ft_preamble at 54</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> In ft_definetrial at 112 </font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error using fileparts (line 31)</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Input must be a row vector of characters.</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in ft_filetype (line 146)</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">[p, f, x] = fileparts(filename);</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in dataset2files (line 14)</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;"> format = ft_filetype(filename);</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in ft_checkconfig (line 503)</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;"> [cfg.dataset, cfg.headerfile, cfg.datafile] = dataset2files(cfg.dataset, []);</font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in ft_definetrial (line 116)</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">cfg = ft_checkconfig(cfg, 'dataset2files', {'yes'});</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;"> </font></div>
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:10pt;color:#000000;"><b>FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>> writes:</b></font></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Thanks Peter. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">The concatenation of the data by using horzcat works fine. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">However, I don't know how to define the trials by refering to the concatenated data. </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"><b>Is it possible to automatically define the trials based on trigger signals in the concatenated data by using </b><i><b>ft_definetrial</b></i><b> or </b><i><b>ft_redefinetrial</b></i><b>?</b></font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">I get the error message (see below) about the missing headerfile. I tried to define cfg.header = <i>dfull.hdr</i> and cfg.headerfile = <i>dfull.hdr </i>, but it didn't seem to work. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Greetings</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">>> cfg = [];</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.data = dfull</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialfun = 'ft_trialfun_general' % this is the default</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.eventtype = 'STI101'; % trigger channel</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.eventvalue = [1 2 3 4 5]; % the values of the stimulus triggers</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.prestim = 0.250; % time window before stimulus in seconds</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg.trialdef.poststim = 0.500; % time window after stimulus in seconds</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">trl = ft_definetrial(cfg);</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg = </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> data: [1x1 struct]</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">cfg = </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> data: [1x1 struct]</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;"> trialfun: 'ft_trialfun_general'</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#006600" style="font-family:Arial;font-size:14pt;color:#006600;">evaluating trialfunction 'ft_trialfun_general'</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Reference to non-existent field 'headerfile'.</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in ft_trialfun_general (line 71)</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;">Error in ft_definetrial (line 162)</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#DD0000" style="font-family:Arial;font-size:14pt;color:#DD0000;"> [trl, event] = feval(cfg.trialfun, cfg);</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:10pt;color:#000000;"><b>FieldTrip discussion list <</b></font></span><a href="mailto:fieldtrip@science.ru.nl"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" style="font-family:Arial;font-size:10pt;"><b>fieldtrip@science.ru.nl</b></font></span></a><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:10pt;color:#000000;"><b>> writes:</b></font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Hi Neils, </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">I use the ft_preprocessing function to load both of my fif files into memory, then use the horzcat command to concatenate the matrices together. From there I create my trialdefs and use ft_redefinetrial to create the condition epochs. </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">I haven't had a problem with dropped triggers / incorrect trial lengths etc. </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Please find the code I use below (and excuse any clunkiness):</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">As for your second question re: </font></span><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">cfg.detectflank = 'up', the ft_read_event function is the one you want to look at. If your system is anything like a typical neuromag, an event can be characterised by both the up and down edges of your digital trigger channel. By specifying cfg.detectflank = 'up' in the read_even function, it will search for jumps in the channel where samples change from 0 to > 0 and classify that as an event, ignoring the down edge. </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Hope the above (and below) helps and happy MEGing, </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Peter.</font></span></div>
<br />
<br />
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">%%</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">%Read data into matlab</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg = [];</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg.dataset = megdata1; %first fif file</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg.channel = 'MEG';</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">d1 = ft_preprocessing(cfg);</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg = [];</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg.dataset = megdata2; %second fif file</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">cfg.channel = 'MEG';</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">d2 = ft_preprocessing(cfg);</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">%%</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">%concatenate data</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">dfull = d1;</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">dfull.trial{1,1} = zeros(306,length(d1.trial{1,1}) + length(d2.trial{1,1})); <b>NOTE: The 306 refers to channels (MEG only). If you have more channels (eg. EOG, ECG) change accordingly. </b></font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">dfull.trial{1,1} = horzcat(d1.trial{1,1}, d2.trial{1,1});</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">dfull.sampleinfo = [1 length(dfull.trial{1,1})];</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">for i = 2:length(dfull.time{1,1}); <b>NOTE: Loop assumes data has yet to be downsampled and is at the base SR of 1000Hz.</b></font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">dfull.time{1,1}(1,i) = (i - 1)*.001; <b>%Change .001 to match SR. </b></font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">i = i + 1;</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">end </font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">__________________________</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">Peter Goodin, </font></span><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;"> </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">BSc (Hons), Ph.D Candidate.</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">Brain and Psychological Sciences Research Centre (BPsych)</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Swinburne University, </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Hawthorn, Vic, 3122</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">Monash Alfred Psychiatry Research Centre (MAPrc)</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Level 4, 607 St Kilda Road, </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:10pt;color:#000000;">Melbourne 3004</font></span></div>
<br />
<br clear="all" /><br/>
<hr noshade size="1" width="100%" color="#000000" style="color:#000000; background-color:#FFFFFF; visibility:visible; margin-top:0px;" />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;"><b>From:</b> </font></span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" style="font-family:Tahoma;font-size:12pt;">fieldtrip-bounces@science.ru.nl</font></span></a><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;"> [</font></span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" style="font-family:Tahoma;font-size:12pt;">fieldtrip-bounces@science.ru.nl</font></span></a><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">] on behalf of Niels Trusbak Haumann
[</font></span><a href="mailto:aestnth@hum.au.dk"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" style="font-family:Tahoma;font-size:12pt;">aestnth@hum.au.dk</font></span></a><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;">]</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;"><b>Sent:</b> Friday, 1 November 2013 3:16 AM</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;"><b>To:</b> </font></span><a href="mailto:fieldtrip@science.ru.nl"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" style="font-family:Tahoma;font-size:12pt;">fieldtrip@science.ru.nl</font></span></a></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Tahoma" size="+0" color="#000000" style="font-family:Tahoma;font-size:12pt;color:#000000;"><b>Subject:</b> [FieldTrip] Reading data and trigger events from Neuromag fif dataset splitted into 2 files</font></span></div>
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Dear FieldTrip community. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"><b>Is it possible to read the data and trial events from a single continuous Neuromag fif dataset, which was automatically split into two separate fif files during recording, because it exceeeded the standard 2 GB file size limitation?</b></font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">The second of the two splitted fif files contains relevant information showing that the second file continues at the time in seconds at which the first file ended. However, if the two fif files are read separately into Field Trip format this information seems to be lost. </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">FieldTrip seems to support reading in CTF datasets, which have been split into more files due to the 2 GB file size limitation, but I don't know whether there is a method for handling this problem with Neuromag fif data. </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">( </font></span><a href="http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf" target="_blank"><span style="background-color:#d0d0d0;"><font face="Times New Roman" size="+0" style="font-family:Times New Roman;font-size:12pt;">http://fieldtrip.fcdonders.nl/getting_started/ctf?s[]=ctf</font></span></a><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"> )</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">I presume that it is a general problem that Neuromag fif datasets with 306 channel data sampled at 1 kHz 32 bit floats are splitted into more files, since only ca. 16-18 minutes raw data can be recorded before it is automatically splitted into two files. </font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">The large file size is not a problem after applying MaxFilter procedures to remove high frequency cHPI signals..., etc., and thereafter downsampling e.g. to 16 bit integers sampled at 250 Hz. I see from a previous discussion in another forum that it is not possible to merge (or append) the splitted files with the MaxFilter software. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">When reading triggers from splitted fif files there is usually one trial, which starts in the end of the first file and ends in the start of the second file, which cannot be correctly recognized, if the files are treated separately. This is however just a minor problem of loosing a single trial. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;"><b>I have a few wrong detections, probably because a few trials are both defined by up-going signals and down-going signals. Would </b><i><b>ft_preprocessing</b></i><b> (and the sub-routines that it calls) take this into consideration, if you e.g. specificy </b><i><b>cfg.detectflank = 'up' </b></i><b>?</b></font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">I'm looking forward to hear any comments, suggestions or solutions. </font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Greetings</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels.</font></span></div>
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels Trusbak Haumann</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">M.A. / PhD student</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Aarhus University / Aarhus University Hospital</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Denmark</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">E-mail: </font></span><a href="mailto:aestnth@hum.au.dk"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" style="font-family:Arial;font-size:14pt;">aestnth@hum.au.dk</font></span></a></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;">_______________________________________________</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;">fieldtrip mailing list</font></span></div>
<div align="left" style="text-align:left;"><a href="mailto:fieldtrip@donders.ru.nl"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" style="font-family:Arial;font-size:12pt;">fieldtrip@donders.ru.nl</font></span></a></div>
<div align="left" style="text-align:left;"><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" style="font-family:Arial;font-size:12pt;">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</font></span></a></div>
<br />
<br />
<br />
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels Trusbak Haumann</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">M.A. / PhD student</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Aarhus University / Aarhus University Hospital</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">E-mail: </font></span><a href="mailto:aestnth@hum.au.dk"><span style="background-color:#d0d0d0;"><font face="Arial" size="+1" style="font-family:Arial;font-size:14pt;">aestnth@hum.au.dk</font></span></a></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;">_______________________________________________</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;">fieldtrip mailing list</font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;"><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a></font></span></div>
<div align="left" style="text-align:left;"><span style="background-color:#d0d0d0;"><font face="Arial" size="+0" color="#000000" style="font-family:Arial;font-size:12pt;color:#000000;"><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></font></span></div>
<br />
<br />
<br />
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Niels Trusbak Haumann</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">M.A. / PhD student</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Department of Aesthetic Studies / Center of Functionally Integrative Neuroscience</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">Aarhus University / Aarhus University Hospital</font></div>
<div align="left" style="text-align:left;"><font face="Arial" size="+1" color="#000000" style="font-family:Arial;font-size:14pt;color:#000000;">E-mail: <a href="mailto:aestnth@hum.au.dk">aestnth@hum.au.dk</a></font></div>
<br/>
</body>
</html>