pydmr.read#
- pydmr.read(path, format='flat', subject=None, study=None, parameter=None)[source]#
Read .dmr data from disk.
- Parameters:
path (str) – Path to .dmr file where the data are
included. (saved. The extensions do not need to be)
format (str, optional) – Formatting of the returned results. The default (‘flat’) returns a dictionary with a multi-index, meaning values (rois, pars, sdev) are returned as flat dictionaries with a multi-index consisting of (subject, study, parameter). If format=’nest’, these values are returned as nested dictionaries with 3 levels. If format=’table’, the values are returned as a list of lists. If format is ‘pandas’ the results are pandas dataframes. Defaults to ‘flat’.
subject (str or list, optional) – subject or list of subjects to return. If not provided, all subjects are returned. Defaults to None.
study (str or list, optional) – subject or list of subjects to return. If not provided, all studies are returned. Defaults to None.
parameter (str or list, optional) – parameter or list of parameters to return. If not provided, all parameters are returned. Defaults to None.
- Raises:
ValueError – If the data on disk are not correctly formatted.
- Returns:
- A dictionary with one item for each of the csv files
in the dmr file - keys are either ‘data’, ‘rois’, ‘pars’, ‘sdev’. The optional key ‘columns’ is returned as well if the data dictionary has optional columns, in which case it lists the names of those extra columns.
- Return type: