API

bidsaid.audit

Module for auditing directories.

BIDSAuditor

Check availability of different files for each subject in the BIDS directory.

bidsaid.files

Module for initializing and creating BIDS compliant files.

generate_bids_filename

Generate a BIDs compliant filename.

create_bids_file

Create a BIDS compliant filename with required and optional entities.

get_entity_value

Gets entity value of a BIDS compliant filename.

create_dataset_description

Generate a dataset description dictionary.

save_dataset_description

Save a dataset description dictionary.

create_participant_tsv

Creates a basic dataframe for the "participants.tsv" file.

create_sessions_tsv

Creates a basic dataframe for the "sub-{subject_ID}_sessions.tsv" file for a specific subject.

bidsaid.events

Module containing classes for extracting timing information from Presentation and E-Prime logs.

PresentationBlockExtractor

Extract onsets, durations, and trial types from Presentation logs using a block design.

PresentationEventExtractor

Extract onsets, durations, trial types, reaction times, and responses from Presentation logs using an event design.

EPrimeBlockExtractor

Extract onsets, durations, and trial types from E-Prime logs using a block design.

EPrimeEventExtractor

Extract onsets, durations, trial types, reaction times, and responses from E-Prime logs using an event design.

bidsaid.logging

Module setting up a logger.

setup_logger

Sets up the logger.

bidsaid.io

Module for input/output operations on NIfTI files and images.

load_nifti

Loads a NIfTI image.

compress_image

Compresses a ".nii" image to a ".nii.gz" image.

is_nifti_truncated

Checks expected byte size and actual byte size of uncompressed NIfTI images.

regex_glob

Use regex to get content in the source directory with specific patterns.

get_nifti_header

Get header from a NIfTI image.

get_nifti_affine

Get the affine matrix from a NIfTI image.

replace_ext

Replaces extension of a filename.

bidsaid.path_utils

Utilities related to parsing or sorting filenames.

is_valid_date

Determine if a string is a valid date based on format.

parse_date_from_path

Get date from the stem of a path.

get_file_timestamp

Get timestamp of file.

get_file_creation_date

Get creation date of a file

sort_by_acquisition_order

Sort filenames based on acquisition sequence.

bidsaid.metadata

Module containing functions to extract metadata information from NIfTIs.

needs_resampling

Determines if a source image needs to be resampled.

determine_slice_axis

Determine the slice axis.

get_hdr_metadata

Get metadata from a NIfTI header.

get_n_volumes

Get the number of volumes from a 4D NIftI image.

get_image_orientation

Get the image orientation.

direction_to_voxel_axis

Returns the voxel coordinate axis (and position) of a given anatomical direction.

get_n_slices

Gets the number of slices from the header of a NIfTI image.

get_tr

Get the repetition time from the header of a NIfTI image.

create_slice_timing

Create slice timing dictionary mapping the slice index to its acquisition time.

is_3d_img

Determines if nifti_file_or_img is a 3D image.

get_scanner_info

Determines the manufacturer and model name of scanner.

infer_task_from_image

Infer the task based on the number of volumes in a 4D NIfTI image.

get_recon_matrix_pe

Get the reconstruction matrix of the phase encoding axis.

compute_effective_echo_spacing

Compute the effective echo spacing for Philips 3T MRI.

compute_total_readout_time

Compute the total readout time.

bidsaid.parsers

Module containing functions to parse raw logs from stimulus Presentation and E-Prime 3 software.

convert_edat3_to_text

Converts a file with an "edat3" extension to a text file.

load_eprime_log

Loads E-Prime 3 log file as a Pandas Dataframe.

load_presentation_log

Loads Presentation log file as a Pandas DataFrame.

get_presentation_log_date

Gets the date and time from a Presentation logfile.

bidsaid.qc

Module for quality control metrics and assessment of fMRI data.

compute_n_dummy_scans

Compute the number of dummy scans based on the number of "non_steady_state_outlier_XX" columns in an fMRIPrep confounds TSV file.

compute_framewise_displacement

Computes the framewise displacement using the Power (2012) formula:

create_censor_mask

Create a censor mask where 0 indicates volumes to censor and 1 indicates volumes to keep.

merge_censor_masks

Merge multiple censor masks.

compute_consecutive_censor_stats

Compute the mean and standard deviation of the consecutive censored volumes.

create_spike_regressors

Creates spike regressors that can be used to censor certain frames during regression.

get_n_censored_volumes

Computes number of censored volumes.

compute_global_signal

Compute global signal and percent signal change from functional NIfTI image.

bidsaid.simulate

Module for simulating NIfTI images and BIDS datasets.

simulate_nifti_image

Simulates a NIfTI image with random data within the MNI152 brain template.

simulate_bids_dataset

Generate a Simulated BIDS Dataset with fMRIPrep Derivatives.