KochiVisualNamingDS006914#

class torch_brain.datasets.KochiVisualNamingDS006914(root, split_type, recording_ids=None, transform=None, **kwargs)[source]#

Bases: torch_brain.datasets.OpenNeuroDataset.OpenNeuroDataset

Kochi Visual Naming iEEG Dataset (OpenNeuro DS006914).

Preprocessing

To download and prepare this dataset, run

brainsets prepare kochi_visualnaming_ds006914

Each dataset instance uses a split strategy (split_type) and can optionally be restricted to specific recordings via recording_ids.

Parameters:
  • root (str) – Root directory containing processed Visual Naming artifacts.

  • split_type (Literal['intrasession', 'intersubject', 'intersession']) – The split type describing train/valid/test regime.

  • recording_ids (Optional[list[str]]) – List of explicit recording IDs to load. If omitted, the dataset uses split-based recording selection.

  • transform (Optional[Callable]) – Optional transform to apply to samples.

  • **kwargs – Additional keyword arguments forwarded to the base OpenNeuroDataset.

References

Kochi, J., et al. (Year). “Visual Naming iEEG Dataset.” Repository: https://openneuro.org/datasets/ds006914

apply_namespace(data, namespace)#

Apply a namespace prefix to specified nested attributes in the data.

This method modifies the data object in-place by prepending the namespace to string attributes or string arrays specified in namespace_attributes.

Can be overridden by subclasses to apply the namespace in a custom way.

Parameters:
  • data (Data) – The Data object to modify.

  • namespace (str) – The namespace prefix to prepend (e.g., “experiment1/”).

Return type:

Data

Returns:

The modified torch_brain.data.Data object (same instance, modified in-place).

get_channel_ids()#

Return sorted channel IDs across recordings.

get_channel_ids aggregates rec.channels.id from get_recording(...). Any subject/session uniquification is applied there according to multichannel_dataset_mixin_uniquify_channel_ids_with_subject and multichannel_dataset_mixin_uniquify_channel_ids_with_session.

Return type:

list[str]

get_default_sampling_intervals(recording, split)#

Get the default sampling intervals for a given split. These intervals are behavior agnostic, meaning they do not take into account any task or behavioral (event/label) annotations when creating the train, val, and test splits—interval assignment is performed solely based on session or subject, not on in-task structure.

Notes: - For split_type == “intrasession”, intervals are split causally into train, val, and test based on split_ratios. - For split_type == “intersubject” or “intersession”, only the assigned recordings are included for each split (using k-fold assignment); all others return an empty interval.

Return type:

Interval

get_recording(recording_id, _namespace='')#

Get lazy-loaded torch_brain.data.Data object for a recording.

Parameters:
  • recording_id (str) – The ID of the recording to load (same as from recording_ids()).

  • _namespace (str) – Optional namespace prefix to apply to attributes.

Return type:

Data

Returns:

Lazy torch_brain.data.Data object containing the full recording.

get_recording_hook(data)#

Hook method called after loading a recording in get_recording().

Subclasses can override this method to perform custom processing on recordings after they are loaded but before they are returned.

Parameters:

data (Data) – The Data object that was just loaded.

get_sampling_intervals(split=None)#

Retrieve the sampling intervals for each recording according to the specified split.

If split is None, returns the full interval domain for every recording for unrestricted sampling. If a split (“train”, “val”, or “test”) is provided, returns only the intervals (within each recording) eligible for sampling under the current split type and task paradigm.

The selection of intervals is determined according to: - The current self.split_type (intrasession, intersubject, or intersession). - Whether a self.task_paradigm is specified, which influences the interval extraction.

Parameters:

split (Optional[Literal['train', 'val', 'test']]) – One of “train”, “val”, or “test” to select intervals corresponding to that split, or None to retrieve the entire domain for all recordings.

Return type:

dict[str, Interval]

Returns:

Dictionary mapping recording IDs to their valid Interval objects for sampling in the given split (or full Interval domain if split is None).

Raises:
  • ValueError – If the requested split or the dataset’s split_type is not recognized/supported.

  • KeyError – If a required split or assignment attribute is missing in a recording.

Notes

  • Intervals are defined based on recording domains and split logic.

property recording_ids: list[str]#

Sorted list of recording IDs in the dataset.