Skip to main content

Elastix-based geospatial pairwise raster alignment

Project description

Coregix

Coregix provides elastix-based pairwise raster alignment for geospatial imagery.

Current scope:

  • pairwise raster alignment CLI and Python API
  • edge-proxy registration for structural cross-sensor alignment
  • chunked transform application for large moving rasters
  • optional postprocess trimming of invalid edge artifacts

Install

Conda environment

conda env create -f environment.yml
conda activate coregix

This installs the runtime stack and the package in editable mode.

Editable install into an existing environment

pip install -e .

The installed CLI entrypoint is:

vhr-align-image-pair --help

You can also run the module directly:

python -m coregix.cli.align_image_pair --help

CLI usage

Align a moving image to a fixed image

vhr-align-image-pair \
  --moving-image /path/to/moving.tif \
  --fixed-image /path/to/fixed.tif \
  --output-image /path/to/aligned.tif

By default this:

  • registers on edge-proxy images
  • writes the result on the moving-image grid
  • uses no chunking (--split-factor 0)

Use chunking for large moving rasters

--split-factor controls chunked transform application as 2^k total chunks:

  • 0: no split
  • 1: halves
  • 2: quadrants
  • 3: octants

Example with quadrants:

vhr-align-image-pair \
  --moving-image /path/to/moving_large.tif \
  --fixed-image /path/to/fixed.tif \
  --output-image /path/to/aligned_large.tif \
  --split-factor 2

Remove invalid edge artifacts after alignment

--trim-edge-invalid runs a raster-space cleanup pass after alignment and sets edge artifacts to nodata.

Example:

vhr-align-image-pair \
  --moving-image /path/to/moving_large.tif \
  --fixed-image /path/to/fixed.tif \
  --output-image /path/to/aligned_large_edgefixed.tif \
  --split-factor 2 \
  --trim-edge-invalid \
  --edge-trim-depth 8 \
  --edge-trim-invalid-below -3000

The edge-trim thresholds are dataset-specific. --edge-trim-invalid-below is useful when interpolation artifacts are not equal to the dataset nodata value.

Python usage

Basic alignment

from coregix import align_image_pair

result = align_image_pair(
    moving_image_path="/path/to/moving.tif",
    fixed_image_path="/path/to/fixed.tif",
    output_image_path="/path/to/aligned.tif",
)

print(result.output_image_path)

Large raster with chunking and edge cleanup

from coregix import align_image_pair

result = align_image_pair(
    moving_image_path="/path/to/moving_large.tif",
    fixed_image_path="/path/to/fixed.tif",
    output_image_path="/path/to/aligned_large_edgefixed.tif",
    split_factor=2,
    trim_edge_invalid=True,
    edge_trim_depth=8,
    edge_trim_invalid_below=-3000,
)

print(result.output_image_path)

Notes

  • split_factor changes only transform application, not the registration model.
  • split_factor=2 is the direct replacement for the previous quadrant-based large-raster path.
  • If needed, you can select separate registration bands with moving_band_index and fixed_band_index in Python or --moving-band-index and --fixed-band-index in the CLI.

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

coregix-0.1.1.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

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

coregix-0.1.1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coregix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 36ebc0af7ee5553b8d585dc0b35646e656c9e6dcf7b1244a1ceeccff72886479
MD5 4a53848cf9dcc174a6427aa1e39ed9b2
BLAKE2b-256 3c82baad1d0336a93bcec5b22931b75bc7638ce23ab8d6abd988e30c441fcb84

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on iosefa/coregix

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

File details

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

File metadata

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

File hashes

Hashes for coregix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cc55cc36c370d1d3e9b07d521b42054adff9f666543e461b9f503b614b987fa
MD5 50d1a858370c5ba0aafa235a05d76f49
BLAKE2b-256 f539319bf7a8daa87d865c9c9abd2265f574c2c225a5bd521c0fe744cd911f14

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on iosefa/coregix

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