Skip to content

R code for implementing the Simple Permutation-based Intermodal CorrEspondence (SPICE) test.

Notifications You must be signed in to change notification settings

smweinst/spice_test

Repository files navigation

R and python code for SPICE

What's included in this repository:

R code:

maptest_script.R

  • includes the basic script for implementing a test of intermodal correspondence
  • function can be implemented either as map.test() or spice.test()
  • Input arguments:
    • K: number of permutations (in the paper, we use 999)
    • X.mat: each row is made up of the vector of intensities across all image locations in the "X" modality for each subject (number of rows of X.mat should equal the number of subjects; number of columns of X.mat should equal the number of locations in each image)
    • Y.mat: same as X.mat but for the "Y" modality. Dimension of this matrix should be the same as for X.mat
    • use_cores: optionally specify the number of cores to use for parallelizing parts of the code. The default is 1.

brain_simulations_batch.R

  • Code for conducting simulations from paper. We use average cortical thickness, sulcal depth, and n-back from the Philadelphia Neurodevelopmental Cohort (PNC) as population-level image patterns. Then we add/multiply noise/signal to these images to generate multi-modal image data.
  • See description and results of these simulations in the paper (section 2.2.2 and Figures 3 and 4).

Python code:

maptest_script.py

  • This script provides the Python implementation of a test for intermodal correspondence.
  • function can be used as map_test().
  • Input arguments:
    • K: Number of permutations for significance testing.
    • X_mat: Matrix where each row contains a vector of intensities across all image locations in the "X" modality for each subject (rows = subjects; columns = image locations).
    • Y_mat: Same as X_mat but for the "Y" modality. Dimensions of Y_mat should match X_mat.

About

R code for implementing the Simple Permutation-based Intermodal CorrEspondence (SPICE) test.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published