Back to the main page.

Bug 726 - issue with addressing default for smoothing in ft_volumesegment

Reported 2011-06-02 13:26:00 +0200
Modified 2011-06-08 14:47:21 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Jan-Mathijs Schoffelen - 2011-06-02 13:26:22 +0200

Dear FT'ers, Davide Rivolta posted a problem with ft_volumesegment a while ago. We have meanwhile solved this problem. There is (FT from may 31st) a problem with the handling of the cfg.smooth option. It's default is 'no', according to the function HELP. However in line 434 of ft_volumesegment, this option is put into a numerical array - this makes sense for a smoothing value. Also if no specification is given at all, then a NaN is inserted into the array. However if "no" is set explicitely then ft_getopt tries to insert the string 'no' into the array which leads to an error. Below is a script that is running and the error is once again detailed in the commets. In my opinion this could be fixed by simply updating te function HELP. Michael %%Brain segmentation – MRI mri = ft_read_mri('NPD18_V2.mri'); cfg = []; cfg.spmversion = 'spm8'; cfg.output = 'tpm'; cfg.template = 'T1.nii'; cfg.units = 'mm'; cfg.write = 'no'; cfg.coordsys = 'ctf'; cfg.downsample = 2; cfg.smooth = NaN; % works. option 'no' as recommended (!) in the function HELP throws an % error because ft_getopt on line 434 of ft_volumesegment % tries to put a string of length two into an array that is for numbers % leaving out this option also worked, but some % people might try to use this option segmentedmri = ft_volumesegment(cfg, mri); save ('segmentedmri'); _______________________________________________ fieldtrip mailing list

Jan-Mathijs Schoffelen - 2011-06-02 19:59:38 +0200

*** This bug has been marked as a duplicate of bug 727 ***