Back to the main page.

Bug 2533 - add cfg.plotselection to only plot those trials present in cfg.trials

Status NEW
Reported 2014-04-14 13:21:00 +0200
Modified 2016-02-22 09:07:48 +0100
Product: FieldTrip
Component: spike
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Martin Vinck
URL: https://github.com/fieldtrip/fieldtrip/pull/35
Tags:
Depends on:
Blocks:
See also:

Ian Andolina - 2014-04-14 13:21:26 +0200

I consider this a bug, but i've wrapped this in a new cfg setting to not alter current behaviour. Currently ft_spike_plot_raster.m plots a position for all trials on the y-axis, including those that have been excluded using cfg.trials. This means if you have 320 trials but only select 20 trials you still have a y-axis for 320 trials and a useless raster plot. If you set cfg.plotselection to 'yes', then the y-axis is scaled to the number of trials in cfg.trials and a normal raster plot is produced. I also replaced plot with line is it is faster, and added the computed plot positions to the cfg output...


Ian Andolina - 2014-04-14 13:21:53 +0200

https://github.com/fieldtrip/fieldtrip/pull/35


Ian Andolina - 2014-04-15 00:03:03 +0200

It would also be great to not have the trials be sorted in numerical order but retain the order in which they're passed (I like to sort by both presentation time and reaction/saccade time for example), I'll think about adding this as another setting, though I don't know if this will affect the vectorisation of spike times to pass to plot/line. As an aside lots of the spike functions don't handle either cfg.trials or cfg.latency (and spike data structures don't seem well supported by the main FT functions), I've had to make my own selection functions to address this, not sure if this is on a to-do somewhere?


Jan-Mathijs Schoffelen - 2016-02-22 09:06:32 +0100

*** Bug 2534 has been marked as a duplicate of this bug. ***


Jan-Mathijs Schoffelen - 2016-02-22 09:07:02 +0100

Copying over Robert's comment in bug 2534-> although I have not looked at the details yet, I suspect that a better solution is to not make data selection specific to plotting, but rather use ft_selectdata or ft_spike_select. See also bug #1514


Jan-Mathijs Schoffelen - 2016-02-22 09:07:48 +0100

Is this still an open issue? Can the suggested functionality be achieved using function calls as per Robert's suggestion? Is there anyone willing to push this forward? If not, I suggest to close this bug