Skip to main content

Automatically create cortical flatmaps from FreeSurfer surfaces

Project description

autoflatten logo

Tests codecov PyPI version Python versions License DOI

autoflatten: automatically create cortical flatmaps from FreeSurfer surfaces

autoflatten is a Python pipeline for 🌟automatically🌟 flattening cortical surfaces generated by FreeSurfer

TL;DR: run autoflatten /path/to/your/freesufer/subject; done.

Features

  • Automatic cut mapping from a template to individual subjects
  • Two flattening backends: JAX-accelerated pyflatten (default) or FreeSurfer's mris_flatten
  • Visualization with area distortion metrics

Quick Start

# Install
pip install autoflatten

# Run on a FreeSurfer subject (requires FreeSurfer 6.0+ for projection)
autoflatten /path/to/subjects/sub-01

Documentation

For full documentation, usage examples, and configuration options, visit the autoflatten website.

See example outputs to preview what autoflatten produces.

Citation

If you use autoflatten in your research, please cite both autoflatten and the original FreeSurfer flattening method:

Visconti di Oleggio Castello, M., & Gallant, J. L. (2025). autoflatten: automatically create cortical flatmaps from FreeSurfer surfaces. Zenodo. https://doi.org/10.5281/zenodo.17933205

@software{visconti_di_oleggio_castello_2025_autoflatten,
  author       = {Visconti di Oleggio Castello, Matteo and Gallant, Jack L.},
  title        = {autoflatten: automatically create cortical flatmaps from FreeSurfer surfaces},
  year         = 2025,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.17933205},
  url          = {https://doi.org/10.5281/zenodo.17933205}
}

Fischl, B., Sereno, M. I., & Dale, A. M. (1999). Cortical surface-based analysis II: Inflation, flattening, and a surface-based coordinate system. NeuroImage, 9(2), 195-207. https://doi.org/10.1006/nimg.1998.0396

@article{fischl1999cortical,
  author       = {Fischl, Bruce and Sereno, Martin I. and Dale, Anders M.},
  title        = {Cortical surface-based analysis {II}: Inflation, flattening, and a surface-based coordinate system},
  journal      = {NeuroImage},
  year         = 1999,
  volume       = 9,
  number       = 2,
  pages        = {195--207},
  doi          = {10.1006/nimg.1998.0396}
}

License

BSD 2-Clause License. See LICENSE file for details.

Acknowledgments

  • Default fsaverage template cuts by Mark Lescroart and Natalia Bilenko
  • Geodesic refinement step inspired by code from Bhavin Gupta and Alex Huth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoflatten-1.0.6.tar.gz (191.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoflatten-1.0.6-py3-none-any.whl (196.2 kB view details)

Uploaded Python 3

File details

Details for the file autoflatten-1.0.6.tar.gz.

File metadata

  • Download URL: autoflatten-1.0.6.tar.gz
  • Upload date:
  • Size: 191.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autoflatten-1.0.6.tar.gz
Algorithm Hash digest
SHA256 93576a0c2dd31607ad324ff1c90849fdfeb7726d2c95914514876b3e17971a49
MD5 a9ac656658c92293f53603b4b7ce66d6
BLAKE2b-256 6dd2c639a477cff630b09a20b78a914ab2000888da5affd609010fad4f88c66f

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoflatten-1.0.6.tar.gz:

Publisher: publish.yml on gallantlab/autoflatten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autoflatten-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: autoflatten-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 196.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autoflatten-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6e175e622dcd745e39f577b9a91a8f19f484bfcdc57609b80ba1d7fd7be0db
MD5 d8c3de4efd1d5ad5df6c39d383d5eb27
BLAKE2b-256 729dc77a757b0ae22ce9bf26d7202a12ee1c26c418536edf763e63b3fcda9ed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoflatten-1.0.6-py3-none-any.whl:

Publisher: publish.yml on gallantlab/autoflatten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page