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
Open-source repository for the make_contours toolkit.

Context & Attribution

The core spatial interpolation mathematics in make_contours — thin-plate spline fitting for generating smooth density surfaces from discrete observations — was adapted from the original ‘make_contours’ implementation developed by Tim Machado (Jessell lab, Columbia University). I made targeted edits to his original MATLAB toolkit so it would work with our datasets and render correctly for figure generation, and I created the online interactive demo linked above. My contributions include:

  1. Adapting & editing the original code to handle our spinal cord anatomical data and file formats, and to produce publication-ready renders
  2. Building the visualization pipeline: coordinate registration, filled-contour rendering, colormap selection, and anatomical overlays
  3. Packaging for reproducibility: configuration-driven scripts and parameters so figures can be regenerated from raw data
  4. Implementing the interactive web demo that showcases the toolkit and its outputs

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 Interactive Demo eLife Paper