mehta-lab / waveorder

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

Phase 2D + 3D refactor #117

Closed talonchandler closed 1 year ago

talonchandler commented 1 year ago

This PR makes the following changes to the "Phase2D" and "Phase3D" reconstructions methods:

I suggest starting your review by running the new examples scripts in /examples/PODT_Phase_simulation/. This will demonstrate a simplified form of what I expect on the recOrder side: the TF is calculated (and optionally viewed in napari), saved to a file, then used to reconstruct the data.

Next, I suggest you take a look at the (currently under-documented but hopefully much clearer than before) function signatures for calculate_transfer_function and apply_inverge_transfer_function in models/phase2D_3D.py and models/phase3D_3D.py. These function signatures have a nearly direct correspondence with recOrder's GUI parameters.

Finally, I'll request your thoughts on my models format that arose naturally during my refactor. I've temporarily named the three models after our assumption about the sample (phase2D,phase3D, planaranisoND) and the data we acquire (3D, polND). To my eye, this seems to be an extensible way to split up the code since different assumptions about the object and/or different data will lead to different models (and code). I'm also very aware that this could be a good application for an abstract base class (especially since I expect to implement calculate_transfer_function and apply_inverse_transfer_function methods for planaranisoND_polND), but I've chosen to delay this for now in fear of premature abstraction.

I'm happy to chat in person anytime tomorrow. My immediate focus is on the interface for the "Retardance + Orientation" pipeline which I expect to require about 3/4 of my day tomorrow. After that PR, I am planning to start working on the recOrder CLI side and link everything up.

talonchandler commented 1 year ago

Thanks for the contributions and in-person chat @mattersoflight. I've made the following changes:

talonchandler commented 1 year ago

Merging into alg-dev...we can discuss more when I open a PR into main