Image Registration Module
Affine registration and image warping
Small multiview-stitcher adapters for MERFISH registration.
Functions:
| Name | Description |
|---|---|
register_pair_to_fixed | Register a moving image to a fixed image with staged GPU phase correlation. |
warp_array_to_reference_gpu | Warp an image into a reference ZYX grid using CuPy affine interpolation. |
warp_array_to_reference_with_affine_and_sofima_flow_gpu | Warp an image with a stored affine transform and SOFIMA flow field. |
_clear_cupy_memory(cp)
Release cached CuPy allocations and FFT plans after a registration stage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cp | Any | Imported | required |
Returns:
| Type | Description |
|---|---|
None | CuPy memory pools and FFT plan cache are cleared in-place. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_diag(message, *, enabled)
Print one multiview registration diagnostic message when enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message | str | Diagnostic message body. | required |
enabled | bool | If True, print the diagnostic message. | required |
Returns:
| Type | Description |
|---|---|
None | The message is printed only when diagnostics are enabled. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_max_z_projection_gpu(image, cp)
Compute a maximum Z projection without retaining the full GPU volume.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image | ndarray | Input image in Z, Y, X order. | required |
cp | Any | Imported | required |
Returns:
| Type | Description |
|---|---|
ndarray | Maximum projection over Z as a GPU array. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_maximum_overlap_phase_shift_px(shift_px, shape)
Select periodic phase-shift aliases with maximum image overlap.
FFT phase correlation identifies shifts modulo each axis length. Real-space disambiguation can therefore report a shift close to +/-axis_size that overlaps only a small part of the images even when the equivalent near-zero shift is physically supported. For equal-shaped local- registration images, the representative in [-axis_size / 2, axis_size / 2) retains at least half of every field of view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shift_px | Sequence[float] | Phase-correlation shift in pixels for each axis. | required |
shape | Sequence[int] | Phase-correlation image shape in the same axis order. | required |
Returns:
| Type | Description |
|---|---|
ndarray | Equivalent periodic shifts with maximum overlap on every axis. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_overlap_slices_after_translation(shape, translation_px)
Return output slices whose translated coordinates stay inside the input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape | Sequence[int] | Image shape. | required |
translation_px | Sequence[float] | Translation used by | required |
Returns:
| Type | Description |
|---|---|
tuple[slice, ...] or None | Valid overlap slices, or None if the translation leaves no overlap. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_overlap_weighted_translation_score(fixed, moving, *, pull_shift_px, array_module)
Score a pull translation using correlation and retained image overlap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed | Any | Fixed image array. | required |
moving | Any | Moving image array with the same shape as | required |
pull_shift_px | Sequence[float] | Candidate fixed-to-moving pull translation in pixels. | required |
array_module | Any | NumPy-compatible module implementing array arithmetic. Runtime GPU registration supplies CuPy; CPU tests supply NumPy. | required |
Returns:
| Type | Description |
|---|---|
float | Pearson correlation multiplied by the fraction of fixed-image pixels retained in the overlap. Invalid or constant overlaps score negative infinity. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
_select_phase_correlation_pull_shift_px(fixed, moving, *, phase_cross_correlation, array_module, to_numpy, diagnostics=False)
Select a reliable phase-correlation translation candidate.
Phase normalization can amplify decorrelated high-frequency noise in fiducial images and produce a strong but physically unsupported peak near half an image period. This function evaluates phase-normalized, unnormalized, and identity candidates in real space. It selects the candidate with the best overlap-weighted Pearson correlation after mapping every periodic shift to its maximum-overlap representative.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed | Any | Fixed image array. | required |
moving | Any | Moving image array with the same shape as | required |
phase_cross_correlation | Any | NumPy-compatible phase-correlation callable. | required |
array_module | Any | NumPy-compatible array module used for real-space scoring. | required |
to_numpy | Any | Callable converting a phase-correlation result to a NumPy array. | required |
diagnostics | bool | If True, print candidate shifts and scores. | False |
Returns:
| Type | Description |
|---|---|
ndarray | Selected fixed-to-moving pull translation in pixels. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | |
_translation_overlap_slices(shape, pull_shift_px)
Return fixed and moving slices for an integerized pull translation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape | Sequence[int] | Equal fixed and moving image shape. | required |
pull_shift_px | Sequence[float] | Translation for which output coordinate | required |
Returns:
| Type | Description |
|---|---|
tuple[tuple[slice, ...], tuple[slice, ...]] or None | Matching fixed and moving overlap slices, or |
Source code in src/merfish3danalysis/utils/multiview_registration.py
register_pair_to_fixed(fixed, moving, *, spacing_zyx_um, diagnostics=False)
Register a moving image to a fixed image with staged GPU phase correlation.
The input arrays are interpreted as Z, Y, X images with physical spacing in microns. The registration first estimates lateral translation from maximum Z projections, warps the moving volume by that lateral estimate, then runs phase correlation on the full volume to estimate the residual translation. At both stages, phase-normalized, unnormalized, and identity candidates are scored in real space so decorrelated noise cannot promote a large half-period displacement. The returned affine maps fixed/reference physical coordinates to moving-image physical coordinates, matching the convention expected by :func:warp_array_to_reference_gpu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed | ndarray | Reference image in Z, Y, X order. | required |
moving | ndarray | Image to align to | required |
spacing_zyx_um | Sequence[float] | Physical voxel spacing in microns in Z, Y, X order. | required |
diagnostics | bool | If True, print detailed timing diagnostics. | False |
Returns:
| Type | Description |
|---|---|
ndarray | Homogeneous 4x4 affine transform in physical Z, Y, X coordinates. The transform maps coordinates in the fixed reference space to coordinates sampled from the moving image, matching the convention expected by :func: |
Source code in src/merfish3danalysis/utils/multiview_registration.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | |
warp_array_to_reference_gpu(image, *, transform_zyx_um, spacing_zyx_um, reference_shape, reference_origin_zyx_um=(0.0, 0.0, 0.0), mode='constant', cval=0.0, order=1, gpu_id=0, z_batch_size=4, diagnostics=False)
Warp an image into a reference ZYX grid using CuPy affine interpolation.
The physical transform convention matches the local registration adapter: the 4x4 matrix maps output/reference physical coordinates to input/moving physical coordinates. The matrix is converted to the pixel-coordinate convention expected by cupyx.scipy.ndimage.affine_transform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image | ndarray | Moving image in Z, Y, X order. | required |
transform_zyx_um | ndarray | Homogeneous 4x4 affine transform in physical Z, Y, X coordinates. The transform maps output/reference coordinates to input/moving coordinates. | required |
spacing_zyx_um | Sequence[float] | Physical voxel spacing in microns in Z, Y, X order for both input and output grids. | required |
reference_shape | Sequence[int] | Output grid shape in Z, Y, X order. | required |
reference_origin_zyx_um | Sequence[float] | Physical output origin in microns in Z, Y, X order. The moving image is assumed to use the same origin convention as the reference grid. | (0.0, 0.0, 0.0) |
mode | str | Boundary mode passed to | "constant" |
cval | float | Constant fill value used when | 0.0 |
order | int | Interpolation order passed to | 1 |
gpu_id | int | CUDA device ID to use. | 0 |
z_batch_size | int | Number of output z planes to process per GPU batch. Keeping this small avoids allocating full-volume coordinate grids for large tiles. | 4 |
diagnostics | bool | If True, print detailed timing diagnostics. | False |
Returns:
| Type | Description |
|---|---|
ndarray | Warped image sampled on the reference grid. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | |
warp_array_to_reference_with_affine_and_sofima_flow_gpu(image, *, transform_zyx_um, spacing_zyx_um, reference_shape, sofima_flow_field_xyz_px, flow_field_stride_zyx_px, flow_field_box_start_xyz_px, reference_origin_zyx_um=(0.0, 0.0, 0.0), mode='constant', cval=0.0, order=1, gpu_id=0, z_batch_size=4, diagnostics=False)
Warp an image with a stored affine transform and SOFIMA flow field.
The image is sampled exactly once. The SOFIMA flow field is interpolated in reference pixel space, composed with the stored affine transform, and the original moving image is sampled at the composed source coordinates.
Deformable-field convention
sofima_flow_field_xyz_px has channel-first shape (3, z, y, x). Channels are ordered X, Y, Z and spatial axes are ordered Z, Y, X. Each vector is a relative displacement in reference pixels from a reference-grid coordinate toward the affine-initialized moving image. The first map sample is located at flow_field_box_start_xyz_px in X, Y, Z pixel coordinates. SOFIMA estimates patch-centered vectors, so fields produced by :func:estimate_sofima_flow_field_xyz_px use half the patch size as this origin. The map stride is stored separately in Z, Y, X order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image | ndarray | Moving image in native Z, Y, X order. | required |
transform_zyx_um | ndarray | Homogeneous 4x4 physical transform mapping reference Z, Y, X coordinates to moving native Z, Y, X coordinates. | required |
spacing_zyx_um | Sequence[float] | Voxel spacing in microns in Z, Y, X order. | required |
reference_shape | Sequence[int] | Output shape in Z, Y, X order. | required |
sofima_flow_field_xyz_px | ndarray | Relative SOFIMA flow field with channels X, Y, Z and spatial axes Z, Y, X. It maps reference pixels toward affine-initialized moving pixels. | required |
flow_field_stride_zyx_px | Sequence[float] | Flow-field sampling stride in reference pixels in Z, Y, X order. | required |
flow_field_box_start_xyz_px | Sequence[float] | Reference pixel coordinate of the first flow sample in X, Y, Z order. | required |
reference_origin_zyx_um | Sequence[float] | Physical origin for the reference and moving local grids. | (0.0, 0.0, 0.0) |
mode | str | Boundary mode for flow-field interpolation and image sampling. | "constant" |
cval | float | Constant fill value used when sampling outside the flow field or moving image. | 0.0 |
order | int | Interpolation order for the final image sampling. | 1 |
gpu_id | int | CUDA device ID to use. | 0 |
z_batch_size | int | Number of output z planes to process per GPU batch. | 4 |
diagnostics | bool | If True, print detailed timing diagnostics. | False |
Returns:
| Type | Description |
|---|---|
ndarray | Warped image on the reference grid. |
Source code in src/merfish3danalysis/utils/multiview_registration.py
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 | |
SOFIMA deformable registration
SOFIMA flow-field estimation utilities.
Classes:
| Name | Description |
|---|---|
SofimaRegistrationConfig | Explicit SOFIMA deformable registration parameters. |
Functions:
| Name | Description |
|---|---|
estimate_sofima_flow_field_xyz_px | Estimate the production SOFIMA flow field after affine initialization. |
SofimaRegistrationConfig dataclass
Explicit SOFIMA deformable registration parameters.
Methods:
| Name | Description |
|---|---|
as_metadata | Return JSON-compatible config metadata. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
as_metadata()
Return JSON-compatible config metadata.
Source code in src/merfish3danalysis/utils/sofima_registration.py
_compose_flow_fields_same_grid(base_flow_xyz, residual_flow_xyz, *, stride_zyx, box_start_xyz)
Compose two SOFIMA flow fields sampled on the same reference grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_flow_xyz | ndarray | Existing flow field in | required |
residual_flow_xyz | ndarray | Residual flow field in | required |
stride_zyx | tuple[float, float, float] | Flow-grid spacing in reference-image pixels. | required |
box_start_xyz | tuple[float, float, float] | Reference pixel coordinate of the first flow sample in X, Y, Z order. | required |
Returns:
| Type | Description |
|---|---|
ndarray | Composed flow field mapping reference-grid coordinates directly into the original affine-initialized moving image. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
_estimate_sofima_flow_field_xyz_px_impl(fixed_zyx, moving_affine_initialized_zyx, *, config, single_residual_pass=False)
Estimate a SOFIMA flow field after affine initialization.
The returned field follows the package deformable-registration convention:
- Array shape is
(3, z, y, x). - Channel order is
X, Y, Zbecause this is SOFIMA's flow-component order. - Spatial map axes are
Z, Y, Xto match image arrays. - Values are relative displacements in reference-image pixels. Adding the interpolated field to a reference-grid coordinate gives the coordinate in the affine-initialized moving image.
map_box_start_xyz_pxis the reference-grid coordinate of the first flow sample inX, Y, Zorder. SOFIMA estimates patch-centered displacements, so this origin is half the patch size, not the image corner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed_zyx | ndarray | Reference round001 fiducial image in Z, Y, X order. | required |
moving_affine_initialized_zyx | ndarray | Moving fiducial image already rendered into the reference grid by the stored affine transform. | required |
single_residual_pass | bool | Internal recursion control. Public callers always use the fixed production path with two residual passes. | False |
config | SofimaRegistrationConfig | Explicit SOFIMA parameter set. | required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, dict[str, Any]] | Relative SOFIMA flow field with XYZ channels and metadata describing the map spacing/origin. The metadata is sufficient to save the field as OME-Zarr and later reproduce the same warp from the reloaded field. |
Notes
SOFIMA's masked cross-correlation estimator computes integer local flow vectors from post_image to pre_image. Passing the affine-initialized moving image as pre_image and round001 as post_image gives the residual displacement from reference pixels into affine-initialized moving pixels. The local measurements are then relaxed with SOFIMA's 3D elastic mesh solver to produce the smooth float-valued field expected by :func:merfish3danalysis.utils.multiview_registration.warp_array_to_reference_with_affine_and_sofima_flow_gpu.
Source code in src/merfish3danalysis/utils/sofima_registration.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
_median_initial_flow_field(cleaned_flow_xyz)
Build a dense SOFIMA mesh initializer from valid local flow vectors.
SOFIMA's elastic relaxation needs a dense initial mesh, but the cleaned local flow map is sparse. Invalid nodes are initialized to the robust median vector, while valid measured nodes keep their measured displacement. This avoids the expensive CPU scattered interpolation in sofima.map_utils.fill_missing while preserving the local information available before relaxation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cleaned_flow_xyz | ndarray | Cleaned SOFIMA flow field in | required |
Returns:
| Type | Description |
|---|---|
ndarray | Dense initial flow field in |
Source code in src/merfish3danalysis/utils/sofima_registration.py
_normalized_mean_squared_error(fixed_zyx, moving_zyx)
Return normalized mean-squared error between two images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed_zyx | ndarray | Fixed reference image. | required |
moving_zyx | ndarray | Moving image sampled on the reference grid. | required |
Returns:
| Type | Description |
|---|---|
float | Mean-squared error after robust intensity normalization. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
_refine_flow_vectors_subpixel(flow_xyz, pre_image_zyx, post_image_zyx, *, patch_size_zyx, step_zyx, config)
Refine valid SOFIMA integer vectors by local fractional patch matching.
SOFIMA's local cross-correlation reports integer-pixel peak locations. This function keeps SOFIMA's accepted vectors and only searches a small fractional neighborhood around each one. Candidate shifts are scored by normalized sum-of-squared differences between the post patch and a subpixel-sampled pre patch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flow_xyz | ndarray | Cleaned SOFIMA flow field in | required |
pre_image_zyx | ndarray | Moving image in Z, Y, X order. This is SOFIMA's | required |
post_image_zyx | ndarray | Fixed image in Z, Y, X order. This is SOFIMA's | required |
patch_size_zyx | tuple[int, int, int] | Patch size used for SOFIMA flow estimation. | required |
step_zyx | tuple[int, int, int] | Flow-grid step used for SOFIMA flow estimation. | required |
config | SofimaRegistrationConfig | Explicit SOFIMA parameter set. | required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int] | Refined flow field and the number of vectors that were refined. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
_relax_flow_field(cleaned_flow_xyz, initial_flow_xyz, step_zyx, config)
Relax a sparse SOFIMA flow field with SOFIMA's elastic mesh solver.
SOFIMA's patch cross-correlation returns integer local flow vectors. The elastic mesh converts those measurements into the smooth float-valued coordinate map expected by downstream warping. Valid measured vectors pull mesh nodes through zero-length springs; invalid nodes are governed by the internal 3D mesh elasticity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cleaned_flow_xyz | ndarray | Cleaned SOFIMA flow field in | required |
initial_flow_xyz | ndarray | Initial dense flow field in | required |
step_zyx | tuple[int, int, int] | Flow-grid spacing in image pixels in Z, Y, X order. | required |
config | SofimaRegistrationConfig | Explicit SOFIMA parameter set. | required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, dict[str, Any]] | Relaxed float-valued flow field and metadata for the mesh solve. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
_resolve_patch_and_step(shape_zyx, config)
Resolve SOFIMA patch size and stride for one fixed/moving volume pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape_zyx | tuple[int, int, int] | Shape of the fixed and moving volumes in Z, Y, X order. | required |
config | SofimaRegistrationConfig | Explicit SOFIMA parameter set. | required |
Returns:
| Type | Description |
|---|---|
tuple[tuple[int, int, int], tuple[int, int, int]] | Patch size and step in Z, Y, X order, clipped to the image shape. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
_stabilize_axial_flow_component(flow_xyz, config)
Clip unstable local axial residuals in a SOFIMA flow field.
The affine registration step handles the bulk Z displacement between rounds. The SOFIMA field is used for residual deformable correction, but local axial flow is much less well constrained than lateral flow in these anisotropic volumes. Large local Z excursions can map valid reference planes outside the moving image and produce black slabs in warped data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flow_xyz | ndarray | SOFIMA flow field with channels ordered X, Y, Z and spatial axes Z, Y, X. | required |
config | SofimaRegistrationConfig | Explicit SOFIMA parameter set. | required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, dict[str, Any]] | Flow field with the Z channel clipped around its robust median, and metadata describing the clipping. |
Source code in src/merfish3danalysis/utils/sofima_registration.py
estimate_sofima_flow_field_xyz_px(fixed_zyx, moving_affine_initialized_zyx, *, config=None)
Estimate the production SOFIMA flow field after affine initialization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fixed_zyx | ndarray | Reference round001 fiducial image in Z, Y, X order. | required |
moving_affine_initialized_zyx | ndarray | Moving fiducial image already rendered into the reference grid by the stored affine transform. | required |
config | SofimaRegistrationConfig or None | Explicit SOFIMA parameter set. If omitted, use | None |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, dict[str, Any]] | Relative SOFIMA flow field with XYZ channels and metadata describing the map spacing/origin. |