Skip to content

Commit c423287

Browse files
cleaned up the reference documentation in the help
1 parent bf78f06 commit c423287

28 files changed

+345
-369
lines changed

Contents.m

+13-13
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
% of the GNU General Public Licence as published by the Free Software Foundation (either
2020
% version 2, or at your option any later version). See the file COPYING for more
2121
% details.
22-
%
22+
%
2323
% The functions in this toolbox are copyrighted by their respective authors:
2424
% Robert Oostenveld, DCCN, FCDC, SMI, MBFYS
2525
% Jan-Mathijs Schoffelen, CCNi, FCDC
@@ -38,17 +38,17 @@
3838
% Lilla Magyari, MPI, DCCN
3939
% and many others ...
4040
%
41-
% Copyright (C) 2008-2018, Donders Institute, Radboud University, The Netherlands (DCCN, DCC, DCN, DCMN)
42-
% Copyright (C) 2014-2018, Karolinska Institute, Stockholm, Sweden (NatMEG)
43-
% Copyright (C) 2012-2016, Max Planck Institute for Psycholinguistics, The Netherlands (MPI)
44-
% Copyright (C) 2010-2013, Swammerdam Institute for Life Sciences, University of Amsterdam (SILS)
45-
% Copyright (C) 2008-2009, Centre for Cognitive Neuroimaging in Glasgow, United Kingdom (CCNi)
46-
% Copyright (C) 2009-2009, Netherlands Institute for Neuroscience (NIN)
47-
% Copyright (C) 2003-2008, F.C. Donders Centre, Radboud University Nijmegen, The Netherlands (FCDC)
48-
% Copyright (C) 2004-2007, Nijmegen Institute for Cognition and Information, The Netherlands (NICI)
49-
% Copyright (C) 2004-2005, Universitatsklinikum Hamburg-Eppendorf, Germany (UKE)
50-
% Copyright (C) 2003-2004, Center for Sensory Motor Interaction, University Aalborg, Denmark (SMI)
51-
% Copyright (C) 1999-2003, Department of Medical Physics, Katholieke Universiteit Nijmegen, The Netherlands (MBFYS)
41+
% Copyright (C) 2008-2018, Donders Institute, Radboud University, The Netherlands (DCCN, DCC, DCN, DCMN)
42+
% Copyright (C) 2014-2018, Karolinska Institute, Stockholm, Sweden (NatMEG)
43+
% Copyright (C) 2012-2016, Max Planck Institute for Psycholinguistics, The Netherlands (MPI)
44+
% Copyright (C) 2010-2013, Swammerdam Institute for Life Sciences, University of Amsterdam (SILS)
45+
% Copyright (C) 2008-2009, Centre for Cognitive Neuroimaging in Glasgow, United Kingdom (CCNi)
46+
% Copyright (C) 2009-2009, Netherlands Institute for Neuroscience (NIN)
47+
% Copyright (C) 2003-2008, F.C. Donders Centre, Radboud University Nijmegen, The Netherlands (FCDC)
48+
% Copyright (C) 2004-2007, Nijmegen Institute for Cognition and Information, The Netherlands (NICI)
49+
% Copyright (C) 2004-2005, Universitatsklinikum Hamburg-Eppendorf, Germany (UKE)
50+
% Copyright (C) 2003-2004, Center for Sensory Motor Interaction, University Aalborg, Denmark (SMI)
51+
% Copyright (C) 1999-2003, Department of Medical Physics, Katholieke Universiteit Nijmegen, The Netherlands (MBFYS)
5252
%
5353
% The FieldTrip toolbox depend on functions from other toolboxes to do a large part of
5454
% the actual work, such as reading data from binary files and forward and inverse
@@ -60,7 +60,7 @@
6060
% the GPL is not allowed!
6161
%
6262
% Below is a non-exhaustive overview of some of the important FieldTrip functions, sorted by category.
63-
% You can get more details on a function by typing "help functionname" in MATLAB.
63+
% You can get more details on a function by typing 'help functionname' in MATLAB.
6464
%
6565
% Preprocessing, reading and converting data
6666
% ft_definetrial

connectivity/ft_connectivity_laggedcoherence.m

+13-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
% the time resolution in freqout.
1717
%
1818
% This function must be called separately for each frequency of interest. To analyse
19-
% multiple frequencies, we advise the use of a for loop like this:
19+
% multiple frequencies, you can use a for-loop like this:
2020
% cfg_F = [];
2121
% cfg_F.method = 'wavelet';
2222
% cfg_F.output = 'fourier';
@@ -32,8 +32,8 @@
3232
% cfg_LC.foi = foi(counter);
3333
% width = cfg_F.width/cfg_F.foi;
3434
% cfg_F.toi = data.time{1}(1) + ceil(fs*width/2)/fs : ... %from:
35-
% cfg_LC.lag/cfg_F.foi : ... %in steps of size:
36-
% data.time{1}(end) - ceil(fs*width/2)/fs; %to:
35+
% cfg_LC.lag/cfg_F.foi : ... %in steps of size:
36+
% data.time{1}(end) - ceil(fs*width/2)/fs; %to:
3737
% freqout = ft_freqanalysis(cfg_F,data);
3838
% lcoh(counter) = ft_connectivityanalysis(cfg_LC,freqout);
3939
% end
@@ -207,13 +207,13 @@
207207
hasdata = false(nrep,cfg.nlags);
208208
nsmplslaggedcps = zeros(cfg.nlags,nrep);
209209
lagwidth = zeros(1,cfg.nlags);
210-
210+
211211
for lagindx=1:cfg.nlags
212212
% select all pairs of timepoints with relative lag cfg.lag (identified with precision cfg.precision)
213213
lagwidth(lagindx) = cfg.lag*cyclelength*lagindx;
214214
lagwidth(lagindx) = dtim(find(abs(dtim-lagwidth(lagindx))==min(abs(dtim(:)-lagwidth(lagindx))),1));
215215
[t1, t2] = find(dtim==lagwidth(lagindx));
216-
216+
217217
% calculate laggedcrossproducts and power per channelcmb and trial
218218
for trialindx=1:nrep
219219
% get the spectrum for this trial and frequency
@@ -234,7 +234,7 @@
234234
end
235235
end
236236
end
237-
237+
238238
% calculate lagged coherence
239239
if strcmp('lcoh',cfg.output)
240240
laggedcoh = complex(nan(ntrialsets,nchancmb,cfg.nlags));
@@ -283,7 +283,7 @@
283283
lcoh.dimord = 'rep_chan_rep';
284284
end
285285
end
286-
286+
287287
% calculate lagged crossspectra and corresponding power spectra
288288
elseif csdflag
289289
laggedcrsspctrm = complex(zeros(ntrialsets,nchancmb,cfg.nlags));
@@ -343,24 +343,24 @@
343343
end
344344
end
345345
end
346-
346+
347347
case 'yes'
348348
% method-specfic checks
349349
if cfg.nlags>1
350350
ft_error('when calculating timeresolved lcoh, cfg.nlags must be set to 1');
351351
end
352-
352+
353353
% select pairs of timepoints with relative lag cfg.lag (identified with precision cfg.precision)
354354
lagwidth = cfg.lag*cyclelength;
355355
lagwidth = dtim(find(abs(dtim-lagwidth)==min(abs(dtim(:)-lagwidth)),1));
356356
[t1, t2] = find(dtim==lagwidth);
357-
357+
358358
% initiate some variables (dependent on nr of timepoints)
359359
ntoi = length(t1);
360360
laggedcrossproduct = complex(zeros(nchancmb,ntoi,nrep));
361361
power = complex(zeros(nchancmb,ntoi,2,nrep));
362362
hasdata = false(nrep,ntoi);
363-
363+
364364
% calculate laggedcrossproducts and power per channel, time of interest, and trial
365365
for trialindx=1:nrep
366366
% get the spectrum for this trial and frequency
@@ -379,7 +379,7 @@
379379
hasdata(trialindx,tcounter) = true;
380380
end
381381
end
382-
382+
383383
% calculate lagged coherence
384384
if strcmp('lcoh',cfg.output)
385385
ntrialsets = length(cfg.trialsets);
@@ -423,7 +423,7 @@
423423
end
424424
lcoh.dimord = 'rep_chan_time';
425425
end
426-
426+
427427
% calculate lagged crossspectra and corresponding power spectra
428428
elseif csdflag
429429
laggedcrsspctrm = complex(nan(ntrialsets,nchancmb,ntoi));

data2bids.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
% or as
1414
% data2bids(cfg, data)
1515
%
16-
% The first input argument "cfg" is the configuration structure, which contains the
16+
% The first input argument 'cfg' is the configuration structure, which contains the
1717
% details for the (meta)data and which specifies the sidecar files you want to write.
18-
% The optional "data" argument corresponds to preprocessed raw data according to
18+
% The optional 'data' argument corresponds to preprocessed raw data according to
1919
% FT_DATAYPE_RAW or an anatomical MRI according to FT_DATAYPE_VOLUME. The optional
2020
% data argument allows you to write a preprocessed and realigned anatomical MRI to
2121
% disk, or to write a preprocessed electrophysiological dataset to disk.

edf2fieldtrip.m

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
% output of FT_PREPROCESSING.
77
%
88
% Use as
9-
% data = edf2fieldtrip(filename);
9+
% data = edf2fieldtrip(filename)
1010
%
1111
% For reading EDF files in which all channels have the same sampling rate, you can
1212
% use the standard procedure with FT_DEFINETRIAL and FT_PREPROCESSING.
@@ -41,14 +41,14 @@
4141
for i=1:numel(samplerate)
4242
chanindx = find(hdr.orig.SampleRate==samplerate(i));
4343
fprintf('reading %d channels with %g Hz sampling rate\n', numel(chanindx), samplerate(i));
44-
44+
4545
% read the header and data for the selected channels
4646
hdr = ft_read_header(filename, 'chanindx', chanindx);
4747
dat = ft_read_data(filename, 'header', hdr);
48-
48+
4949
% construct a time axis, starting at 0 seconds
5050
time = ((1:(hdr.nTrials*hdr.nSamples)) - 1)./hdr.Fs;
51-
51+
5252
% make a raw data structure
5353
data{i}.hdr = hdr;
5454
data{i}.label = hdr.label;
@@ -64,7 +64,7 @@
6464
continue
6565
end
6666
fprintf('upsampling %d channels from %g to %g Hz\n', numel(data{i}.label), samplerate(i), maxrate);
67-
67+
6868
cfg = [];
6969
cfg.time = data{maxindex}.time;
7070
data{i} = ft_resampledata(cfg, data{i});
@@ -88,5 +88,3 @@
8888
% remove this, as otherwise it might be very confusing with the subselections
8989
data = rmfield(data, 'hdr');
9090
end
91-
92-

external/artinis/ft_nirs_prepare_ODtransformation.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% oxygenated hemoglobin.
66
%
77
% Use as
8-
% [montage] = ft_prepare_ODtransformation(cfg, data);
8+
% [montage] = ft_prepare_ODtransformation(cfg, data)
99
%
1010
% It is neccessary to input the data on which you want to perform the
1111
% inverse computations, since that data generally contain the optode

external/artinis/ft_nirs_transform_ODs.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
% other way around.
66
%
77
% Use as either
8-
% [data] = ft_nirs_transform_ODs(cfg, data);
9-
% [freq] = ft_nirs_transform_ODs(cfg, freq);
10-
% [timelock] = ft_nirs_transform_ODs(cfg, timelock);
11-
% [component] = ft_nirs_transform_ODs(cfg, component);
8+
% [data] = ft_nirs_transform_ODs(cfg, data)
9+
% [freq] = ft_nirs_transform_ODs(cfg, freq)
10+
% [timelock] = ft_nirs_transform_ODs(cfg, timelock)
11+
% [component] = ft_nirs_transform_ODs(cfg, component)
1212
%
1313
% The configuration "cfg" is a structure containing information about
1414
% target of the transformation. The configuration should contain

fieldtrip2besa.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ function fieldtrip2besa(filename, data, varargin)
66
%
77
% Use as
88
% fieldtrip2besa(filename, elec)
9-
% to export single trial data as a set of ascii-vectorized files (.avr)
9+
% to export single trial data as a set of .avr files.
1010
%
1111
% Use as
1212
% fieldtrip2besa(filename, elec)
1313
% or
1414
% fieldtrip2besa(filename, grad)
15-
% to export channel positions (.elp).
15+
% to export channel positions to an .elp file.
1616
%
1717
% Additional key-value pairs can be specified according to
1818
% channel = cell-array, can be used to make subset and to reorder the channels
@@ -53,7 +53,7 @@ function fieldtrip2besa(filename, data, varargin)
5353

5454
if isfield(data, 'trial') && strcmp(getdimord(data, 'trial'), 'rpt_chan_time')
5555
[NumTrials, NumChans, NumSamp] = size(data.trial);
56-
56+
5757
% Multiply by 1000 to get the time in milliseconds.
5858
time_samples = data.time.*1000;
5959
channel_labels = data.label;

ft_annotate.m

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
% FT_ANNOTATE returns the same output data as the user has provided as input, but allows
44
% to add comments to that data structure. These comments are stored along with the other
55
% provenance information and can be displayed with FT_ANALYSISPIPELINE. Adding comments
6-
% is especially useful if you have manually (i.e. in plain MATLAB) modified ythe data
6+
% is especially useful if you have manually (i.e. in plain MATLAB) modified the data
77
% structure, whereby some provenance information is missing.
88
%
99
% Use as
1010
% outdata = ft_examplefunction(cfg, indata)
11-
% where the input data structure can be any of the FieldTrip data structures and where
12-
% cfg is a configuratioun structure that should contain
13-
%
14-
% cfg.comment = string
11+
% where the input data structure can be any of the FieldTrip data structures and
12+
% the configuration structure should contain
13+
% cfg.comment = string
1514
%
1615
% To facilitate data-handling and distributed computing you can use
1716
% cfg.inputfile = ...

ft_anonymizedata.m

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
% value of each provenance element, and whether it should be kept or
2020
% removed. Furthermore, it has a number of buttons:
2121
% - sort specify which column is used for sorting
22-
% - apply apply the current selection of "keep" and "remove" and hide the corresponding rows
23-
% - keep all toggle all visibe rows to "keep"
24-
% - remove all toggle all visibe rows to "keep"
25-
% - clear all clear all visibe rows, i.e. neither "keep" nor "remove"
26-
% - quit apply the current selection of "keep" and "remove" and exit
22+
% - apply apply the current selection of 'keep' and 'remove' and hide the corresponding rows
23+
% - keep all toggle all visibe rows to 'keep'
24+
% - remove all toggle all visibe rows to 'keep'
25+
% - clear all clear all visibe rows, i.e. neither 'keep' nor 'remove'
26+
% - quit apply the current selection of 'keep' and 'remove' and exit
2727
%
2828
% To facilitate data-handling and distributed computing you can use
2929
% cfg.inputfile = ...
@@ -218,15 +218,15 @@
218218
resize_cb(h);
219219

220220
while ~info.cleanup
221-
221+
222222
uiwait(h); % we only get part this point with abort or cleanup
223-
223+
224224
if ~ishandle(h)
225225
ft_error('aborted by user');
226226
end
227-
227+
228228
info = getappdata(h, 'info');
229-
229+
230230
if info.cleanup
231231
if ~all(xor(info.keep, info.remove))
232232
ft_warning('not all fields have been marked as "keep" or "remove"');

ft_appendsens.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
% combined = ft_appendsens(cfg, sens1, sens2, ...)
88
%
99
% A call to FT_APPENDSENS results in the label, pos and ori fields to be
10-
% concatenated, and the tra matrix to be merged. Any duplicates will be removed.
11-
% The labelold and chanposold fields are kept under the condition that they
12-
% are identical across the inputs.
10+
% concatenated, and the tra matrix to be merged. Any duplicate electrodes
11+
% will be removed. The labelold and chanposold fields are kept under the
12+
% condition that they are identical across the inputs.
1313
%
1414
% See also FT_ELECTRODEPLACEMENT, FT_ELECTRODEREALIGN, FT_DATAYPE_SENS,
1515
% FT_APPENDDATA, FT_APPENDTIMELOCK, FT_APPENDFREQ, FT_APPENDSOURCE
@@ -108,7 +108,7 @@
108108
if isfield(varargin{i}, 'chanpos')
109109
chanpos{i} = varargin{i}.chanpos;
110110
end
111-
111+
112112
% some the following fields are likely present in a sens structure
113113
if isfield(varargin{i}, 'elecpos') % EEG
114114
elecpos{i} = varargin{i}.elecpos;
@@ -134,7 +134,7 @@
134134
tra{i} = varargin{i}.tra;
135135
hastra = 1;
136136
end
137-
137+
138138
% the following fields might be present in a sens structure
139139
if isfield(varargin{i}, 'labelold')
140140
labelold{i} = varargin{i}.labelold(:); % ensure column orientation

ft_appendsource.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
% FT_APPENDSOURCE concatenates multiple volumetric source reconstruction data
44
% structures that have been processed separately.
55
%
6+
% Use as
7+
% combined = ft_appendsource(cfg, source1, source2, ...)
8+
%
69
% If the source reconstructions were computed for different ROIs or different slabs
710
% of a regular 3D grid (as indicated by the source positions), the data will be
811
% concatenated along the spatial dimension.
@@ -12,9 +15,6 @@
1215
% decomposed data, the data will be concatenared along the frequency and/or time
1316
% dimension.
1417
%
15-
% Use as
16-
% combined = ft_appendsource(cfg, source1, source2, ...)
17-
%
1818
% See also FT_SOURCEANALYSIS, FT_DATATYPE_SOURCE, FT_APPENDDATA, FT_APPENDTIMELOCK,
1919
% FT_APPENDFREQ
2020

ft_appendtimelock.m

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
% Use as
1010
% combined = ft_appendtimelock(cfg, timelock1, timelock2, ...)
1111
%
12-
% The following configuration options are supported:
13-
%
14-
% The configuration can optionally contain
12+
% The configuration can contain
1513
% cfg.appenddim = string, the dimension to concatenate over which to append,
1614
% this can be 'chan' and 'rpt' (default is automatic)
1715
% cfg.tolerance = scalar, tolerance to determine how different the time axes
@@ -113,7 +111,7 @@
113111
if any(strcmp(cfg.parameter, 'avg')) && any(strcmp(cfg.parameter, 'trial'))
114112
ft_warning('appending the individual trials, not the averages');
115113
% also prevent var and dof from being appended
116-
cfg.parameter = setdiff(cfg.parameter, {'avg', 'var', 'dof'});
114+
cfg.parameter = setdiff(cfg.parameter, {'avg', 'var', 'dof'});
117115
end
118116

119117
% use a low-level function that is shared with the other ft_appendxxx functions

ft_artifact_nan.m

-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@
9797
ft_postamble trackconfig
9898
ft_postamble previous data
9999
ft_postamble savevar
100-

0 commit comments

Comments
 (0)