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.

Download files

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

Source Distribution

scalesurfer-0.1.2.tar.gz (140.6 kB view details)

Uploaded Source

Built Distribution

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

scalesurfer-0.1.2-py3-none-any.whl (159.5 kB view details)

Uploaded Python 3

File details

Details for the file scalesurfer-0.1.2.tar.gz.

File metadata

  • Download URL: scalesurfer-0.1.2.tar.gz
  • Upload date:
  • Size: 140.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scalesurfer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 947e895c5536b8d05bf7c1917c5d3cfc546dab3945e26bf5a9dc2f0deae63233
MD5 869209e5dc5c9ada2c8c8489d4b9e4a1
BLAKE2b-256 62b4aa8dea773c3df2beb2f4fd0ba7b739d02f833b1504bfbe57719c96271c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for scalesurfer-0.1.2.tar.gz:

Publisher: publish.yml on voytekresearch/scalesurfer

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

File details

Details for the file scalesurfer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: scalesurfer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 159.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scalesurfer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 05111c7745a0e3bb07cc9f576d38c77a83f77f4c2d857544b1135a8c69be9299
MD5 2c68f8f19d0c3d4b6bfc33c1c3dd5e55
BLAKE2b-256 18736145cdf6e39c9b6384a9c3da26f06a0655c36a7a1b15a98030ec148b93dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scalesurfer-0.1.2-py3-none-any.whl:

Publisher: publish.yml on voytekresearch/scalesurfer

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

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

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