Skip to main content

scalesufer

scalesurfer is a repository for fast FreeSurfer inference. The volumetric model uses UNet with a Transformer bottleneck. The stats models predict FreeSurfer measures, including cortical thickness, surface area, curvature, and folding index.

Installation

pip install scalesurfer

Usage

See the inference notebook for additional settings for faster processing.

from scalesurfer import ScaleSurfer

# Anatomical images
adni_dir = "/home/rph/scalesurfer/data/adni_bids"
subjects = ["sub-002S0559", "sub-002S0619"]

anat_files = [
    f"{adni_dir}/sub-002S0559/ses-20060627/anat/sub-002S0559_ses-20060627_T1w.nii.gz",
    f"{adni_dir}/sub-002S0619/ses-20060601/anat/sub-002S0619_ses-20060601_T1w.nii.gz"
]

# Predict aparc+aseg and stats tables
surfer = ScaleSurfer(anat_files, subjects, "/tmp/scalesurfer_subjects", device="cuda")
surfer.prepare_images()
surfer.predict_volumes()
surfer.plot_volume(subjects[0])
df_stats = surfer.predict_stats()

GPU

All models are implemented with pytorch and inference time depends on GPU. CPU-based inference will be much slower. These models were developed on an NVIDIA card with 32 GB of VRAM and 64 RAM. With this hardware, the settings in the inference notebook worked well. Please open an issue if inference fails on your hardware.

Metadata

Release files for scalesurfer 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scalesurfer 0.1.3
File Size Uploaded Provenance Actions
scalesurfer-0.1.3.tar.gz 183.7 kB With provenance Details for scalesurfer-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scalesurfer 0.1.3
File Interpreter ABI Platform Actions
scalesurfer-0.1.3-py3-none-any.whl Python 3 none any Details for scalesurfer-0.1.3-py3-none-any.whl

Total release size: 389.8 kB

Release files / scalesurfer-0.1.3.tar.gz

Download URL scalesurfer-0.1.3.tar.gz
Size 183.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e972addac139a8ff988a44dfcda6e8cb7e1dc7fdf4573fbad4c938e708788ae2
BLAKE2b-256 checksum
How to use checksums
323c2095dacc32a708382154737b1b77e7ca419fd522c26cab502a76523e7c86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Release files / scalesurfer-0.1.3-py3-none-any.whl

Download URL scalesurfer-0.1.3-py3-none-any.whl
Size 206.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e5ff710abf43907fc3d24bd658d28ae1c4355b8dd7835b4e7b2a2f923319449
BLAKE2b-256 checksum
How to use checksums
d42f5c25be8c0edc19f1e605709c239922068056a284ebd4a251f7660a8a739f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

Security for scalesurfer 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scalesurfer-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page