mehta-lab / waveorder

Wave optical models and inverse algorithms for label-agnostic imaging of density & orientation.
BSD 3-Clause "New" or "Revised" License
15 stars 4 forks source link

Add rotate and flip orientation options to `waveorder` options #148

Closed talonchandler closed 1 year ago

talonchandler commented 1 year ago

In recOrder #248 we added an orientation offset checkbox to recOrder's GUI.

This PR is a first step towards moving this logic to waveorder so that these options are more easily available.

I've also added a flip option so that all combinations are covered. Following this merge, I will remove the business logic from recOrder, add another button to the recOrder GUI, then connect the rotation and flip buttons to the waveorder side.

talonchandler commented 1 year ago

I updated the names of these options to:

orientation_rotate -> rotate_orientation orientation_flip -> flip_orientation axial_flip -> invert_phase_contrast

I am about to open a WIP PR on recOrder that will depend on these changes.

edyoshikun commented 1 year ago

I wasn't getting the results I was expecting by adding the inverse_phase_contrast parameter to the examples/model/phase_thick_3d.py

transfer_function_arguments = {
    "z_padding": 0,
    "numerical_aperture_illumination": 0.9,
    "numerical_aperture_detection": 1.2,
    "invert_phase_contrast": True,
}

When I look at the reconstructions and the steps in between , I was expecting that the transfer function was flipped and that the output had the inverse contrast as well. Here, reconstruction_2 refers to theinvert_phase_contrast=false. I want to make sure I was testing this appropriately.

Screenshot 2023-08-14 at 10 12 20 AM
talonchandler commented 1 year ago

Thanks @edyoshikun and @ziw-liu.

For documentation purposes: @edyoshikun's question above was related to a misunderstanding about how the invert_phase_contrast parameter works. If you use invert_phase_contrast when calculating the transfer function, that transfer function will simulate and reconstruct as if the data were collected with the opposite z stage order. If you do both a simulation and a reconstruction, then the inversion will cancel and you'll get the same reconstruction with or without invert_phase_contrast.

We decided to keep the current design because the typical user will only be using the reconstruction, and expert users who need both simulations and reconstructions will not use the invert_phase_contrast.