Back to the main page.

Bug 1312 - ft_datatype_sens is sometimes used where sens can be empty

Status CLOSED FIXED
Reported 2012-02-03 15:03:00 +0100
Modified 2019-08-10 11:56:39 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Arjen Stolk
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2012-02-03 15:03:55 +0100

On 3 Feb 2012, at 12:12, Thomas Hartmann wrote: i just found a bug in the svn version of fieldtrip. line 249 reads: sens = ft_datatype_sens(sens); this does not work if a ready-made volume is given to function. i would thus suggest to write instead: if ~isempty(sens) sens = ft_datatype_sens(sens); end i have tested this and it works without a problem. maybe you would have to check whether a cfg.vol has been given to the function....


Robert Oostenveld - 2012-02-03 15:07:09 +0100

I can imagine that the same condition (and hence error) might be present elsewhere in the code. Instead of locating those and fixing it multiple times, I think it is better to change ft_datatype_sens such that ft_datatype_sens([]) always returns empty. I can imagine this also being an appropriate strategy to harden the other ft_datatype_xxx functions. For the moment I suggest you work with your locally fixed function, I'll discuss it with the local dev team.


Arjen Stolk - 2012-02-22 08:39:19 +0100

(In reply to comment #1) This has been fixed by JM using if isempty(sens) return; end It needs discussing whether a similar enhancement is needed for the other ft_datatype_XXX in the utilities dir. For the moment I consider it fixed for this particular bug.


Jan-Mathijs Schoffelen - 2012-02-22 08:41:30 +0100

I thought that we discussed in the FT-meeting that the other ft_datatype_xxx functions need to be changed, too. I fixed this one, because I stumbled upon it during my own analysis and forgot to whom the bug was assigned ;-)


Arjen Stolk - 2012-02-22 09:47:58 +0100

(In reply to comment #3) Ok, added the ability to deal with empty input to those functions


Arjen Stolk - 2012-02-22 15:02:08 +0100

(In reply to comment #4) .. and redid the change to ft_datatype. Unlike ft_datatype_XXXs, ft_datatype does already handle the lack of data for input. Namely, it labels the datatype as 'unknown'.


Robert Oostenveld - 2019-08-10 11:56:39 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.