Skip to content

Conversation

@GFleishman
Copy link
Member

If distributed_piecewise_alignment_pipeline is called with a non-empty static_transform_list, the fixed block coordinates have to be transformed through all transforms in static_transform_list to determine the corresponding moving image block coordinates. When static_transform_list contains a transform, or a combination of transforms, that moves the moving image substantially, it is possible that a fixed image block will have no corresponding region in the moving image, that is, the corresponding moving image block would be entirely outside the moving image domain. Basically, this means the fixed image contains a region of data that the moving image does not (assuming the transforms in static_transform_list are correct).

To fix this, I added a hidden default flag to align.alignment_pipeline. If either fix or mov is None then the alignment_pipeline returns the identity transform. I also modified piecewise_align.distributed_piecewise_alignment_pipeline to check if any of the moving block end coordinates are negative. This would indicate that the region of moving image that corresponds to the fixed block is outside the moving image domain. In this case, instead of attempting (and failing) to read from the moving image zarr, we set mov to None. Everything else works the same way, but when alignment_pipeline sees mov=None, it immediately returns an identity transform.

@cgoina
Copy link
Collaborator

cgoina commented Feb 3, 2026

@GFleishman you can merge this - if I run into any issues I will let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants