make_contours — Project Write-up

Published:

make_contours is a MATLAB toolkit for visualizing spatial distributions of cell populations in spinal cord cross-sections. I adapted an interpolation approach, integrated it with the lab's anatomical data pipeline, extended it with publication-quality visualization features, and published it as the open-source analysis code for our eLife paper (2024).
MATLAB Spatial Analysis Scientific Visualization Open Source Published Research Reproducible Analysis

Context & Attribution

The core spatial interpolation mathematics in make_contours — thin-plate spline fitting for generating smooth density surfaces from discrete observations — draws on established methods; I did not derive these from scratch. My contributions were:

  1. Adapting and implementing the approach for the specific characteristics of spinal cord anatomical data (irregular cross-sections, multi-animal pooling, laminar coordinate normalization)
  2. Building the full visualization pipeline around it: coordinate registration, publication-quality contour rendering, colormap design, and anatomical overlay
  3. Packaging it reproducibly for open-source publication, so any co-author, reviewer, or future researcher can regenerate every figure from the raw data
  4. Applying it to generate the spatial distribution figures that became a central component of the published study

Adapting, integrating, and publishing established analytical methods reproducibly is the core objective of this project.


The Problem

For the study, we needed to compare population-level spatial distributions of multiple V1 interneuron subtypes across the spinal cord. Raw scatter plots of individual cell coordinates obscured population structure; binned heatmaps introduced grid artifacts. A smooth, continuous density estimate — preserving biological structure without forcing the data into a grid — was needed.


What I Built

Coordinate normalization

Tissue sections vary in size and orientation across animals. I implemented a registration step mapping each section’s cell coordinates into a standardized anatomical space (normalized to laminar boundary landmarks), enabling meaningful pooling across sections and animals.

Visualization pipeline

  • Filled contour maps with perceptually uniform colormaps (color-blind accessible and print grayscale legible)
  • Contour line overlays for precise density level reading
  • Anatomical overlays (spinal cord outline, laminar boundary annotations)
  • Configurable output dimensions and DPI

Reproducibility

Every analysis parameter is defined in a single configuration struct, version-controlled alongside the scripts. Any figure can be regenerated by running one top-level script with the archived data file.


Results

  • Published analysis pipeline in Worthy et al. (2024), eLife, cited in the methods section as the open-source visualization code
  • Figures supported the paper’s finding that distinct V1 clade populations occupy different laminar niches in the spinal cord
  • Code archived on GitHub for reproducibility and reuse

Publication

Worthy AE, Anderson JT, Lane AR, et al. (2024) “Spinal V1 inhibitory interneuron clades differ in birthdate, projections to motoneurons, and heterogeneity.” eLife 13:RP95172. DOI: 10.7554/eLife.95172.3


AEWorthy/make_contours