Skip to content
Snippets Groups Projects
Commit 361eebe3 authored by Philipp Schmidt's avatar Philipp Schmidt Committed by David Hammer
Browse files

Add missing swap_axes implementation in preview friend

parent 35bf9a16
No related branches found
No related tags found
1 merge request!137Add missing swap_axes implementation in preview friend
...@@ -261,6 +261,8 @@ class PreviewFriend: ...@@ -261,6 +261,8 @@ class PreviewFriend:
) )
elif not inplace: elif not inplace:
data = data.copy() data = data.copy()
if spec.swap_axes:
data = np.swapaxes(data, -1, -2)
if spec.flip_ss: if spec.flip_ss:
data = np.flip(data, -2) data = np.flip(data, -2)
if spec.flip_fs: if spec.flip_fs:
...@@ -322,7 +324,7 @@ class PreviewFriend: ...@@ -322,7 +324,7 @@ class PreviewFriend:
if subconf.has("flipFS"): if subconf.has("flipFS"):
spec.flip_fs = subconf["flipFS"] spec.flip_fs = subconf["flipFS"]
if subconf.has("swapAxes"): if subconf.has("swapAxes"):
spec.flip_fs = subconf["flipFS"] spec.swap_axes = subconf["swapAxes"]
if subconf.has("replaceNanWith"): if subconf.has("replaceNanWith"):
spec.nan_replacement = subconf["replaceNanWith"] spec.nan_replacement = subconf["replaceNanWith"]
......
...@@ -541,35 +541,44 @@ class RoiBox(VerticalLayout): ...@@ -541,35 +541,44 @@ class RoiBox(VerticalLayout):
class PreviewSettings(HorizontalLayout): class PreviewSettings(HorizontalLayout):
def __init__(self, device_id, schema_hash, node_name): def __init__(self, device_id, schema_hash, node_name):
super().__init__() super().__init__()
tweaks = VerticalLayout( tweaks = [
EditableRow( EditableRow(
device_id, device_id,
schema_hash, schema_hash,
f"{node_name}.replaceNanWith", f"{node_name}.replaceNanWith",
6, 6,
4, 4,
), )
) ]
flips = []
if schema_hash.has(f"{node_name}.flipSS"): if schema_hash.has(f"{node_name}.flipSS"):
tweaks.children.append( tweaks.append(
HorizontalLayout( EditableRow(
EditableRow( device_id,
device_id, schema_hash,
schema_hash, f"{node_name}.swapAxes",
f"{node_name}.flipSS", 6,
3, 4,
2,
),
EditableRow(
device_id,
schema_hash,
f"{node_name}.flipFS",
3,
2,
),
padding=0,
) )
) )
flips.append(
EditableRow(
device_id,
schema_hash,
f"{node_name}.flipSS",
3,
2,
)
)
flips.append(
EditableRow(
device_id,
schema_hash,
f"{node_name}.flipFS",
3,
2,
)
)
downsampling = VerticalLayout( downsampling = VerticalLayout(
LabelModel( LabelModel(
text="Downsampling", text="Downsampling",
...@@ -593,7 +602,7 @@ class PreviewSettings(HorizontalLayout): ...@@ -593,7 +602,7 @@ class PreviewSettings(HorizontalLayout):
) )
self.children.extend( self.children.extend(
[ [
tweaks, VerticalLayout(children=tweaks + [HorizontalLayout(children=flips)]),
Vline(height=3 * BASE_INC), Vline(height=3 * BASE_INC),
downsampling, downsampling,
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment