{
  "abstract": "Calcium imaging has become a widely used technique for measuring the activity of identified neurons during behavior. A key goal in such investigations is to determine whether, and to what extent, neurons preferentially encode one task-relevant state over another—a property referred to as neuronal selectivity. Despite the widespread use of calcium imaging for this purpose, no consensus exists on the parameter choices required to assess neuronal selectivity reliably: choices regarding neural data representation, behavioral position tracking, temporal binning, data balancing, and statistical shuffling all vary substantially across published studies. We recently developed a systematic computational approach to address this gap. Here, we describe the step-by-step protocol for implementing this computational pipeline. Starting from preprocessed calcium imaging data, the protocol guides users through all stages of the analysis: loading and aligning neural and behavioral data, deriving four metrics of neural activity, computing a selectivity index (SI), generating null distributions using four shuffling strategies, and assigning selectivity labels to individual neurons. The protocol introduces a principled, data-driven framework for evaluating the quality of any combination of parameter choices using quantitative metrics of accuracy and robustness and for identifying the optimal combination. The framework is validated using bootstrap resampling and hold-out cross-validation, and its generality is demonstrated by application to a different, regression-based approach for assessing selectivity of individual neurons. Finally, we describe the natural extension of this framework to inferences about task states encoded by populations of neurons. Thus, our protocol provides a reusable, extensible approach to identify optimal parameter settings for reliably characterizing neural encoding of two discrete task states.\n\nKey features\n\n• Provides a step-by-step computational pipeline for assessing the selectivity of neurons to task states from calcium imaging data.\n\n• Introduces quantitative accuracy and robustness metrics for objectively evaluating and comparing the quality of any combination of analysis parameter choices.\n\n• Validates the optimal parameter choices in terms of reliability, generalizability, and generality using bootstrap resampling, hold-out cross-validation, and a regression-based (GLM) approach, respectively.\n\n• Provides modular, well-documented MATLAB code covering all pipeline stages, enabling adaptation to different cell types, brain areas, calcium indicators, two-state task designs, and ensembles.",
  "abstract_shown": true,
  "affiliations": [
    "Department of Psychological and Brain Sciences, Johns Hopkins University, Baltimore, MD, USA",
    "The Solomon H. Snyder Department of Neuroscience, Johns Hopkins School of Medicine, Baltimore, MD, USA",
    "Kavli Neuroscience Discovery Institute, Johns Hopkins University, Baltimore, MD, USA"
  ],
  "article_type": "methods article",
  "arxiv": null,
  "author_total": 3,
  "authors": [
    {
      "affs": [
        0
      ],
      "name": "Huixin Huang"
    },
    {
      "affs": [
        0,
        1
      ],
      "name": "Hita Adwanikar"
    },
    {
      "affs": [
        0,
        1,
        2
      ],
      "name": "Shreesh P. Mysore"
    }
  ],
  "bibtex": "https://research.draconitic.com/paper/6918te98ty22t.bib",
  "cited_by": 0,
  "doi": "10.21769/bioprotoc.5867",
  "fulltext_url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC13757185/",
  "id": "6918te98ty22t",
  "issns": [
    "2331-8325"
  ],
  "landing_url": "https://doi.org/10.21769/bioprotoc.5867",
  "language": "en",
  "licence": "CC-BY-NC-4.0",
  "licence_label": "CC BY-NC 4.0",
  "licence_source": "article",
  "licence_url": "https://creativecommons.org/licenses/by-nc/4.0/",
  "metadata_licence": null,
  "native_subjects": [
    [
      "heading",
      "Biology"
    ],
    [
      "heading",
      "Clinical Protocols"
    ],
    [
      "heading",
      "Methods Article"
    ],
    [
      "openalex",
      "2805|Neural dynamics and brain function"
    ]
  ],
  "openalex": "W7160389144",
  "pdf_url": null,
  "pmcid": "PMC13757185",
  "pmid": "43023015",
  "published": "2026-11-05",
  "publisher": "Bio-protocol, LLC",
  "ris": "https://research.draconitic.com/paper/6918te98ty22t.ris",
  "sources": [
    {
      "first_seen": "2026-11-16T12:22:55Z",
      "native_id": "PMC13757185",
      "source": "pmc",
      "url": "https://doi.org/10.21769/bioprotoc.5867"
    }
  ],
  "subjects": [
    {
      "field": "biology",
      "origin": "openalex:2805|Neural dynamics and brain function",
      "subfield": "neuroscience"
    }
  ],
  "title": "Computational Approach for the Reliable Inference of Task States Encoded by Neurons Using Calcium Imaging",
  "title_text": "Computational Approach for the Reliable Inference of Task States Encoded by Neurons Using Calcium Imaging",
  "type": "peer-reviewed",
  "updated_at": "2026-11-16T12:22:55Z",
  "url": "https://research.draconitic.com/paper/6918te98ty22t",
  "venue": "Bio-protocol",
  "versions": []
}