Back to the main page.

Bug 2227 - extend ft_redefinetrial with interpolation of missing data, i.e. where the TMS pulse used to be

Status CLOSED FIXED
Reported 2013-07-31 12:28:00 +0200
Modified 2015-07-15 13:30:46 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Jim Herring
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2013-07-31 12:28:44 +0200

as discussed in our meeting.


Robert Oostenveld - 2013-07-31 12:31:30 +0200

mac001> svn commit ft_redefinetrial.m utilities/ft_fetch_data.m Sending ft_redefinetrial.m Sending utilities/ft_fetch_data.m Transmitting file data .. Committed revision 8356.


Robert Oostenveld - 2013-07-31 12:37:09 +0200

todo: 1) copy word version to wiki 2) make test script for this specific bug 3) make data available on data/ftp/tutorial/tms 4) make test script for tutorial


Jan-Mathijs Schoffelen - 2013-07-31 13:44:05 +0200

as discussed in the FT meeting high level: - do not implement interpolation in ft_redefinetrial, keep the nan - extend ft_rejectartifact with complete/partial/nan - implement a new function that interpolates nans in raw data low level: - move the code from ft_fetch data to this new function


Robert Oostenveld - 2013-08-02 10:34:52 +0200

I just fixed a bug in ft_fetch_data (related to the count variable for a single trial), thanks to test_ft_fetch_data! mac001> svn commit utilities/ft_fetch_data.m Sending utilities/ft_fetch_data.m Transmitting file data . Committed revision 8369. I also removed all references to the interpolation stuff.


Jim Herring - 2013-08-02 15:34:30 +0200

As discussed with Robert: I've changed ft_redefinetrial to allow for missing data and combining of multiple input trials into one trial. However, I did not re-use the implementation from ft_fetch_data because we only need to know the trial numbers from the original data to correctly handle .trialinfo. I've now determined the trial numbers by: iTrlorig = find(begsample <= dataold.sampleinfo(:,2) & endsample >= dataold.sampleinfo(:,1)); This line checks from which trials data is used for the requested samples. To handle .trialinfo the code first checks if the user specified 4, or more, columns in cfg.trl. If so, this trialinfo is used. A warning is given if the old data contains a trialinfo as well. If there no user-specified trialinfo but there is a trial info available in the old data the old trial info is used if no trials are combined that have different trial info values. In case there is no new or old trialinfo, nothing is done.


Jim Herring - 2013-08-02 15:38:38 +0200

Sending ft_redefinetrial.m Sending test/test_ft_redefinetrial.m Transmitting file data .. Committed revision 8374.


Jim Herring - 2013-08-02 16:30:13 +0200

ft_rejectartifact can now fill bad parts with nans. Sending ft_rejectartifact.m Transmitting file data . Committed revision 8375.


Jim Herring - 2013-08-14 16:13:34 +0200

Adding ft_interpolatenan.m Transmitting file data .. Committed revision 8394. ft_interpolatenan interpolates segments in data containing nans. Currently it uses Matlab's interp1 function to interpolate segments using the method specified by the user. As it loops over channels it is possible to interpolate separate segments for each channel.


Jim Herring - 2013-08-27 17:01:57 +0200

Test script for tutorial added. Adding test_tutorial_tmseeg.m Transmitting file data . Committed revision 8430.


Jim Herring - 2013-09-19 10:30:52 +0200

All steps have been taken, bug can be closed