Skip to main content

Efficient and scalable image registration (alignment) for multiplexed imaging data

Project description

MIRAGE

Efficient and scalable image registration (alignment) for multiplexed imaging data. Currently only available for GPU.

Installation

git clone https://github.com/dpeerlab/MIRAGE.git
cd mirage
pip install -e .

Example

Also, check out the example in tests/quickstart.ipynb:

Before alignment:

before

After alignment:

after

# load package
import mirage

# Load images
image = mirage.tl.get_data("sample2_image.tiff")
reference = mirage.tl.get_data("sample2_reference.tiff")
# Images must be 2D numpy arrays (grayscale only) and scaled to 0-1.

# Initialise model
mirage_model = mirage.MIRAGE(
    images=image,
    references=reference,
    bin_mask=bin_mask,
    pad=12,
    offset=12,
    num_neurons=196,  # more for larger images
    num_layers=2,  # more for larger images
    pool=1, 
    loss="SSIM"
)

# Train model
mirage_model.train(batch_size=256, num_steps=256, lr__sched=True, LR=0.005)

# Apply transformation
mirage_model.compute_transform()
image_aligned = mirage_model.apply_transform(image)

# Inspect results pre/post alignment of a smale mesh
mesh = mirage.tl.Mesh(x=80, y=160, pad=35)
mirage.pl.plot_before_after(reference, image, image_aligned, mesh=mesh)

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

cellmirage-0.1.1.tar.gz (2.9 MB view hashes)

Uploaded Source

Built Distribution

cellmirage-0.1.1-py3-none-any.whl (2.9 MB view hashes)

Uploaded Python 3

Supported by

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