[FieldTrip] how to use ft_stratify?

Vitória Magalhães Piai vitoria.piai at gmail.com
Sun Jun 2 17:09:34 CEST 2013


Thanx, Arjen!
Shame on me, I should have known that there would be a wikipage on that :)

And for the sake of archiving, in case someone else ever bumps into this 
thread because they're making the same mistake as me when using this 
function, here's what I was doing wrong:
The input Nchan x N_trials for each condition, Nchan should be 1 'cause 
my data are the RTs
So:

% input1 = RT_trials_cond1' ; % size = 1 x 95
% input2 = RT_trials_cond2' ;  % size = 1 x 100
cfgst = [];
cfgst.method = 'histogram';
output = ft_stratify(cfgst, input1, input2);

Now it will run and it won't even complain they are of different sizes 
either!

Hope this will help anyone in the future making the same mistake!
Cheers, Vitória



On 6/2/2013 12:00 PM, fieldtrip-request at science.ru.nl wrote:
> Message: 2
> Date: Sun, 02 Jun 2013 11:17:25 +0200
> From: Vit?ria Magalh?es Piai<vitoria.piai at gmail.com>
> To:fieldtrip at donders.ru.nl
> Subject: [FieldTrip] how to use ft_stratify?
> Message-ID:<51AB0DA5.10805 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi all,
>
> I'm trying to use ft_stratify for the first time, but (it could be just
> me) I don't find the help info helpful enough:)
> What I want to achieve in the end is TFRs of two conditions for which
> the histogram of the reaction time over trials for each condition is
> matched.
>
> If I understood ft_stratify correctly (and I doubt that), I could use
> this function to select the trials for each condition such that the
> histograms of the RTs match. Then knowing which trials to keep, I run
> ft_freqanalysis on those specifically.
> So question number 1, is that how I should proceed? 'Cause as far as I
> can tell, ft_stratify will not take a whole raw data structure: The help
> says "each input is a Nchan X Nobs matrix". So I have to go for the RTs
> then.
>
> Assuming my approach is correct (ft_stratify on RTs of two conditions,
> then move on with only those trials), I've made a matrix Nchan x
> N_trials for each condition.
> % input1 = 265 sensors x 95 RT_trials;
> % input2 = 265 sensors x 100 RT_trials;
>
>           cfgst = [];
>           cfgst.method      = 'histogram';
>           cfgst.equalbinavg = 'no';
>           cfgst.numbin      = 4;
>           cfgst.numiter     = 2000; % default
>           [output,bin] = ft_stratify(cfgst, input1, input2);
>
> I then get an error in line 127:
> linearhisto = zeros(ncond, cfg.numbin.^nchan);
> ??? Error using ==> zeros
> Maximum variable size allowed by the program is exceeded.
>
> Apparently, zeros(2, 4^265) is something matlab doesn't want to calculate!
> Am I doing something wrong here? Has anyone worked with this function
> before (with such a number of sensors)?
>
> Any help is greatly appreciated!
> Cheers, Vit?ria
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 2 Jun 2013 11:46:03 +0200 (CEST)
> From: "Stolk, A."<a.stolk at fcdonders.ru.nl>
> To: FieldTrip discussion list<fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] how to use ft_stratify?
> Message-ID:
> 	<1910615072.1312606.1370166363974.JavaMail.root at sculptor.zimbra.ru.nl>
> Content-Type: text/plain; charset=utf-8
>
> Hi Vitoria,
>
> There is a wikipage that may help you get started, and answer your questions:
> http://fieldtrip.fcdonders.nl/example/stratify
>
> Best wishes,
> Arjen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130602/18bb0c67/attachment.html>


More information about the fieldtrip mailing list