Skip to content

Commit

Permalink
remove transpose+copy
Browse files Browse the repository at this point in the history
  • Loading branch information
talonchandler committed Feb 28, 2023
1 parent 5d56b29 commit 1fb6ee5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions recOrder/compute/reconstructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,21 +321,10 @@ def reconstruct_qlipp_birefringence(stokes, recon):
volume of shape (C, Z, Y, X) or (C, Y, X) containing reconstructed birefringence data.
"""

if stokes.ndim == 4:
stokes = np.transpose(stokes, (0, 2, 3, 1))
elif stokes.ndim == 3:
pass
else:
if stokes.ndim != 4 and stokes.ndim != 3:
raise ValueError(f"Incompatible stokes dimension: {stokes.shape}")

birefringence = recon.Polarization_recon(np.copy(stokes))

# Return the transposed birefringence array with channel first
return (
np.transpose(birefringence, (-4, -1, -3, -2))
if len(birefringence.shape) == 4
else birefringence
)
return recon.Polarization_recon(stokes)


def reconstruct_phase2D(
Expand Down

0 comments on commit 1fb6ee5

Please sign in to comment.