Mask lower triangle of a Representational Dissimilarity Matrix (RDM)
This recipe takes a Representational Dissimilarity Matrix (RDM) as a square numpy array, masks the diagonal and lower triangle, and outputs a flattened numpy array of the upper triangle.
Easily adaptable for Representational Similarity Analysis (RSA), Functional/Structural Connectivity analyses, or other analyses with related pipelines with symmetric, square matrices.
Requirements:
- numpy>=1.18.1
|
|
Example usage:
|
|
Recipe made by Shawn Rhoads
These recipes may also be of interest
Automatically Generated Recipe
python r bashExplain briefly what the recipe does. Explain briefly how the recipe works. Provide a citation and link to documentation of any third party … Read More
Contributing to the Neuroimaging Cookbook
python markdownThe title entered above will automatically appear here, so just start by explaining the recipe purpose of your recipe. Here are some … Read More
Using 3dcalc to create a binary mask from a parcellation scheme
This recipe uses 3dcalc in AFNI to output a binarized 3D image file (nifti) of a region-of-interest in a parcellation scheme that is indexed … Read More