Back to the main page.
Bug 1167 - ft_appenddata does not work properly for freq data (when the first frequency bin contains nans?)
Status | CLOSED WONTFIX |
Reported | 2011-11-18 09:51:00 +0100 |
Modified | 2012-06-20 15:03:25 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P3 normal |
Assigned to: | Boris Reuderink |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Jörn M. Horschig - 2011-11-18 09:51:35 +0100
ft_appenddata first converts all data to a raw data-structure. The problem here seems to be that ft_checkdata tries to remove nans in line 1603. The subsequent assignment tmp = data.trial{i}(1,:); leads to a vector full of nan's. tmp = Columns 1 through 28 NaN NaN NaN [...] For some mysterious reason, the function believes that if there is a nan in the first row of the trial, all entries must be nan as well. Thus in the following, all columns that contain a nan in the first row are removed, which are all columns for me.
Boris Reuderink - 2011-11-21 11:40:33 +0100
Jörn, could you create a minimal working example, or take ownership of this bug?
Boris Reuderink - 2011-11-28 16:04:42 +0100
Bump.
Boris Reuderink - 2012-01-03 13:52:23 +0100
Bump.
Boris Reuderink - 2012-01-19 11:55:49 +0100
@Jorn: this bug is still in a unconfirmed state. Could you indicate what you want to do with this bug?
Jörn M. Horschig - 2012-01-19 12:55:53 +0100
oh sorry, I didn't see this - I'll create a short example script within the next days
Jörn M. Horschig - 2012-01-23 11:03:33 +0100
%% example script % 1) create some dummy data structure data_a = []; data_a.powspctrm(1, 1, 1, :) = [nan nan 1 1 nan nan]; data_a.powspctrm(1, 1, 2, :) = [nan 2 3 3 4 nan]; data_a.time = [1 2 3 4 5 6]; data_a.label = {'dummy'}; data_a.freq = [10 11]; data_a.dimord = 'rpt_chan_freq_time'; % 2) call ft_appenddata data_b = ft_appenddata([], data_a, data_a); % 3) verify that # samples are not the same anymore if (size(data_a.powspctrm, 4) ~= size(data_b.trial{1})) error('ft_appenddata error: #samples were truncated'); end %% I should say, maybe ft_appenddata is not supposed to work on freq data - but, it would be nice
Boris Reuderink - 2012-02-01 14:07:54 +0100
Please use ft_appendfreq (solution by JH). JH just updated (SVN revision 5199) the documentation (see ft_???). I mark this bug as resolved.