Skip to main content

Affine slicer

Project description

fineslice

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.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

fineslice-0.0.2-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fineslice-0.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for fineslice-0.0.2.tar.gz
Algorithm Hash digest
SHA256 65694fc424e030d4dbd7f708fb03bb9ca2656a65115c549eb1bb8452d7c4b3a4
MD5 9cd6cde3f3111b6a4c4bbc207dbbe7e0
BLAKE2b-256 555dade942f5e84531537c98709a784e498925df4bdeb109822aba1ecda39ab6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fineslice-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for fineslice-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ca1165b284f9a27a47d02466f688e6996f2e30a650c7a6314e4a1971a884e7d
MD5 b1325890806cf457d851950dd3fbc013
BLAKE2b-256 579e0332434fa0a38d5744d3341eb84c30adb1c16cd94fbf85578371c6a9223a

See more details on using hashes here.

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