Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fieldtrip/fieldtrip
Browse files Browse the repository at this point in the history
  • Loading branch information
schoffelen committed Apr 5, 2024
2 parents ba4bcea + 1edfa2b commit 6fc9a3b
Show file tree
Hide file tree
Showing 46 changed files with 159 additions and 116 deletions.
3 changes: 1 addition & 2 deletions fileio/ft_chantype.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@

if all(contains(input.label, '-'))
% this applies when splitlabel=false
input.label = split(input.label(:), '-');
input.label = input.label(:,1);
input.label = strtok(input.label, '-'); % take the part before the dash
end

% in principle it is possible to look at the number of coils, but here the channels are identified based on their name
Expand Down
24 changes: 13 additions & 11 deletions fileio/ft_read_header.m
Original file line number Diff line number Diff line change
Expand Up @@ -2952,24 +2952,26 @@

if ~isempty(splitlabel) && istrue(splitlabel)
% this is default for CTF and FieldLine v3
for i=1:numel(hdr.label)
hdr.label{i} = strtok(hdr.label{i}, '-');
end
hdr.label = strtok(hdr.label, '-');
% also update the grad, elec and opto structure
if isfield(hdr, 'grad')
for i=1:numel(hdr.grad.label)
hdr.grad.label{i} = strtok(hdr.grad.label{i}, '-');
hdr.grad.label = strtok(hdr.grad.label, '-');
if isfield(hdr.grad, 'balance')
% also update the G1BR, G2BR and G3BR balancing structures
fn = fieldnames(hdr.grad.balance);
for i=1:numel(fn)
if isstruct(hdr.grad.balance.(fn{i}))
hdr.grad.balance.(fn{i}).labelold = strtok(hdr.grad.balance.(fn{i}).labelold, '-');
hdr.grad.balance.(fn{i}).labelnew = strtok(hdr.grad.balance.(fn{i}).labelnew, '-');
end
end
end
end
if isfield(hdr, 'elec')
for i=1:numel(hdr.elec.label)
hdr.elec.label{i} = strtok(hdr.elec.label{i}, '-');
end
hdr.elec.label = strtok(hdr.elec.label, '-');
end
if isfield(hdr, 'opto')
for i=1:numel(hdr.opto.label)
hdr.opto.label{i} = strtok(hdr.opto.label{i}, '-');
end
hdr.opto.label = strtok(hdr.opto.label, '-');
end
end

Expand Down
5 changes: 3 additions & 2 deletions fileio/private/bids_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
% hdr = bids_tsv(filename);
% dat = bids_tsv(filename, hdr, begsample, endsample, chanindx);
% evt = bids_tsv(filename, hdr);
% to read the header, the data or the event information.
% to read either the header, the data or the events.
%
% You should specify the name of the file containing the data as the filename, e.g.
% the _physio.tsv or the _stim.tsv file.
%
% See https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/06-physiological-and-other-continuous-recordings.html
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D, EVENTS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019, Robert Oostenveld
%
Expand Down
3 changes: 2 additions & 1 deletion fileio/private/biopac_acq.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
% evt = biopac_acq(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2018 Robert Oostenveld
% Copyright (C) 2018-2024 Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
10 changes: 8 additions & 2 deletions fileio/private/bucn_txt.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
% BUCN_TXT reads the txt files produced by the UCL-Birkbeck NIRS machines, also known
% as the NTS fNIRS system from Gowerlabs. See https://www.gowerlabs.co.uk/nts
%
% See also READ_BUCN_NIRSHDR, READ_BUCN_NIRSDATA, READ_BUCN_NIRSEVENT, QUALISYS_TSV, MOTION_C3D
% Use as
% hdr = bucn_txt(filename);
% dat = bucn_txt(filename, hdr, begsample, endsample, chanindx);
% evt = bucn_txt(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, READ_BUCN_NIRSHDR, READ_BUCN_NIRSDATA, READ_BUCN_NIRSEVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2022, Robert Oostenveld
% Copyright (C) 2022-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
9 changes: 5 additions & 4 deletions fileio/private/eegsynth_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
% Use as
% hdr = events_tsv(filename)
% evt = events_tsv(filename, hdr)
% to read the header or the event information. Note that when reading the header, the
% number of channels in the actual data is unknown.
%
% Note that when reading the header, the number of channels in the actual data is unknown.
%
% See https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/05-task-events.html
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, EVENTS_TSV, BIDS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% FIXME it might be that the events are one sample off, but I cannot be bothered
% checking that precisely at the moment of the initial implementation.

% Copyright (C) 2022, Robert Oostenveld
% Copyright (C) 2022-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
7 changes: 4 additions & 3 deletions fileio/private/events_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

% EVENTS_TSV is called from FT_READ_EVENT to read the events from a BIDS _events.tsv
% file. Although this function also reads the header for the sampling rate, it cannot
% be used to read data. Please see BIDS_TSV for that.
% be used to read data. Please see BIDS_TSV for reading data.
%
% Use as
% hdr = events_tsv(filename)
Expand All @@ -14,9 +14,10 @@
%
% See https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/05-task-events.html
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D, BIDS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2018-2020, Robert Oostenveld
% Copyright (C) 2018-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
2 changes: 1 addition & 1 deletion fileio/private/ft_senstype.m
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@

if strcmp(type, 'unknown') && all(contains(sens.label, '-'))
% this applies to CTF and FieldLine data when splitlabel=false
sens.label = split(sens.label(:), '-');
sens.label = strtok(sens.label, '-'); % take the part before the dash
type = ft_senstype(sens.label(:,1));
end

Expand Down
5 changes: 3 additions & 2 deletions fileio/private/liberty_csv.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = liberty_csv(filename, hdr, begsample, endsample, chanindx);
% evt = liberty_csv(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, MOTION_C3D, QUALISYS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2021, Robert Oostenveld
% Copyright (C) 2021-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/maus_textgrid.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
% You should pass the *.TextGrid file as the filename, There should be a
% corresponding wav file with the same filename in the same directory.
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019 Robert Oostenveld
% Copyright (C) 2019-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/motion_c3d.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = motion_c3d(filename, hdr, begsample, endsample, chanindx);
% evt = motion_c3d(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019 Robert Oostenveld
% Copyright (C) 2019-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/openbci_txt.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = openbci_txt(filename, hdr, begsample, endsample, chanindx);
% evt = openbci_txt(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D, OPENSIGNALS_TXT
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2020 Robert Oostenveld
% Copyright (C) 2020-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/openpose_keypoints.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = openpose_keypoints(filename, hdr, begsample, endsample, chanindx);
% evt = openpose_keypoints(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2021, Robert Oostenveld
% Copyright (C) 2021-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/opensignals_txt.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = opensignals_txt(filename, hdr, begsample, endsample, chanindx);
% evt = opensignals_txt(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019 Robert Oostenveld
% Copyright (C) 2019-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/openvibe_mat.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
% dat = openvibe_mat(filename, hdr, begsample, endsample, chanindx);
% evt = openvibe_mat(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, XSENS_MVNX
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2023 Robert Oostenveld
% Copyright (C) 2023-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/opm_fil.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
%
% See https://github.com/tierneytim/OPM for technical details.
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D, EVENTS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2020, Robert Oostenveld
% Copyright (C) 2020-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/qualisys_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
% dat = qualysis_tsv(filename, hdr, begsample, endsample, chanindx);
% evt = qualysis_tsv(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, MOTION_C3D
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019 Robert Oostenveld
% Copyright (C) 2019-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
3 changes: 2 additions & 1 deletion fileio/private/sccn_xdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
% evt = sccn_xdf(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, XDF2FIELDTRIP
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2019, Robert Oostenveld
% Copyright (C) 2019-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/sensys_csv.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
% dat = sensys_csv(filename, hdr, begsample, endsample, chanindx);
% evt = sensys_csv(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, MOTION_C3D, QUALISYS_TSV, LIBERTY_CSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2022, Robert Oostenveld
% Copyright (C) 2022-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/snirf.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
% with a different sampling frequency. That is not allowed in this code; all channels
% must have the same sampling rate and be sampled at the same time.
%
% See also SNIRF2OPTO, FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV, MOTION_C3D
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, SNIRF2OPTO
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2020, Robert Oostenveld
% Copyright (C) 2020-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
5 changes: 3 additions & 2 deletions fileio/private/unicorn_csv.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
% dat = unicorn_csv(filename, hdr, begsample, endsample, chanindx);
% evt = unicorn_csv(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, MOTION_C3D, QUALISYS_TSV, LIBERTY_CSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2022, Robert Oostenveld
% Copyright (C) 2022-2024, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
14 changes: 8 additions & 6 deletions fileio/private/xsens_mvnx.m
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
function varargout = xsens_mvnx(filename, hdr, begsample, endsample, chanindx)

% XSENS_MVNX reads motion tracking data from a file that was created by
% xsens MVN motion systems, see: https://www.xsens.com/motion-capture. The
% current function is designed to read in .mvnx files from release version
% 4.
% XSENS_MVNX reads motion tracking data from a file that was created by XSens MVN
% motion capture systems. This function is designed to read in .mvnx files from
% release version 4.
%
% See https://www.xsens.com/motion-capture
%
% Use as
% hdr = xsens_mvnx(filename);
% dat = xsens_mvnx(filename, hdr, begsample, endsample, chanindx);
% evt = xsens_mvnx(filename, hdr);
%
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT, QUALISYS_TSV
% See also FT_FILETYPE, FT_READ_HEADER, FT_READ_DATA, FT_READ_EVENT
% See also BIDS_TSV, BIOPAC_ACQ, BUCN_TXT, EEGSYNTH_TSV, EVENTS_TSV, LIBERTY_CSV, MAUS_TEXTGRID, MOTION_C3D, OPENBCI_TXT, OPENPOSE_KEYPOINTS, OPENSIGNALS_TXT, OPENVIBE_MAT, OPM_FIL, QUALISYS_TSV, SCCN_XDF, SENSYS_CSV, SNIRF, UNICORN_CSV, XSENS_MVNX

% Copyright (C) 2020 Helena Cockx
% Copyright (C) 2020-2024, Helena Cockx
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
Expand Down
2 changes: 1 addition & 1 deletion forward/ft_senstype.m
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@

if strcmp(type, 'unknown') && all(contains(sens.label, '-'))
% this applies to CTF and FieldLine data when splitlabel=false
sens.label = split(sens.label(:), '-');
sens.label = strtok(sens.label, '-'); % take the part before the dash
type = ft_senstype(sens.label(:,1));
end

Expand Down
4 changes: 2 additions & 2 deletions ft_appendsource.m
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
freq = freq(ix);
end

source = keepfields(varargin{1}, {'pos' 'dim' 'time' 'tri'});
source = keepfields(varargin{1}, {'pos', 'tri', 'dim', 'unit', 'coordsys', 'time'});
source.freq = cat(2, freq{:});

case 'time'
Expand Down Expand Up @@ -314,7 +314,7 @@
time = time(ix);
end

source = keepfields(varargin{1}, {'pos' 'dim' 'freq' 'tri'});
source = keepfields(varargin{1}, {'pos', 'tri', 'dim', 'unit', 'coordsys', 'time'});
source.time = cat(2, time{:});

otherwise
Expand Down
2 changes: 1 addition & 1 deletion ft_connectivityanalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@
end

case {'source' 'source+mesh'}
stat = keepfields(data, {'pos', 'dim', 'transform', 'inside', 'outside' 'tri'});
stat = keepfields(data, {'pos', 'tri', 'dim', 'transform', 'unit', 'coordsys', 'inside'});
stat.(outparam) = datout;
if ~isempty(varout)
stat.([outparam, 'sem']) = (varout/nrpt).^0.5;
Expand Down
2 changes: 1 addition & 1 deletion ft_defacevolume.m
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
end

if istrue(cfg.feedback)
tmpmri = keepfields(mri, {'anatomy', 'transform', 'coordsys', 'units', 'dim'});
tmpmri = keepfields(mri, {'anatomy', 'dim', 'transform', 'unit', 'coordsys'});
tmpmri.remove = remove;
tmpcfg = [];
tmpcfg.funparameter = 'remove';
Expand Down
2 changes: 1 addition & 1 deletion ft_dipolefitting.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
if isfield(cfg.sourcemodel, 'leadfield')
ft_notice('using precomputed leadfields for the gridsearch');

sourcemodel = keepfields(cfg.sourcemodel, {'pos', 'tri', 'dim', 'inside', 'leadfield', 'leadfielddimord', 'label'});
sourcemodel = keepfields(cfg.sourcemodel, {'pos', 'tri', 'dim', 'unit', 'coordsys', 'inside', 'leadfield', 'leadfielddimord', 'label'});

% select the channels corresponding to the data and the user configuration
tmpcfg = keepfields(cfg, 'channel');
Expand Down
Loading

0 comments on commit 6fc9a3b

Please sign in to comment.