Paths for supported data sources#
Path objects describe locations without reading them. All four classes accept a directory root and expose a pathlib.Path through .fpath.
Class |
Purpose |
|---|---|
|
VneuroTK HDF5 output naming |
|
Session-level electrophysiology products |
|
Flat MNE-readable filename under |
|
BIDS entities backed by optional |
Electrophysiology paths#
EphysPath uses {root}/sessions/{session_id}/{dtype}_{session_id}[_probeN].ext. Its raw_dir and nwb_path use the same project root.
from pathlib import Path
from vneurotk.io import BIDSPath, EphysPath, MNEPath, VTKPath
source_root = Path("data")
ephys_path = EphysPath(
root=source_root,
session_id="251024_FanFan_nsd1w_MSB",
dtype="TrialRaster",
probe=0,
extension="h5",
)
ephys_file = ephys_path.fpath
MNE versus BIDS#
MNEPath composes a filename directly below root; it does not infer a BIDS hierarchy. BIDSPath delegates entity placement and validation to mne_bids.BIDSPath when vneurotk[mne] is installed. Use BIDSPath for a BIDS dataset and MNEPath when the exact file is directly under the supplied root.
mne_path = MNEPath(
root=source_root,
subject="01",
session="ImageNet01",
task="ImageNet",
run="01",
suffix="meg_clean",
extension=".fif",
)
bids_path = BIDSPath(
root=source_root,
subject="01",
session="01",
task="images",
run="01",
suffix="meg",
extension=".fif",
)
VneuroTK output paths#
The VTKPath root is the output directory. The class appends the BIDS-like HDF5 filename; do not pass an existing HDF5 file as its root. Pass existing files directly to vneurotk.read().
output_path = VTKPath(
root=Path("outputs"),
subject="01",
session="ImageNet01",
task="ImageNet",
run="01",
)
assert output_path.fpath == Path("outputs/sub-01_ses-ImageNet01_task-ImageNet_run-01.h5")