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

7.2.21. nilearn.datasets.fetch_nyu_rest

nilearn.datasets.fetch_nyu_rest(n_subjects=None, sessions=[1], data_dir=None, resume=True, verbose=1)

Download and loads the NYU resting-state test-retest dataset.


n_subjects: int, optional

The number of subjects to load. If None is given, all the subjects are used.

sessions: iterable of int, optional

The sessions to load. Load only the first session by default.

data_dir: string, optional

Path of the data directory. Used to force data storage in a specified location. Default: None


data: sklearn.datasets.base.Bunch

Dictionary-like object, the interest attributes are : ‘func’: string list. Paths to functional images. ‘anat_anon’: string list. Paths to anatomic images. ‘anat_skull’: string. Paths to skull-stripped images. ‘session’: numpy array. List of ids corresponding to images sessions.


This dataset is composed of 3 sessions of 26 participants (11 males). For each session, three sets of data are available:

  • anatomical:
    • anonymized data (defaced thanks to BIRN defacer)
    • skullstripped data (using 3DSkullStrip from AFNI)
  • functional

For each participant, 3 resting-state scans of 197 continuous EPI functional volumes were collected :

  • 39 slices
  • matrix = 64 x 64
  • acquisition voxel size = 3 x 3 x 3 mm

Sessions 2 and 3 were conducted in a single scan session, 45 min apart, and were 5-16 months after Scan 1.

All details about this dataset can be found here :




Paper to cite:

The Resting Brain: Unconstrained yet Reliable Z. Shehzad, A.M.C. Kelly, P.T. Reiss, D.G. Gee, K. Gotimer, L.Q. Uddin, S.H. Lee, D.S. Margulies, A.K. Roy, B.B. Biswal, E. Petkova, F.X. Castellanos and M.P. Milham.

Other references: