Skip to content

Commit

Permalink
specify the parameters used and test
Browse files Browse the repository at this point in the history
  • Loading branch information
ziw-liu committed Jan 5, 2024
1 parent bbd3ddb commit 3b7f502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/models/test_inplane_oriented_thick_pol3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ def test_calculate_transfer_function():


@pytest.mark.parametrize(*_DEVICE)
def test_apply_inverse_transfer_function(device):
input_shape = (5, 10, 5, 5)
@pytest.mark.parametrize("estimate_bg", [True, False])
def test_apply_inverse_transfer_function(device, estimate_bg):
input_shape = (5, 10, 100, 100)
czyx_data = torch.rand(input_shape, device=device)

intensity_to_stokes_matrix = (
Expand All @@ -31,6 +32,7 @@ def test_apply_inverse_transfer_function(device):
results = inplane_oriented_thick_pol3d.apply_inverse_transfer_function(
czyx_data=czyx_data,
intensity_to_stokes_matrix=intensity_to_stokes_matrix,
remove_estimated_background=estimate_bg,
)

assert len(results) == 4
Expand Down
4 changes: 3 additions & 1 deletion waveorder/models/inplane_oriented_thick_pol3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def apply_inverse_transfer_function(
# Estimate the background and subtract
background_corrected_stokes[
stokes_index
] -= correction.estimate_background(z_projection, normalize=False)
] -= correction.estimate_background(
z_projection, order=2, block_size=32
)

# Project to 2D (typically for SNR reasons)
if project_stokes_to_2d:
Expand Down

0 comments on commit 3b7f502

Please sign in to comment.