Back to the main page.

Bug 106 - trl in checkdata

Status CLOSED FIXED
Reported 2010-07-08 12:14:00 +0200
Modified 2010-11-03 15:27:01 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 minor
Assigned to: Joint development user
URL:
Tags:
Depends on:
Blocks:
See also:

Gio Piantoni - 2010-07-08 12:14:30 +0200

There is a small glitch in the way trl is handled with checkdata. I'm running ft_dipolesimulation (which does not create a trl structure) and then I want to plot the data using ft_databrowser. ft_databrower calls checkdata, which calls fixtrialdef. The problem with fixtrialdef is that it creates a trl but instead of adding it to the cfg (where ft_databrowser expects it), it adds trialdef to data. My workaround at the moment is to call ft_dipolesimulation data = checkdata(data, 'datatype', {'raw', 'comp'}, 'hastrialdef', 'yes'); data.cfg.trl = cat(2, data.trialdef, zeros(size(data.trialdef,1),1)); ft_databrowser Is it possible to add data.cfg.trl directly within fixtrialdef? And what is trialdef (which is different from the trialdef of ft_definetrial) and how is it different from trl? Thanks for the great toolbox! Gio


Jan-Mathijs Schoffelen - 2010-07-08 13:49:54 +0200

Hi Giovanni, Actually, the plan is to slowly phase out the use of XXX.cfg.previous.previous.....trl., and start using XXX.trialdef, and XXX.trialinfo. More information about this can be found here: http://fieldtrip.fcdonders.nl/development/ensure_consistend_trial_definition I am currently in the process of converting all function with a call to findcfg(data.cfg, 'trl'), to use the trialdef (if present). I will move up ft_databrowser on the priority list...


Jan-Mathijs Schoffelen - 2010-07-08 13:50:36 +0200

I forgot to mention: for the time being your workaround is just fine


Gio Piantoni - 2010-07-08 14:01:21 +0200

Thanks! I could not find the wiki page when I looked for it before. Thanks for the pointer. Please, let the end-users know the best practices of handling trialdef and trialinfo when the transition is complete, so that we can take full advantage of it.


Jan-Mathijs Schoffelen - 2010-07-08 14:18:26 +0200

will write some documentation soon. Yet the idea was to make all the changes transparent to the end user (didn't work apparently ;o)). Your bug has been fixed by the way. Fixed version should be available on the ftp-server as of tomorrow. Could you let me know whether it works for you after updating? (without the workaround) Then I can close the bug.


Gio Piantoni - 2010-07-09 09:39:50 +0200

It works perfectly (no workaround needed). Thanks!