__detrend_regress(dataset,
perchunk=True,
polyord=None,
opt_reg=None)
| source code
|
Given a dataset, perform a detrend inplace, regressing out polynomial
terms as well as optional regressors, such as motion parameters.
- Parameters:
dataset (Dataset) - Dataset to operate on
perchunk (bool) - Either to operate on whole dataset at once or on each chunk
separately. If perchunk is True, all the samples within a
chunk should be contiguous and the chunks should be sorted in
order from low to high.
polyord (int) - Order of the Legendre polynomial to remove from the data. This
will remove every polynomial up to and including the provided
value. For example, 3 will remove 0th, 1st, 2nd, and 3rd order
polynomials from the data. N.B.: The 0th polynomial is the
baseline shift, the 1st is the linear trend.
If you specify a single int and perchunk is True, then this value
is used for each chunk. You can also specify a different polyord
value for each chunk by providing a list or ndarray of polyord
values the length of the number of chunks.
opt_reg (ndarray) - Optional ndarray of additional information to regress out from the
dataset. One example would be to regress out motion parameters.
As with the data, time is on the first axis.
|