Back to the main page.
Bug 1451 - clusterstat (sourcestatistics) crashes on use of spm_bwlabel
Status | CLOSED FIXED |
Reported | 2012-05-02 08:51:00 +0200 |
Modified | 2014-01-15 14:42:39 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P3 normal |
Assigned to: | Jan-Mathijs Schoffelen |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Stephen Whitmarsh - 2012-05-02 08:51:23 +0200
------------------------------- -- calling sourcestatistics: -- ------------------------------- cfg = []; cfg.statistic = 'indepsamplesT'; cfg.method = 'montecarlo'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.parameter = 'stat'; cfg.alpha = 0.025; cfg.feedback = 'textbar'; cfg.ivar = 1; cfg.design = [ones(1,size(find(group==-1),2)) ones(1,size(find(group==-1),2))*2] ; stat_con{itime} = ft_sourcestatistics(cfg,data{find(group==-1)},dummy{find(group==-1)}); -------------------- -- all goes well: -- -------------------- only selecting voxels inside the brain for statistics (56.6%) using "ft_statistics_montecarlo" for the statistical testing using "statfun_indepsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 28 total number of variables = 1 number of independent variables = 1 number of unit variables = 0 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach computing a parametric threshold for clustering estimated time per randomization is 0 seconds computing statistic [-----------------------------------------------------/] ------------------------ -- until clusterstat: -- ------------------------ ??? Error using ==> spm_bwlabel spm_bwlabel: CONN must be 6, 18 or 26 Error in ==> clusterstat at 192 [posclusobs, posnum] = spm_bwlabel(tmp, 2*numdims); % use spm_bwlabel for 2D/3D data to avoid usage of image toolbox Error in ==> ft_statistics_montecarlo at 325 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 290 [stat, cfg] = statmethod(cfg, dat, design, 'issource',issource); Error in ==> ft_sourcestatistics at 102 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); 192 [posclusobs, posnum] = spm_bwlabel(tmp, 2*numdims); % use spm_bwlabel for 2D/3D data to avoid usage of image toolbox
Stephen Whitmarsh - 2012-05-02 08:51:53 +0200
roemer?
Robert Oostenveld - 2012-05-02 08:55:33 +0200
can you provide details on the matlab version and the operating system (or mentat name)? and please provide the output of "which spm_bwlabeln"
Stephen Whitmarsh - 2012-05-02 09:02:45 +0200
Ah...: spm_bwlabel thinks it's got a 3D image, because the 2D source data is represented in a pos structure: stat: [38556x1 double] dim: [38556 1] inside: [1x21819 double] outside: [1x16737 double] pos: [38556x3 double] dimord: 'pos_freq'
Stephen Whitmarsh - 2012-05-02 09:33:40 +0200
workaround for now is to add appropriate dim field (e.g. with pos2dim3d). Problem was the problem of locating the moment where the inappropriate dim was added to the data (and the old one was lost). To get to the bottom of this and other possible conflicts it is now suggested to make a sourcestatistics testscripts for 1) first-level sourcestatistics 2) second level sourcestatistics. This should be based on the whole collection of (historical) testdata (made two bugbinges ago).
Robert Oostenveld - 2013-11-14 11:54:44 +0100
I just did some small (general) cleanups to that function mac001> svn commit private/clusterstat.m Sending private/clusterstat.m Transmitting file data . Committed revision 8778.