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

  • Transforms — apply, 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

Metadata

Release files for standard-transform 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for standard-transform 2.0.0
File Size Uploaded
standard_transform-2.0.0.tar.gz 2.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for standard-transform 2.0.0
File Interpreter ABI Platform
standard_transform-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.4 MB

Release files / standard_transform-2.0.0.tar.gz

Download URL standard_transform-2.0.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8ac037b97311a9a1944559efa11a188cba96d00e482c030b07d7e7efebcf8652
BLAKE2b-256 checksum
How to use checksums
e17cf1feb5cc26d8d062d0b5898c708e9fd7a275babea65f00d5172551d4201c
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / standard_transform-2.0.0-py3-none-any.whl

Download URL standard_transform-2.0.0-py3-none-any.whl
Size 973.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32b3a7e2460ea202bf0cbb46d1aea58f9fc862fd66cd633815f25edfc68edf83
BLAKE2b-256 checksum
How to use checksums
318907c76dbea9e5fa1205758084e25766679e1bf709686995668fa29ede5661
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.4.1

2 release files

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.0.3

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page