SciganticGuidesTopicsExplore

How to open the Connectome 2.0 high b-value diffusion MRI dataset in a Jupyter notebook

Load the NIfTI volumes with nibabel: nib.load(path) reads the header, and slicing img.dataobj reads only the volumes you ask for. In a Scigantic notebook OpenNeuro dataset ds006181 is mounted at /mnt/archive in its BIDS layout, so the 856 MB dataset is read in place.

The code on this page runs in a Scigantic hosted notebook, where the dataset is mounted read-only at /mnt/archive. The same path is in the SCIGANTIC_MOUNT_PATH environment variable and linked from ~/archive. The public source is s3://openneuro.org/ds006181 (AWS us-east-1, public, no account needed).

Open Connectome 2.0 diffusion MRI on SciganticOpen the sample notebook: A brain at b = 17,800

Code

Open one diffusion acquisition

import os
import nibabel as nib
img = nib.load(os.path.join(os.environ['SCIGANTIC_MOUNT_PATH'], 'sub-01/dwi/sub-01_acq-D30d6highb64dirs_dir-AP_dwi.nii.gz'))
print(img.shape, img.header.get_zooms())

Run on 2026-11-20 in the Scigantic notebook image against the mounted data. It returned: NIfTI shape (110, 110, 66, 345), zooms (np.float32(2.0), np.float32(2.0), np.float32(2.0), np.float32(3.6))

List every acquisition with its shells and read one volume

import os, numpy as np, nibabel as nib
root = os.environ.get('SCIGANTIC_MOUNT_PATH', '/mnt/archive')
NOMINAL = np.array([0, 50, 200, 350, 800, 950, 1500, 2300, 2400, 3450, 4250, 4750, 6000, 6750, 9850, 13500, 17800])
nominal = lambda b: NOMINAL[np.abs(NOMINAL[:, None] - np.asarray(b)[None, :]).argmin(0)]
print('T1w:', nib.load(f'{root}/sub-01/anat/sub-01_T1w.nii.gz').shape, '1 mm iso')
for acq in ['D13d6lowb32dirs_dir-AP', 'D13d6highb64dirs_dir-AP', 'D30d6lowb32dirs_dir-AP', 'D30d6highb64dirs_dir-AP', 'D30d6b0_dir-PA']:
    base = f'{root}/sub-01/dwi/sub-01_acq-{acq}_dwi'
    img = nib.load(base + '.nii.gz')            # header only, nothing decompressed yet
    b = nominal(np.loadtxt(base + '.bval'))
    u, c = np.unique(b, return_counts=True)
    print(f'{acq:26s} {img.shape} {img.get_data_dtype()} shells(nominal b: n) =', dict(zip(u.tolist(), c.tolist())))
der = f'{root}/derivatives/preprocessed_dwi/sub-01/sub-01_preprocessed'
dimg = nib.load(der + '_dwi.nii.gz')
dt = np.loadtxt(der + '.diffusionTime'); pe = np.loadtxt(der + '.phaseEncoding')
print('preprocessed:', dimg.shape, '-> %.2f GB float32 uncompressed; diffusion time counts' % (np.prod(dimg.shape) * 4 / 1e9), {int(k): int(v) for k, v in zip(*np.unique(dt, return_counts=True))}, 'PE -1 (PA) volumes:', int((pe == -1).sum()))
b0 = np.asarray(dimg.dataobj[..., 10])        # first AP b=0 after the 10 PA b=0s; reads one 3.2 MB volume
print('preprocessed vol 10 (b=0, AP): brain-ish voxels (>150):', int((b0 > 150).sum()), 'max %.0f' % b0.max())

The starter cell from this dataset's schema card. It ran without error on 2026-11-20 in the Scigantic notebook image against the mounted data.

What the files are

OpenNeuro ds006181 is a single healthy subject scanned on the Connectome 2.0 scanner (500 mT/m gradients), the in vivo companion to Ramos-Llorden et al., Nature Biomedical Engineering 2025.

The protocol has two diffusion times (13 and 30 ms) and 16 shells from b = 50 to 17,800 s/mm2 at 2 mm isotropic: 886 diffusion volumes plus 10 reverse phase-encoded b=0 volumes, a 1 mm T1-weighted image, and one preprocessed 896-volume 4D file.

How the files are laid out

Path under the mountWhat it holds
sub-01/anat/sub-01_T1w.nii.gzThe T1-weighted image, 1 mm isotropic.
sub-01/dwi/sub-01_acq-<D13|D30>d6<lowb32|highb64>dirs_dir-AP_dwi.{nii.gz,bval,bvec}Four diffusion acquisitions. The acq label encodes the diffusion time in ms, the pulse width, the shell group and the number of directions.
sub-01/dwi/sub-01_acq-D30d6b0_dir-PA_dwi.*Ten reverse phase-encoded b=0 volumes.
derivatives/preprocessed_dwi/sub-01/sub-01_preprocessed_dwi.{nii.gz,bval,bvec} plus three per-volume text files: .diffusionTime, .phaseEncoding, .pulseWidth.

Size, format and license

FormatNIfTI (gzip) with FSL bval and bvec text files, BIDS 1.8.0
Size27 objects, 856 MB
LicenseCC0
ProviderGabriel Ramos-Llordén and colleagues, via OpenNeuro
Public sources3://openneuro.org/ds006181 (AWS us-east-1, public, no account needed)
Notebook imageNeuroscience (nibabel and dipy preinstalled)

Things to know before you read it

Run it

Start a notebook from the Connectome 2.0 diffusion MRI archive page. The data is mounted when the notebook opens, so the code above runs as written and nothing is downloaded first. For a longer worked example, open the sample notebook A brain at b = 17,800.

Related guides

Last checked 2026-11-21. All dataset guides.