Skip to main content

A Python package for reading IMOD etomo alignment files into pandas DataFrames

Project description

etomofiles

License PyPI Python Version CI codecov

A Python package for reading IMOD etomo alignment files into pandas DataFrames.

Overview

etomofiles provides a way to extract metadata from etomo alignment directories and convert them into structured pandas DataFrames.

Installation

pip install etomofiles

Quick Start

import etomofiles

# Read etomo alignment data
df = etomofiles.read("/path/to/etomo/directory")

print(df.head())

DataFrame Columns

The resulting DataFrame contains the following columns:

Column Description
image_path Path to specific image in tilt series (e.g., TS_001.st[0])
idx_tilt Index of the tilt image (0-based)
tilt_axis_angle Tilt axis rotation angle (degrees)
rawtlt Raw tilt angle (degrees)
tlt Corrected tilt angle (degrees)
xtilt Tilt around x-axis
xf_a11, xf_a12, xf_a21, xf_a22, xf_dx, xf_dy xf transformation matrix elements
excluded Boolean indicating if view was excluded

xf Utilities

Get xf as numpy array:

import etomofiles

# Read alignment data
df = etomofiles.read("TS_001/")

# Get xf as numpy array:
xf_matrices = etomofiles.df_to_xf(df)

# Each matrix represents an affine transformation:
# [[A11, A12, DX],
#  [A21, A22, DY]]
# where X' = A11*X + A12*Y + DX
#       Y' = A21*X + A22*Y + DY

# Also works directly with files
xf_matrices = etomofiles.df_to_xf("TS_001/TS_001.xf")

# Choose row ordering convention
xf_xy = etomofiles.df_to_xf(df)  # default xy
# Each matrix is [[A11, A12, DX], [A21, A22, DY]]

xf_yx = etomofiles.df_to_xf(df, yx=True)  # yx
# Each matrix is [[A22, A21, DY], [A12, A11, DX]]

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

etomofiles-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

etomofiles-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file etomofiles-0.1.1.tar.gz.

File metadata

  • Download URL: etomofiles-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etomofiles-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8f41827145cd2a256622cf10ade48307a3e7c50a535befe81a49d54a84b1ca76
MD5 b0c846dca8da68f38c300526c138f0a6
BLAKE2b-256 48ab66be00df0fab12a0b13868c720bcc934b78a816f4201d335bd524220f8cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for etomofiles-0.1.1.tar.gz:

Publisher: ci.yml on teamtomo/etomofiles

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

File details

Details for the file etomofiles-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: etomofiles-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etomofiles-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f692ef3ca4c9be76ef055b9f87bc621cf0224e50fbab1346a9360801265b68a
MD5 d41a117d9bc8c3fa6ee90acc1201ea55
BLAKE2b-256 c6f57e403f93faae3c9b64a54c6158292d9e7453c043b177b32ab30b40207e8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for etomofiles-0.1.1-py3-none-any.whl:

Publisher: ci.yml on teamtomo/etomofiles

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

Supported by

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