{"id":23442566,"url":"https://github.com/mvdoc/identity-decoding","last_synced_at":"2025-04-13T11:23:26.888Z","repository":{"id":75577329,"uuid":"344613702","full_name":"mvdoc/identity-decoding","owner":"mvdoc","description":"Repository containing code for the paper \"Shared neural codes for visual and semantic information about familiar others in a common representational space\"","archived":false,"fork":false,"pushed_at":"2021-11-04T11:25:17.000Z","size":192,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T02:38:39.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvdoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-04T21:25:47.000Z","updated_at":"2023-02-01T01:42:35.000Z","dependencies_parsed_at":"2023-06-06T23:30:16.962Z","dependency_job_id":null,"html_url":"https://github.com/mvdoc/identity-decoding","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fidentity-decoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fidentity-decoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fidentity-decoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvdoc%2Fidentity-decoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvdoc","download_url":"https://codeload.github.com/mvdoc/identity-decoding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248704012,"owners_count":21148268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T17:32:53.480Z","updated_at":"2025-04-13T11:23:26.880Z","avatar_url":"https://github.com/mvdoc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shared neural codes for visual and semantic information about familiar faces in a common representational space\n\nThis repository contains the code for the analyses reported in *Shared neural codes for visual and semantic information about familiar faces in a common representational space* by Matteo Visconti di Oleggio Castello, James V. Haxby, \u0026 M. Ida Gobbini published in the *Proceedings of the National Academy of Sciences*.\n\nThe reference for the associated publication is \n\n\u003e Visconti di Oleggio Castello, M., Haxby, J. V., \u0026 Gobbini, M. I. Shared neural codes for visual and semantic information about familiar faces in a common representational space *Proceedings of the National Academy of Sciences* (2021). https://doi.org/10.1073/pnas.2110474118\n\nThis repository can be cited as\n\u003e Visconti di Oleggio Castello, M., Haxby, J. V., \u0026 Gobbini, M. I. (2021). mvdoc/identity-decoding. *Zenodo*. https://doi.org/10.5281/zenodo.5645003\n\n[![DOI](https://zenodo.org/badge/344613702.svg)](https://zenodo.org/badge/latestdoi/344613702)\n\n\n\n## Disclaimer \u0026 how to get help\nThese scripts are shared in a format that is suitable for archival and review. All analyses were run inside a singularity container (shared in the current repository) on a local cluster and on [Discovery, Dartmouth's HPC cluster](https://rc.dartmouth.edu/index.php/discovery-overview/). The paths listed in these scripts need to be modified in order to run the scripts on a different system.\n\n**If you have any questions related to the code, please open an issue in this repository or contact us via email (see corresponding author in the publication).**\n\n## Data\n\nThe raw data is available on OpenNeuro as the dataset `ds003834`: [https://openneuro.org/datasets/ds003834](https://openneuro.org/datasets/ds003834).\nIf you use the data, please cite the corresponding publication:\n\n\u003e Visconti di Oleggio Castello, M., Haxby, J. V., \u0026 Gobbini, M. I. Shared neural codes for visual and semantic information about familiar faces in a common representational space. *Proceedings of the National Academy of Sciences* (2021). https://doi.org/10.5281/zenodo.5645003\n\n## Repository structure\n\n* [`singularity`](singularity) contains code to generate the singularity image that was used to run all analyses\n* [`src`](src) contains a python package (`famfaceangles`) containing various general functions used in the analysis scripts\n* [`scripts`](scripts)  contains the scripts used for the analyses reported in the manuscript\n\nIn the following sections we describe each file in detail.\n\n### singularity\n\nThis folder contains the following files\n\n* `Singularity-neurodocker`: a singularity definition file for the image used in all analyses\n* `create-image.sh`: a bash script to generate the singularity image. Note that the syntax used in this script is for singularity versions 2.X. New versions of singularity will need a different syntax, and they have not been tested with this definition file.\n\n### src\n\nThis folder contains the python package `famfaceangles` with helper functions used in the analysis scripts. It can be installed as any other python package (e.g., `pip install -e src`)\n\n### scripts\n\nThis folder contains the following scripts\n\n#### Preprocessing\n* [`00preproc/run-fmriprep103-singularity.sh`](scripts/00preproc/run-fmriprep103-singularity.sh) calls fmriprep to preprocess the data.\n* [`00preproc/prepare-fsaverage6-suma.sh`](scripts/00preproc/prepare-fsaverage6-suma.sh) prepares the *fsaverage6* surfaces to be used with SUMA.\n* [`00preproc/make-maskmedial-fsaverage6.sh`](scripts/00preproc/make-maskmedial-fsaverage6.sh) creates a mask in NIML format to remove medial nodes in *fsaverage6*.\n\n#### Hyperalignment\n\n* [`01hyperalignment/run_preproc_hpal.py`](scripts/01hyperalignment/run_preproc_hpal.py) preprocesses the data from *The Grand Budapest Hotel* to be used for hyperalignment.\n* [`01hyperalignment/run_preproc_hpal_singularity.sh`](scripts/01hyperalignment/run_preproc_hpal_singularity.sh) shows an example call with singularity.\n* [`01hyperalignment/run_hpal.py`](scripts/01hyperalignment/run_hpal.py) runs the hyperalignment algorithm.\n* [`01hyperalignment/run_hpal_singularity.sh`](scripts/01hyperalignment/run_hpal_singularity.sh) shows an example call with singularity.\n* [`01hyperalignment/apply_hpal.py`](scripts/01hyperalignment/apply_hpal.py) applies the hyperalignment transformations to the input data.\n* [`01hyperalignment/apply_hpal_singularity.sh`](scripts/01hyperalignment/apply_hpal_singularity.sh) shows an example call with singularity.\n\n#### GLM\n\n* [`02glm/run_glm_model.py`](scripts/02glm/run_glm_model.py) runs a GLM model for the face perception experiment using the specified model.\n* [`02glm/run_glm_blockrun_singularity.sh`](scripts/02glm/run_glm_blockrun_singularity.sh) shows an example call with singularity on anatomically-aligned data and a BLOCK model estimated within each run.\n* [`02glm/run_glm_blockrun_hpal_singularity.sh`](scripts/02glm/run_glm_blockrun_hpal_singularity.sh) shows an example call with singularity on hyperaligned data and a BLOCK model estimated within each run.\n* [`02glm/run_glm_localizer_bwsj.py`](scripts/02glm/run_glm_localizer_bwsj.py) runs the GLM model for the hyperaligned localizer data.\n* [`02glm/run_glm_localizer_bwsj_singularity.sh`](scripts/02glm/run_glm_localizer_bwsj_singularity.sh) shows an example call with singularity.\n* [`02glm/workflows.py`](scripts/02glm/workflows.py) contains additional functions and Nipype workflows required to run the GLM models.\n\n#### MVPA\n\nBetween-subject searchlight decoding\n\n* [`03mvpa/run_sl_bwsbj.py`](scripts/03mvpa/run_sl_bwsbj.py) runs between-subject whole-brain searchlight decoding.\n* [`03mvpa/run_sl_bwsbj_singularity.sh`](scripts/03mvpa/run_sl_bwsbj_singularity.sh) shows an example call with singularity on hyperaligned data.\n* [`03mvpa/run_sl_bwsbj_fsaverage6_singularity.sh`](scripts/03mvpa/run_sl_bwsbj_fsaverage6_singularity.sh) shows an example call with singularity on anatomically-aligned data.\n\nBetween-subject ROI decoding\n\n* [`03mvpa/run_bwsj_roi_v2.py`](scripts/03mvpa/run_bwsj_roi_v2.py) runs between-subject decoding analyses within manually defined ROIs.\n* [`03mvpa/run_bwsj_roi_v2_singularity.sh`](scripts/03mvpa/run_bwsj_roi_v2_singularity.sh) shows an example call with singularity.\n* [`03mvpa/run_sl_roi.py`](scripts/03mvpa/run_sl_roi.py) contains some additional functions needed for ROI decoding.\n\nWithin-subject searchlight decoding\n\n* [`03mvpa/run_sl.py`](scripts/03mvpa/run_sl.py) runs within-subject whole-brain searchlight decoding.\n* [`03mvpa/run_sl_blockrun_singularity.sh`](scripts/03mvpa/run_sl_blockrun_singularity.sh) shows an example call with singularity.\n* [`03mvpa/run_sl_blockrun_permutation_singularity.sh`](scripts/03mvpa/run_sl_blockrun_permutation_singularity.sh) shows an example call with singularity to generate permuted maps.\n\nCross-validated RSA\n\n* [`03mvpa/run_sl_cvrsa.py`](scripts/03mvpa/run_sl_cvrsa.py) runs within-subject searchlight cross-validated RSA.\n* [`03mvpa/run_sl_cvrsa_blockrun_singularity.sh`](scripts/03mvpa/run_sl_cvrsa_blockrun_singularity.sh) shows an example call with singularity.\n* [`03mvpa/run_rsa_target.py`](scripts/03mvpa/run_rsa_target.py) runs model-based RSA by comparing the cross-validated brain RDMs with model RDMs.\n* [`03mvpa/run_rsa_target_singularity.sh`](scripts/03mvpa/run_rsa_target_singularity.sh) shows an example call with singularity.\n\n#### Statistics\n\nPermutation testing for between-subject MVPC\n\n* [`04stat/run_permtest_bootstrap.py`](scripts/04stat/run_permtest_bootstrap.py) runs permutation testing with bootstrapping.\n* [`04stat/run_permtest_bwsbj_bootstrap_singularity.sh`](scripts/04stat/run_permtest_bwsbj_bootstrap_singularity.sh) shows an example call with singularity.\n* [`04stat/make_fam-diff_bwsj_identity.sh`](scripts/04stat/make_fam-diff_bwsj_identity.sh) creates difference maps (familiar - visual) from precomputed accuracy maps.\n* [`04stat/run_permtest_famdiff_bwsbj_bootstrap_singularity.sh`](scripts/04stat/run_permtest_famdiff_bwsbj_bootstrap_singularity.sh) runs permutation testing on the familiar - visual difference maps.\n* [`04stat/make-maskfdrval-diff-identity-bsmvpc.sh`](scripts/04stat/make-maskfdrval-diff-identity-bsmvpc.sh) makes a mask that highlights significant nodes for the familiar - visual difference map.\n\nThreshold-Free Cluster Enhancement for within-subject MVPC and RSA\n\n* [`04stat/run_tfce_fsaverage6_cosmo.m`](scripts/04stat/run_tfce_fsaverage6_cosmo.m) runs the CoSMoMVPA TFCE code for within-subject MVPC.\n* [`04stat/run_tfce_fsaverage6_cosmo_blockrun_hpalsubjs_singularity.sh`](scripts/04stat/run_tfce_fsaverage6_cosmo_blockrun_hpalsubjs_singularity.sh) shows an example call with singularity.\n* [`04stat/make_thresholded_avg_blockrun_fsaverage6-hpal.sh`](scripts/04stat/make_thresholded_avg_blockrun_fsaverage6-hpal.sh) creates thresholded maps based on the TFCE values.\n* [`04stat/make_thresholded_avg_blockrun_fsaverage6-hpal_all.sh`](scripts/04stat/make_thresholded_avg_blockrun_fsaverage6-hpal_all.sh) calls the previous script for all comparisons of interest.\n* [`04stat/run_tfce_cvrsa_fsaverage6_cosmo.m`](scripts/04stat/run_tfce_cvrsa_fsaverage6_cosmo.m) runs the CoSMoMVPA TFCE code for within-subject cross-validated RSA.\n* [`04stat/run_tfce_cvrsa_fsaverage6_cosmo_singularity.sh`](scripts/04stat/run_tfce_cvrsa_fsaverage6_cosmo_singularity.sh) shows an example call with singularity.\n* [`04stat/make_thresholded_avg_cvrsa_fsaverage6.sh`](scripts/04stat/make_thresholded_avg_cvrsa_fsaverage6.sh) creates thresholded maps based on the TFCE values.\n* [`04stat/make_thresholded_avg_cvrsa_fsaverage6_singularity.sh`](scripts/04stat/make_thresholded_avg_cvrsa_fsaverage6_singularity.sh) shows an example with singularity.\n* [`04stat/make_thresholded_avg_cvrsa_fsaverage6_all.sh`](scripts/04stat/make_thresholded_avg_cvrsa_fsaverage6_all.sh) calls the previous script for all comparisons of interest.\n\n#### Visualization\n\n* [`05viz/drive-suma-blockrun-fsaverage6-group-hpal.sh`](scripts/05viz/drive-suma-blockrun-fsaverage6-group-hpal.sh) shows an example call to `DriveSuma` to generate surface plots.\n\n## Acknowledgements\n\nThis work was supported by the NSF grant #1835200 to M. Ida Gobbini. We would like to thank Swaroop Guntupalli, Yaroslav Halchenko, Carlo Cipolli, and the members of the Gobbini and Haxby lab for helpful discussions during the development of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdoc%2Fidentity-decoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvdoc%2Fidentity-decoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvdoc%2Fidentity-decoding/lists"}