Neurosynth build / analysis scripts

May 21, 2026 · View on GitHub

Overview

Helper scripts used to build and analyse the CANlab Neurosynth data products in Neurosynth_maps/ — preparing the MKDA inputs from the Neurosynth coordinate database, computing co-activation / connectivity networks across CANlab parcels, generating per-topic OpenAI embeddings, and producing montage figures of provincial / connector hubs.

This folder is scripts-only — there are no NIfTIs or .mat images in it. The outputs live in sibling folders (../mkda/, ../2016_Neurosynth_100_topics/, ../topic_terms_csv/, plus the .mat files in Neurosynth_maps/).

Primary reference

Derived from the Neurosynth coordinate database (Yarkoni et al. 2011 Nat Methods) as part of the CANlab build pipeline.

How to use

These are stand-alone scripts intended to be opened and run / adapted in MATLAB or Python. They reference paths inside Neurosynth_maps/ and assume CanlabCore + the Neurosynth current_data.tar.gz snapshot are available.

File inventory

FileLanguageWhat it is
ns_matlab_prep_MKDA.mMATLABPrepares the MKDA SETUP.mat / kernel inputs from the Neurosynth coordinate database. Outputs land in ../mkda/.
tor_script_prepdata_2022_stub_(use_older_database).mMATLABOlder data-prep stub (kept for reproducibility); use the 2022 workflow above for new builds.
generate_neurosynth_atlasesShell / pipelineDriver that re-derives Neurosynth atlas outputs end-to-end.
neurosynth_default_mode_analysis_tor_dec_2019.mMATLABDefault-mode-network-focused Neurosynth analysis (Dec 2019).
neurosynth_cluster_defModeA_by_connectivity.mMATLABClusters default-mode subregion A by connectivity profile.
neurosynth_viz_overall_prob_activation.mMATLABVisualises the overall activation-probability map.
montage_tables_provincial_connector_hubs.mMATLABBuilds montage tables splitting parcels into provincial vs connector hubs.
topic_embedding_similarity_analysis.mMATLABLoads the OpenAI text-embedding-3-large vectors and computes / visualises pairwise cosine similarity.
generate_topic_embeddings.pyPythonCalls the OpenAI API to embed each per-topic term list (see codex_embedding_instructions.txt).
codex_embedding_instructions.txttextPrompt / spec for the OpenAI embedding pipeline.
__pycache__/dirPython bytecode cache (auto-generated).

Citations