Card: stream T1 and BOLD samples from a shard
Browse files57 unmodified lines58596061626357 unmodified linesTo train with the [model code](https://github.com/SophontAI/CortexMAE-ReadyNeuro), set the data config's `urls` to `<root>/shards`.## Full corpusThe full corpus is on Cloudflare R2 at `s3://openneuro/v1/`, readable with a public read-only key57 unmodified lines58596061626364656667686970717273747576777879808182838485868788899091929394959697989910010157 unmodified linesTo train with the [model code](https://github.com/SophontAI/CortexMAE-ReadyNeuro), set the data config's `urls` to `<root>/shards`.## Stream samplesEach shard is one subject. Its first sample holds the T1, the tissue masks and the gridgeometry. Every later sample is one BOLD run. Voxels are stored packed: `*_idx.npy` holds flatC-order indices of the in-brain voxels, and `*_values.npy` holds one row per index. BOLD isz-scored per voxel within the run, stored as int8 at one frame per second. This reads T1 and BOLDwith `pip install webdataset numpy`:```pythonimport io, jsonimport numpy as npimport webdataset as wdsdef dense(idx, values, shape):"""Scatter packed in-brain rows back onto the grid."""out = np.zeros((np.prod(shape), *values.shape[1:]), np.float32)out[idx] = valuesreturn out.reshape(*shape, *values.shape[1:])url = "https://huggingface.co/datasets/medarc/ReadyNeuro/resolve/main/shards/ds003777__02.tar"# Full corpus: "pipe:aws --profile openneuro-public s3 cp s3://openneuro/v1/<prefix>/train/native/<shard>.tar -"for sample in wds.WebDataset(url, shardshuffle=False):meta = json.loads(sample["json"])arr = lambda name: np.load(io.BytesIO(sample[name]))if meta["kind"] == "bundle": # first sample of each shard: T1, masks, geometrybold_idx, bold_shape = arr("bold_idx.npy"), meta["bold_shape"]bold_affine = arr("bold_affine.npy") # voxel -> world mmcortex = dense(bold_idx, arr("bold_cortical_gm.npy"), bold_shape) # (97, 115, 97)t1 = dense(arr("t1_idx.npy"), arr("t1_values.npy") * meta["T1_scale"], meta["T1_shape"])else: # one sample per run: z-scored BOLDz = arr("values.npy") * np.float32(meta["scale"]) # (in-brain voxels, frames)clip = dense(bold_idx, z[:, :16], bold_shape) # first 16 s as (97, 115, 97, 16)```The bundle also has `bold_gm`, `bold_seg` (SynthSeg labels) and their `t1_*` counterparts. Eachrun has `mean.npy` and `std.npy` (multiply by `mean_scale`/`std_scale`), which undo the z-score.The full format is in [`tools/codec.py`](https://github.com/SophontAI/ReadyNeuro/blob/main/src/readyneuro/tools/codec.py).## Full corpusThe full corpus is on Cloudflare R2 at `s3://openneuro/v1/`, readable with a public read-only key
README.md+38