Back to the main page.

Bug 510 - spm not added to path (for call to spm_bwlabel)

Status CLOSED FIXED
Reported 2011-02-28 19:15:00 +0100
Modified 2011-03-31 14:13:54 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P1 normal
Assigned to: Arjen Stolk
URL:
Tags:
Depends on:
Blocks:
See also:

Matt Mollison - 2011-02-28 19:15:52 +0100

I'm using fieldtrip-20110227 on Matlab 2010b on a Mac Pro running OS X 10.6.6. Running a cluster analysis requires a function called spm_bwlabel, but its parent directory (fieldtrip/external/spm8) is not added to the path with a call to ft_defaults or in any of the function that lead up to calling spm_bwlabel. spm_bwlabel is also located in fieldtrip/external/spm2. If I manually add fieldtrip/external/spm8 to my path everything works fine. Here's the error I received: ===================================================== ??? Undefined function or method 'spm_bwlabel' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = spm_bwlabel(double(reshape(onoff(spatdimlev, :, :), nfreq, ntime)), 6); % the previous code contained a '4' for input Error in ==> clusterstat at 198 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 322 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 116 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); ===================================================== For now I will just add spm8 to my path in startup.m (which is where I call ft_defaults), but I'm guessing this should be done on the fly before spm_* functions are called. Matt P.S. clusterstat calls progress instead of ft_progress, and it has to print out a message about the compatibility wrapper, which I can only assume slows down the processing slightly.


Jan-Mathijs Schoffelen - 2011-02-28 19:35:58 +0100

Oh Matt, thanks for your invaluable bug reports and inevitable additional dead bodies you manage to drag out of the closet. We'll fix this as soon as possible, CC'ing and assigning this bug to Arjen Stolk, who implemented the replacement of the image processing bwlabeln by spm_bwlabel and may be just the person to fix it. @Arjen: this requires a call to ft_hastoolbox prior to calling spm_bwlabel: ft_hastoolbox('spm8',1); @Arjen: could you also ft-prefix the call to progress while you're at it?


Matt Mollison - 2011-02-28 21:40:17 +0100

(In reply to comment #1) > Oh Matt, thanks for your invaluable bug reports and inevitable additional dead > bodies you manage to drag out of the closet. No problem. ;-) Also, I don't know what the rules are for submitting fixes to the SVN server, but I would be happy to take care of minor "dead bodies" that are simple to fix. I'd be fine with larger bugs, too, but I don't want to break anyone's workflow. Let me know if you'd like me to fix minor things in the future (e.g., ft-prefixes), or I'll assume no response means I should just keep submitting bug reports when I run into something that seems relatively important. Matt


Robert Oostenveld - 2011-02-28 22:43:20 +0100

fixed in revision 3000


Arjen Stolk - 2011-03-01 08:27:17 +0100

Thanks Robert, you're one step ahead. ;) Replaced progress by ft_progress.


Robert Oostenveld - 2011-03-31 14:13:54 +0200

changed the status of most recently resolved/fixed bugs into "CLOSED"