Skip to main content

standard_transform

Orient and scale points in EM connectomics datasets consistently and easily.

📖 Full documentation: https://caveconnectome.github.io/standard_transform/

When working with EM data, the orientation of the dataset often does not match the orientation you want to reason in. For cortical data you usually want "down" to mean the direction orthogonal to the pial surface, in microns, with the pia at y ≈ 0. standard_transform provides pre-baked affine transforms for two datasets (Minnie65 and V1dd) that map voxel or nanometer coordinates into that consistent oriented frame, plus streamlines — a curvilinear depth axis — for separating cortical depth from lateral (radial) distance even where cortex curves.

Install

pip install standard-transform

Quickstart

from standard_transform import minnie_ds, v1dd_ds

# n x 3 points -> oriented microns (y = pia->white matter, pia at y≈0)
# resolution defaults to "nm"; pass "vx" or an [x, y, z] list for other units.
pts_um = minnie_ds.transform().apply(xyz_nm)

# just the cortical depth (microns below pia)
depth = minnie_ds.transform().apply_project("y", xyz_nm)

# radial (in-plane) distance following the local streamline
d = v1dd_ds.streamline().radial_distance(xyz0_nm, xyz1_nm)

minnie_ds and v1dd_ds bundle a transform and a streamline and are the recommended entry points. Both .transform(resolution="nm", version=None) and .streamline(resolution="nm", version=None) take the input resolution ("nm", "vx", or an [x, y, z] list) and an optional version.

What's in the box

  • Transformsapply, apply_project, apply_dataframe, and invert. Point units are selected with resolution= ("nm", "vx", or [x, y, z]). Accept n x 3 arrays, pandas Series, and split _x/_y/_z dataframe columns.
  • Streamlines — depth-along, radial distance, and cylindrical-like remapping along a curvilinear pia-to-white-matter axis.

Note: transforming MeshParty morphology objects (skeletons/meshworks) is deprecated and moving to Ossify, where you pass the transformation to the object. standard_transform focuses on coordinate arrays and dataframes.

Streamline fields (breaking data change)

The v1dd and Minnie65 streamlines are now data-derived, spatially-varying StreamlineFields by default, replacing the old single hand-drawn curves. This changes computed results but not the interface — StreamlineField is a drop-in subclass of Streamline. To recover the previous behavior:

from standard_transform import minnie_ds, v1dd_ds
sl     = v1dd_ds.streamline()                 # data-derived field (latest, default)
sl_old = v1dd_ds.streamline(version="1.4")    # original hand-drawn streamline
sl_m   = minnie_ds.streamline()               # Minnie65 field (latest, default)

See the docs for the concept, the per-neuron workflow, and how the field is built. Older definitions stay reachable via version= — see Versioning & reproducibility.

Documentation

The full guide — concepts, task-oriented tutorials, the streamline-field method, and the API reference — lives at https://caveconnectome.github.io/standard_transform/.

Development

uv run poe test          # run tests with coverage
uv run poe doc-preview   # serve the docs locally with live reload

Download files

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

Source Distribution

standard_transform-2.0.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

standard_transform-2.0.0-py3-none-any.whl (973.9 kB view details)

Uploaded Python 3

File details

Details for the file standard_transform-2.0.0.tar.gz.

File metadata

  • Download URL: standard_transform-2.0.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for standard_transform-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8ac037b97311a9a1944559efa11a188cba96d00e482c030b07d7e7efebcf8652
MD5 b4eae84aef849acb86adad25b126524f
BLAKE2b-256 e17cf1feb5cc26d8d062d0b5898c708e9fd7a275babea65f00d5172551d4201c

See more details on using hashes here.

File details

Details for the file standard_transform-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: standard_transform-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 973.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for standard_transform-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32b3a7e2460ea202bf0cbb46d1aea58f9fc862fd66cd633815f25edfc68edf83
MD5 32e4f2f15c0d1227d9549340660b1516
BLAKE2b-256 318907c76dbea9e5fa1205758084e25766679e1bf709686995668fa29ede5661

See more details on using hashes here.

Supported by

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