Skip to contents

This function maps a given feature name to voxel locations by identifying the pattern in the feature name. If the feature name contains "reduced_var", it follows the format "Roi_module_reduced_var" and this indicates that it is a reduced feature. Otherwise, it follows the format "Roi_Vnumber", which is not a reduced feature by Partition. Based on the pattern, the function extracts the appropriate region of interest (ROI) and retrieves voxel locations from intensity data.

Usage

map_feature2_loc(feature_name, threshold, main_dir)

Arguments

feature_name

String. A feature name.

threshold

a numeric between 0 and 1. The Partition threshold value applied to the data.

main_dir

String. The main directory containing the data files.

Value

A data frame containing the voxel locations (x,y,z Coordinates) corresponding to the extracted mapping column.

Details

Each voxel in a brain image corresponds to a specific feature, establishing a one-to-one mapping between a voxel and a feature. This relationship allows us to localize particular brain features to specific brain areas at the voxel level, enabling visualization of these features. However, after applying Super-Partition and Partition techniques, multiple brain features are aggregated into a single reduced feature as part of a data reduction process. The goal of the following function is to relate the reduced feature back to its component features, and subsequently identify the brain image voxels to which those component features are mapped. This function performs the following steps:

  1. Check Feature Name Format: It first checks if the feature_name contains "reduced_var". If it does, the function assumes the format "Roi_module_reduced_var", otherwise it assumes the format "Roi_Vnumber".

  2. Extract ROI and Mapping Information:

    • For the "Roi_module_reduced_var" format, the ROI and module number are extracted, and the corresponding partition file is read to retrieve the mapping vector.

    • For the "Roi_Vnumber" format, the V number is extracted from the feature name and used as the mapping vector.

  3. Extract Voxel Locations: The mapping vector is then used to extract voxel locations from the intensity data.

Examples

if (FALSE) { # \dontrun{
loc_df <- map_feature2_loc(feature_name = "inferior_frontal_gyrus_left_module4_reduced_var_13", threshold = 0.8, main_dir = "/path/to/data")
} # }