Bids Utils#

This module contains utilities for handling Brain Imaging Data Structure (BIDS) datasets. It simplifies the creation and management of BIDS projects, offering functions for building project scaffolds, handling file paths, and managing neuroimaging data files. Key features include scaffolding BIDS projects, caching filepaths for efficient retrieval, and supporting various neuroimaging file types through integration with nibabel.

Functions#

add_description_to_bids_path(→ str)

Create a copy of a BIDS filepath string with a description entity inserted before the suffix.

validate_filepath_as_bids(→ bool)

Validate whether a given filepath conforms to the Brain Imaging Data Structure (BIDS) standard.

validate_directory_as_bids(→ bool)

Validate whether all files in a given directory and its subdirectories (excluding specified ones)

parse_path_to_get_subject_and_session_id(path)

Parses a file path to extract subject and session IDs formatted according to BIDS standards.

snake_to_camel_case(snake_str)

Converts a snake_case string to CamelCase.

gen_bids_like_filename(→ str)

Generates a filename following BIDS convention including subject and session information.

gen_bids_like_dir_path(→ str)

Constructs a directory path following BIDS structure with subject and session subdirectories.

gen_bids_like_filepath(→ str)

Creates a full file path using BIDS-like conventions for both directory structure and filename.