braindec — NiCLIP documentation
braindec is the Python package for NiCLIP, a contrastive language–image pre-training model that decodes brain activation maps into cognitive task descriptions from the Cognitive Atlas ontology.
User guide
API reference
Installation
pip install "braindec[plotting] @ git+https://github.com/jdkent/brain-decoder.git"
Quickstart
Download the example assets and run functional decoding in a few lines:
from braindec.fetcher import download_bundle, get_data_dir
from braindec.predict import image_to_labels
work_dir = get_data_dir()
download_bundle("example_prediction", destination_root=work_dir)
# … construct paths, load model, then:
task_df = image_to_labels(
my_activation_map,
model_path=model_fn,
vocabulary=vocabulary,
vocabulary_emb=vocabulary_emb,
prior_probability=vocabulary_prior,
topk=10,
logit_scale=20.0,
)
print(task_df)
See the examples gallery for a full walkthrough.
Citation
Peraza et al. (2025). NiCLIP: Neuroimaging contrastive language-image
pretraining model for predicting text from brain activation images.
bioRxiv. https://doi.org/10.1101/2025.06.14.659706