Skip to main content

atlas-cci-align

Utilities for processing SEM image data exported from ATLAS/FIBICS projects.

The package currently focuses on turning an ATLAS project into stitched 2D planes, then roughly aligning those planes into a 3D stack. It provides helpers to:

  • read ATLAS mosaic metadata (.mif) and per-tile TIFF metadata;
  • reconstruct one stitched 2D image per acquisition plane;
  • estimate rough pairwise z-alignment between stitched planes;
  • apply the cumulative alignment into a Zarr array;
  • export the aligned Zarr stack back to a CZI file.

The stitching code uses tile positions, scan rotation, acquisition order, image size, and pixel size from the ATLAS/FIBICS metadata. ATLAS records when tile acquisition is finished, so dynamic/incremental processing should be possible in principle.

Status

This is early packaging work. The rough stitching and z-alignment utilities are being moved from notebooks/scripts into an installable package.

Install

pip install atlas-cci-align

To work from a local checkout, run these commands from the repository root:

conda env create --file environment.yml
conda activate atlas-env

The environment file also installs this checkout in editable mode, so code changes are available without reinstalling. Keep the checkout in place.

The distribution name is atlas-cci-align, while the Python package is imported as:

import atlas

Minimal Workflow

At a high level, the intended workflow is:

  1. Parse an ATLAS mosaic project and build a tile dataframe.
  2. Stitch tiles into one 2D plane.
  3. Repeat for the planes in the project.
  4. Run rough z-alignment across the stitched planes.
  5. Save the aligned stack as Zarr.
  6. Optionally export the Zarr stack as CZI.

The public API is still being shaped, so consult the modules directly for now:

  • atlas.stitching
  • atlas.alignment
  • atlas.io
  • atlas.image_analysis

Stage-only stitching

For metadata-based placement without cross-correlation or valid-area cropping:

from atlas.io import get_metadata_for_stitched_tif
from atlas.stitching import stage_stitching, save_stitched_image

image, tiles, transforms = stage_stitching(mif_file)
save_stitched_image(
    output_tif_path,
    image,
    get_metadata_for_stitched_tif(mif_file),
    compression="deflate",
)

This retains full tiles and zero-filled gaps, using stage positions corrected for scan rotation. Later tiles in acquisition order overwrite earlier tiles in overlaps. Deflate compression is lossless. The existing stitch_ATLAS_tiles workflow and default uncompressed saving are unchanged.

Use ATLAS-stage-import.ipynb to process a series. It writes stage_stitched_S_<number>.tiff, stage_stitching_S_<number>.csv, and stage_stitched_transforms_S_<number>.json next to the section folders, skipping TIFFs that already exist. The CSV records tile metadata and nominal placement; the JSON records zero registration corrections. The notebook defaults to no added buffer, matching the function; raw import uses 1 µm to allow for registration shifts. Local examples and comparison results under private-data/ are Git-ignored.

Transfer an aligned WEBKNOSSOS region

transfer_wk_annotation_region.py downloads the user bounding box from an annotation on the fine-aligned dataset, then optionally uploads the image data using a different organization's token. Configure the inputs at the top of the script. The default test magnification is 32-32-8; DO_UPLOAD = False downloads only. Tokens can be entered at the top or supplied as WK_SOURCE_TOKEN and WK_TARGET_TOKEN environment variables. The destination organization is taken from the target token; an optional expected organization ID can be specified. The uploaded name defaults to <source dataset name>_mag<MAG>; set TARGET_DATASET_NAME to override it.

The script lists bounding boxes and requires an index when there are several. It selects image/color layers by default, preserves voxel size and source coordinates, and stores the subset as compressed Zarr v3 under private-data/. Only the requested magnification is downloaded. With BUILD_PYRAMID = True (the default), the script then creates compressed coarser levels locally using anisotropic downsampling, up to PYRAMID_COARSEST_MAG (default 64). This also repairs an existing completed download that has only one resolution. Use MAG = "1" to transfer full-resolution data with a viewing pyramid. Generation always starts at the downloaded magnification: a 16-16-4 subset gets only coarser levels, never a synthesized mag 1. The exact levels follow the voxel-size-aware anisotropic sampling scheme. Coarse voxels can extend to the next magnification-aligned boundary. No annotation contents are transferred.

Completed downloads and pyramids are recorded locally and reused for upload retries. Upload records include the magnifications, so adding a pyramid triggers a new upload even if an earlier single-resolution upload was recorded. This creates a new destination dataset; the previous upload is retained. Interrupted pyramid builds are regenerated from the downloaded resolution. A partial download or a changed selection requires a new output directory. For server-side display transformations, use a materialized aligned dataset before transferring the selected region.

The SDK and compatible IPython/Pydantic versions are included in environment.yml. Run with:

conda activate atlas-env
python transfer_wk_annotation_region.py

Metadata

Release files for atlas-cci-align 1.3.16

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

Source distribution (sdist)

Source distribution for atlas-cci-align 1.3.16
File Size Uploaded Provenance Actions
atlas_cci_align-1.3.16.tar.gz 1.0 MB With provenance Details for atlas_cci_align-1.3.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atlas-cci-align 1.3.16
File Interpreter ABI Platform Actions
atlas_cci_align-1.3.16-py3-none-any.whl Python 3 none any Details for atlas_cci_align-1.3.16-py3-none-any.whl

Total release size: 1.1 MB

Release files / atlas_cci_align-1.3.16.tar.gz

Download URL atlas_cci_align-1.3.16.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b375af9dc93835183ae97427da312b1630dca27b9e96995b291711a0fdb2f929
BLAKE2b-256 checksum
How to use checksums
5318c2025dab13c77a1c589d4f44c02b49ee4f4af8d0cb1839f55f8ba1ed7250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / atlas_cci_align-1.3.16-py3-none-any.whl

Download URL atlas_cci_align-1.3.16-py3-none-any.whl
Size 47.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1594092356a8f112333fcc63316fae73fa39f1c7588aa6e394f54dbe260eb48b
BLAKE2b-256 checksum
How to use checksums
6920944d92f258d7af186d00821c7d7757e38a5e495f2ea36320ae7152facd4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for atlas-cci-align 1.3.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atlas_cci_align-1.3.16.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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