functional_io
lacuna.assets.connectomes.functional_io
¶
Shared low-level helpers for voxelwise functional connectome HDF5 files.
Factored out of :mod:lacuna.analysis.functional_network_mapping so the same
reader can be reused by :mod:lacuna.prepare.parcellate.
Each HDF5 file is expected to contain:
- timeseries : (n_subjects, n_timepoints, n_voxels) float array
- mask_indices : (3, n_voxels) or (n_voxels, 3) brain-mask coordinates
- mask_affine : (4, 4) affine transformation matrix
- attr mask_shape : (nx, ny, nz)
list_connectome_batch_files(path)
¶
Return sorted list of HDF5 batch files under path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Either a single |
required |
Returns:
| Type | Description |
|---|---|
list[Path]
|
Sorted list of HDF5 files. At least one file is guaranteed or
|
Source code in src/lacuna/assets/connectomes/functional_io.py
read_mask_info(h5_path)
¶
Read mask geometry from an HDF5 connectome file.
Returns a dict with:
- mask_indices: tuple of three int64 1-D arrays (ix, iy, iz)
- mask_affine: (4, 4) ndarray
- mask_shape: tuple of three ints