Skip to main content

Affine slicer.

Project description

fineslice

Build codecov Ruff stability-stable BSD 3-Clause License pages

fineslice is a lightweight sampler for 3D-affine transformed images (commonly used in neuroscience) implemented in pure Python + NumPy.

It does not make any assumptions about the data. Pass any image texture and affine matrix directly into it.

Features

  • Precision sampling (no need to 're-sample' and loose precision)
  • Automatically finds optimal dimensions
  • Only depends on NumPy

Usage with nibabel

For the best performance directly pass in the nibabel data object as a texture:

import nibabel as nib
import fineslice as fine

img = nib.load('my_image.nii.gz')

out = fine.sample_0d(
    texture=img.dataobj,
    affine=img.affine,
    out_position=(0, 0, 0)
)

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

fineslice-0.0.3.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

fineslice-0.0.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file fineslice-0.0.3.tar.gz.

File metadata

  • Download URL: fineslice-0.0.3.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for fineslice-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1ccd5ffecf7a0b188be1542de803e55419d2a1d56138480ae81fb645acceb781
MD5 aa0f926f15c287610844d35af0b5fb79
BLAKE2b-256 b543b98fdf73c9d954085bb6ee533db2589c23926fab830fbeba3d135e25db6a

See more details on using hashes here.

Provenance

File details

Details for the file fineslice-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fineslice-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for fineslice-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c613a18151b7e55d1d1479431b81db2e60290e769793519c4b318e3e569d1f1b
MD5 728d37ddd6af4e315e680c4819e4cbc0
BLAKE2b-256 fb02d4735d73b4cb572a2902c2e28b1f7b425d1681645b950c87809aa76e7a21

See more details on using hashes here.

Provenance

Supported by

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