Skip to content

[Feature] Standardise the order the axes are listed in arguments #105

@IgorTatarnikov

Description

@IgorTatarnikov

Currently, parts of the package list arguments using the xyz order which are then flipped to match the standard zyx. To avoid confusion and bugs, all parameters relating to the physical axes (not anatomical) should always be in the zyx order, and passed using a tuple where possible.

e.g. The below code snippet is confusing, and has a bug inside as the signal emits the scales in xyz order while the atlas resolutions are in zyx. The test only passes due to the symmetric nature of the atlas.

def test_scale_moving_image_2d(
make_napari_viewer_with_images,
registration_widget,
mocker,
x_scale_factor,
y_scale_factor,
):
mock_atlas = mocker.patch(
"brainglobe_registration.registration_widget.BrainGlobeAtlas"
)
mock_atlas.resolution = [20, 20, 20]
registration_widget._atlas = mock_atlas
current_size = registration_widget._moving_image.data.shape
registration_widget.adjust_moving_image_widget.scale_image_signal.emit(
mock_atlas.resolution[1] * x_scale_factor,
mock_atlas.resolution[2] * y_scale_factor,
0.001,
)
assert registration_widget._moving_image.data.shape == (
current_size[0] * y_scale_factor,
current_size[1] * x_scale_factor,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions