Menu

Deep learning for NeuroImaging in Python.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class nidl.datasets.base.BaseNumpyDataset(root, patterns, channels, split='train', targets=None, target_mapping=None, transforms=None, mask=None, withdraw_subjects=None)[source]

Bases: BaseDataset

Neuroimaging dataset that uses numpy arrays and memory mapping.

Parameters:

root : str

the location where are stored the data.

patterns : str or list of str

the relative locations (no path names matching allowed in specified pattern) of the numpy array to be loaded.

channels : str or list of str, default=None

the name of the channels.

split : str, default ‘train’

define the split to be considered.

targets : str or list of str, default=None

the dataset will also return these tabular data.

target_mapping : dict, default None

optionaly, define a dictionary specifying different replacement values for different existing values. See pandas DataFrame.replace documentation for more information.

transforms : callable, default None

a function that can be called to augment the input images.

mask : str, default None

optionnaly, mask the input data using this numpy array.

withdraw_subjects : list of str, default None

optionaly, provide a list of subjects to remove from the dataset.

Raises:

FileNotFoundError

If the mandatorry input files are not found.

KeyError

If the mandatory key are not found.

UserWarning

If missing data are found.

Notes

A ‘participants.tsv’ file containing subject information (including the requested targets) is expected at the root. A ‘<split>.tsv’ file containg the subject to include is expected at the root.

get_data(idx)[source]

Proper data indexing.

Follow us

© 2025, nidl developers