Back to the main page.

Bug 727 - misleading help about cfg options in ft_volumesegment causes error

Status CLOSED FIXED
Reported 2011-06-02 15:11:00 +0200
Modified 2011-06-08 14:47:31 +0200
Product: FieldTrip
Component: forward
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 minor
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

- 2011-06-02 15:11:56 +0200

Dear all, There is (FT from may 31st) a problem with the handling of the cfg.smooth option. This option typically handles numerical values. It's default, however, is 'no', according to the function HELP. The error occurs if the default option 'no' is explicitely set (don't know yet about normal defaulting). The cause is the following: 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');


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

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


Jan-Mathijs Schoffelen - 2011-06-02 20:32:08 +0200

I changed the handling of the default 'no' to be converted to nan