-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update stream branch #70
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- self.optical_info == volume_in.optical_info is no longer always true - need method to visualize reconstructed volume - all tests pass
- done for numpy, need to modify torch
Dataset creation
Fixes Non-matching device for dot product operation #58
There was an error with the nticks of the plotly. So I created an option to disable the nticks parameter of the scene layout. For the plotting, the optic axis should be normalized first. I added download buttons for the estimated images and button. Use of the gpu should be made optional, even if it is available. More operations in the reconstruction process should be turned into their own function. All tests pass.
Update streamlit reconstruction page
I created modular versions of the main forward and reconstuction scripts. The common functions in the scripts should be moved to a new script. I replaced the colormap of the orientation images with a cyclic colormap. Birefringence implementations: I added a normalized option. In the Jones calculus, the projection of the ray onto the optic axis is normalized. I improved the method of initializing volumes. I redefined how the ellisoid is created. It is not the substraction of two ellisoids of slightly different radii. I added a Jones calculus pytorch implementation to account for the affect of negative birefringence on the azimuth image. The slow axis should be rotated 90 degrees when the sign of the birefringence is flipped. Pytest updates: I created a test to verify the physics affects of having opposite sign on the birefringence. I added basic BirefringentVolume tests. I removed the depreciated torch.set_default_tensor_type() function. To check the the gradients were not broken, I increased the volume size to make it be more likely that the volume contained nonzero birefringence and verified that the gradients are not None instead of not being zero. The new ellipsoid volume was causing the test to otherwise fail. A test should be created to verify that the optimizer does not update the values to be NaNs, and that is why the updated volume is not the same as the initial volume. All tests pass.
Optical and reconstruction parameters can now be input into the function from JSON files. Similarly, the birefringence volume initiation arguments are stored in a python file. All tests pass.
I made the Reconstructor class more modular. I wrote visualization functions that get imported. In the BirefringentVolume class, I created a method to load a volume from a h5 file. It needs improvement. The idea is that the method will serve an alternative to the init_from_file method that does not depend on optical_info. In plotting_tools.py, I removed more of the waveblocks leftover dependency. All tests pass.
Configuration files are now in their own directory. Functions in plotting_tools.py were moved into scripts in the visualization subdirectory of VolumeRaytraceLFM. All tests pass.
All tests pass
Run on the GPU, if available, using the function recon_gpu() in run_recon.py. Also added a .gitattributes file to make the jupyter notebook not appear as the dominate language on GitHub. All tests pass.
Adjusted how the reachable volume mask is calculated to include the lateral reach of the rays. Added a utils function to assess the size of a mask. Prevented forward project image from popping up and preventing the reconstruction process from continuing. Sometimes the windows still pops up in debug mode. All tests pass.
In the reconstruction class, self.restrict_volume_to_reachable_region() can be called to crop the volume to only the region that the rays can reach. Careful, because sometimes the volume is still not large enough for the MLA. All tests pass.
Loss function modularity beginning
Added simulated images to test the reconstruction process. Currently, the new function are not in use within the Reconstructor class. This can be changed by replacing 'False' with 'True'. All tests pass.
The forward model can now be based on a new Delta_n variable. This variable can be a torch concatenation of two torch arrays, one with gradients and one not. A similar approach should be done for optic_axis. To use, change OPTIMIZING_MODE to True at the top of birefringence_implementations.py. All tests pass.
I explained the steps involved in some processes using a pytorch backend. I also modularized the method ray_trace_through_volume() for clarity purposes. All tests pass.
Moved the Jones Calculus implementation to their own script. To avoid circular dependencies, I moved BirefringentElement to its own script too. All tests pass.
I created the class VolumeFileManager to include the functionality of creating and saving birefringent volumes. Tests were created for the new class methods.
Refactor birefringence implementations module
- added descriptions to saved volumes - added polarizer and analyzer spots
Created new pages to begin ForwardModel and Reconstructor class usages. There is now a streamlit optional argument in the Reconstructor class. Also, the displayed azimuth image is now masked to the measured retardance image.
Reduce main module count
Github actions did not pass. An alternative solution would be to add pandas to requirements.txt.
Allows pytest to pass on github actions
Adjust package import placement
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.