PolarizedLightFieldMicroscopy / BirTomo

Geometrical Birefringence Tomography
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Retardance above pi #17

Open gschlafly opened 1 year ago

gschlafly commented 1 year ago

Need to check if calculation and interpretation is appropriate

pvjosue commented 1 year ago
image

High retardance that goes over 2*pi

gschlafly commented 1 year ago

Retardance is high for a shell with pytorch and numpy backends. image

gschlafly commented 1 year ago

Adjusted the creation of the ellipsoid/shell so that the birefringence values were not overwritten by the mask: vol[0,...] = vol[0,...] * combined_mask.astype(float)

image However, the retardance still should not be able to go above $\pi$ even with a highly birefringent object.

gschlafly commented 4 months ago

The retardance function should only output values between $0$ and $\pi$: https://github.com/PolarizedLightFieldMicroscopy/GeoBirT/blob/ac9075d681375ebd2d64a9635217e086eeca5dd7/src/VolumeRaytraceLFM/jones/eigenanalysis.py#L65-L68 Thus, the angle calculation should only output values between $0$ and $\pi/2$: https://github.com/PolarizedLightFieldMicroscopy/GeoBirT/blob/ac9075d681375ebd2d64a9635217e086eeca5dd7/src/VolumeRaytraceLFM/jones/eigenanalysis.py#L5-L21 Consequently, the real part of $a$ should be nonnegative.

To Do

gschlafly commented 4 months ago

The real part of the first element of the jones matrix, $a$, is the cosine of the accumulated retardance. The retardance is positive. So the negative real component of $a$ is introduced from the product of the jones matrices.

gschlafly commented 4 months ago

The phase wrapping effect should be accounted for in the final step of calculating the retardance from a jones matrix.

# Calculate the phase differences (retardance)
retardance = np.angle(eigenvalues[0]) - np.angle(eigenvalues[1])

# Normalize the phase difference to [0, 2*pi) and assure values are positive
retardance = (retardance + 2 * np.pi) % (2 * np.pi)

# Wrap the phase difference to [0, pi]
if retardance > np.pi:
    retardance = 2 * np.pi - retardance