Comparisons within a single subject: Voxel-voxel matrix D2 resolution

D2 can be calculated between every pair of voxels (voxel x − voxel y) within a mask of analysis to compute a voxel-voxel D2 matrix. In this case, the reference for computing the covariance matrix would be the data in all voxels contained in the mask.

  • voxel2voxel_dist: To compute D2 between each voxel and all other voxels in a mask. Yields a symmetric 2-D matrix of size n voxels x n voxels containing D2 values between each pair of voxels.
    Args:
    • subdir (string): subject directory path that contains their feature images

    • suffix_name_comp (str): The suffix of the features image files

    • mask_f (String): full pathname of the mask

    • mask_img (nibabel): A nibabel object of the mask

    • mask_threshold (float): A number in range 0-1 that determines the threshold of the mask

    • feat_sub (List of strings): The names of the features we don’t want to include in D2 calculation.

    Returns:
    • all_dist (numpy array): A symmetrical D2 array of D2 values of the shape (Number of voxels) X (Number of voxels)