Skip to content

Commit

Permalink
fix visualization script scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
talonchandler committed Sep 9, 2024
1 parent 546ed16 commit 96d8b85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions waveorder/models/isotropic_fluorescent_thick_3d.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Literal

import numpy as np
import torch
from torch import Tensor

Expand Down Expand Up @@ -76,9 +77,12 @@ def visualize_transfer_function(viewer, optical_transfer_function, zyx_scale):
name=array[1],
colormap="bwr",
contrast_limits=(-lim, lim),
scale=1 / zyx_scale,
scale=1/(np.array(zyx_scale) * np.array(optical_transfer_function.shape[-3:])),
)
viewer.dims.order = (0, 1, 2)

Z, Y, X = optical_transfer_function.shape
viewer.dims.current_step = (Z // 2, Y // 2, X // 2)
viewer.dims.order = (2, 0, 1)


def apply_transfer_function(
Expand Down
9 changes: 7 additions & 2 deletions waveorder/models/phase_thick_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ def visualize_transfer_function(
name=array[1],
colormap="bwr",
contrast_limits=(-lim, lim),
scale=1 / zyx_scale,
scale=1
/ (np.array(zyx_scale) * np.array(real_potential_transfer_function.shape[-3:])),
)
viewer.dims.order = (0, 1, 2)
Z, Y, X = real_potential_transfer_function.shape
viewer.dims.current_step = (Z // 2, Y // 2, X // 2)
viewer.dims.order = (2, 0, 1)




def apply_transfer_function(
Expand Down

0 comments on commit 96d8b85

Please sign in to comment.