diff --git a/recOrder/compute/reconstructions.py b/recOrder/compute/reconstructions.py index 6e5ff73e..06167ddf 100644 --- a/recOrder/compute/reconstructions.py +++ b/recOrder/compute/reconstructions.py @@ -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(