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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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