Learn R Programming

SparseICA (version 0.1.4)

create_group_list: Create a List of fMRI Files for Group ICA Analysis

Description

This function scans a BIDS-formatted directory for subject-specific fMRI files that match a specified pattern and returns a list of these files for use in group ICA analysis.

Usage

create_group_list(bids_path, pattern = "task-rest.*\\.dtseries\\.nii$")

Value

A named list where each element corresponds to a subject directory and contains a vector of matched fMRI file paths. The names of the list are the subject IDs.

Arguments

bids_path

A character string specifying the path to the root directory of the BIDS-formatted dataset. This directory should contain subject folders (e.g., sub-*).

pattern

A character string specifying the pattern to match fMRI files. The default is "task-rest.*\.dtseries\.nii$".

Examples

Run this code
# Example usage:
# Assuming `bids_dir` is the path to a BIDS dataset:
# group_list <- create_group_list(bids_path = bids_dir, pattern = "task-rest.*\.dtseries\.nii$")
# Print the structure of the list:
# str(group_list)

Run the code above in your browser using DataLab