bids.analysis
.Analysis¶
-
class
Analysis
(layout, model)[source]¶ Represents an entire BIDS-Model analysis.
Parameters: - layout (BIDSLayout, str) – A BIDSLayout instance or path to pass on to the BIDSLayout initializer.
- model (str or dict) – a BIDS model specification. Can either be a string giving the path of the JSON model spec, or an already-loaded dict containing the model info.
Methods
setup
([blocks, agg_func])Set up the sequence of blocks for analysis. -
setup
(blocks=None, agg_func='mean', **kwargs)[source]¶ Set up the sequence of blocks for analysis.
Parameters: - blocks (list) – Optional list of blocks to set up. Each element must be either an int giving the index of the block in the JSON config block list, or a str giving the (unique) name of the block, as specified in the JSON config. Blocks that do not match either index or name will be skipped.
- agg_func (str or Callable) – The aggregation function to use when combining rows from the previous level of analysis. E.g., when analyzing a ‘subject’-level block, inputs coming from the ‘session’ level are typically averaged to produce individual subject-level estimates. Must be either a string giving the name of a function recognized by apply() in pandas, or a Callable that takes a DataFrame as input and returns a Series or a DataFrame. NOTE: CURRENTLY UNIMPLEMENTED.