sekupy.io.loader module

class sekupy.io.loader.DataLoader(configuration_file, task, loader='base', **kwargs)[source]

Class to load data from a configuration file.

This class sets up the loading, a configuration file and a task is needed the task should be a section in the configuration file.

Configuration file should be like this example below:

``` [path] data_path=/ subjects=subjects.csv experiment=episodic_memory types=fmri img_dim=4 TR=1.7

[fmri] sub_dir=bold event_file=attributes event_header=True img_pattern=data.nii.gz runs=1 mask_dir=masks brain_mask=lateral_ips.nii.gz

[roi_labels] lateral_ips=/media/robbis/DATA/fmri/carlo_ofp/1_single_ROIs/lateral_ips.nii.gz ```

Parameters:
  • configuration_file (str) – The path of the configuration file

  • task ([type]) – [description]

  • loader ([type], optional) – [description] (the default is load_dataset, which [default_description])

  • **kwargs (arguments dictionary, optional) –

    Arguments passed to loading functions. They override the configuration.

    data_path : str, the path where data is stored subjects : str, the path to subject file experiment : str, pipeline name, this will be discarded in future types : list of str, list of subsections of configuration file sub_dir : str, sub directory where data is stored. event_file : str, path or name of the event file mask_dir : str, path of mask/ROIs directories brain_mask : str, name of the mask/ROI to use for reduce voxels roi_labels : dict, a dictionary with ROI name as key and path to ROI as value.

fetch(prepro=None, n_subjects=None, subject_names=None)[source]

Fetch data from disk.

This function starts to load data given the information provided in the constructor.

Parameters:
  • prepro (PreprocessingPipeline)

  • strings (or list of) – Preprocessing steps to be perfrormed at subject level (the default is None)

  • optional – Preprocessing steps to be perfrormed at subject level (the default is None)

  • n_subjects (int, optional) –

    Number of subjects to load in the order provided by the participants.csv file

    (the default is None)

  • subject_names (list of strings, optional) – The list of subject names to be loaded (the default is None)

Returns:

ds – The loaded dataset.

Return type:

Dataset

get_subjects()[source]

Return the subject list.

Returns:

subjects – The subject list provided by participants.csv

Return type:

list of strings

sekupy.io.loader.get_loader(name)[source]