From 6cb4d957aec60c7c7083eb180c34348cf8081218 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 15 Feb 2024 01:52:00 +0100 Subject: [PATCH 1/2] Update tests to fix napari 0.4.19 errors (#91) Setting the colormap to 'green' wasn't expected to work for all layer types, and is unnecessary in testing anyway. --- src/affinder/_tests/test_affinder.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/affinder/_tests/test_affinder.py b/src/affinder/_tests/test_affinder.py index 57fd158..b9246e3 100644 --- a/src/affinder/_tests/test_affinder.py +++ b/src/affinder/_tests/test_affinder.py @@ -61,12 +61,9 @@ def test_layer_types(make_napari_viewer, tmp_path, reference, moving): viewer = make_napari_viewer() l0 = viewer.add_layer(reference) - viewer.layers[-1].name = "layer0" - viewer.layers[-1].colormap = "green" - + l0.name = 'layer0' l1 = viewer.add_layer(moving) - viewer.layers[-1].name = "layer1" - viewer.layers[-1].colormap = "magenta" + l1.name = 'layer1' my_widget_factory = start_affinder() my_widget_factory( From e04ddde0fe89b8df6667491710ba565506a6e0c8 Mon Sep 17 00:00:00 2001 From: Andreas M Arnold Date: Wed, 14 Feb 2024 21:23:56 -0500 Subject: [PATCH 2/2] Add txt file filter for saving output file (#90) Closes #89, preventing images from being overwritten by the affine parameters, by: - changing the label of the file selection box to make it clearer that it's for saving affine parameters, and - adding a file filter to the file selection widget, so it only shows .txt files. --- src/affinder/affinder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/affinder/affinder.py b/src/affinder/affinder.py index 798e07a..4da9bb5 100644 --- a/src/affinder/affinder.py +++ b/src/affinder/affinder.py @@ -129,7 +129,7 @@ def _on_affinder_main_init(widget): widget_init=_on_affinder_main_init, call_button='Start', layout='vertical', - output={'mode': 'w'}, + output={'mode': 'w', 'label': 'Save transformation as', 'filter': '*.txt'}, viewer={'visible': False, 'label': ' '}, delete_pts={ 'label':