Skip to content
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

FFT + Time Reversal Reconstruction #475

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

faberno
Copy link
Contributor

@faberno faberno commented Sep 19, 2024

This PR implements the FFT reconstructions (kspaceLineRecon, kspacePlaneRecon) and fixes Time Reversal.

Added examples:

  • pr_2D_FFT_line_sensor
  • pr_3D_FFT_plane_sensor
  • pr_2D_TR_line_sensor
  • pr_3D_TR_planar_sensor

This PR is just a draft and not ready for review yet!

TODO:

  • Align style of examples
  • Add Notebooks + Colab
  • Add documentation
  • Add tests

- added FFT reconstruction
- added reconstruction examples
@waltsims
Copy link
Owner

Hey @faberno,

just pining you on this. Is this something you would like to continue to work on?

Best,
Walter

@faberno
Copy link
Contributor Author

faberno commented Oct 23, 2024

Hey @waltsims,

sorry for the inactivity, next week I will have time to continue it :)

Best,
Fabian

@waltsims
Copy link
Owner

No rush, just checking in.

@faberno
Copy link
Contributor Author

faberno commented Nov 8, 2024

Hey @waltsims,
could you review my changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this PML cropping section to the run_simulation function, to have access to the simulation_options. Would you prefer it in the parse_executable_output? (At least, thats where you added an outcommented version of this.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also right now this change breaks the executor test, I will update it when the code is final.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great if you could make this a private subfunction _remove_pml(...) and place it in parse_executable output for now. That will make future refactoring easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I just have the problem, that if _remove_pml(...) is inside parse_executable_output I can't test anymore if the pml is removed on the mock_dict (see: test_sensor_data_cropping_with_pml_outside), because the whole parse_executable_output is patched.

If I create a second private subfunction in parse_executable_output called _load_sensor_data, is there a way to only patch this instead? I didn't find a way to do this.

Or do you see another workaround? :D

@waltsims
Copy link
Owner

waltsims commented Nov 8, 2024

Hey @faberno

Thanks for this work! Before I review your changes, can you make sure your PR passed the CI? It looks like there are some failing tests. Also please be sure to install precommit to ensure your PR is properly formatted.

- adapt executor tests
- removed unused voxel_plot in 3D_FFT example
@faberno faberno marked this pull request as ready for review November 11, 2024 14:24
@faberno
Copy link
Contributor Author

faberno commented Nov 11, 2024

Hey @waltsims,
right now I left out the voxel_plot in the pr_3D_FFT_planar_sensor example, because I think there is a bug in voxel_plot (#501).

I had to slightly adapt the executor tests, but I'm not very familiar with mock tests. I hope it looks alright.

@waltsims waltsims linked an issue Nov 12, 2024 that may be closed by this pull request
@waltsims
Copy link
Owner

Hey @faberno,

Thanks again for the PR. I'll have a look at this this weekend.

Copy link
Owner

@waltsims waltsims left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great examples. Minor comment. Do you still want to add further tests?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great if you could make this a private subfunction _remove_pml(...) and place it in parse_executable output for now. That will make future refactoring easier.

@waltsims
Copy link
Owner

Please resolve the conflict in the tests and we can merge this in unless you would like to make further changes.

@faberno
Copy link
Contributor Author

faberno commented Nov 28, 2024

Are there any more tests you would like to have? Otherwise it's fine for me

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.12%. Comparing base (96a267d) to head (3e09e97).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
+ Coverage   72.83%   73.12%   +0.28%     
==========================================
  Files          46       46              
  Lines        6789     6816      +27     
  Branches     1305     1309       +4     
==========================================
+ Hits         4945     4984      +39     
+ Misses       1287     1278       -9     
+ Partials      557      554       -3     
Flag Coverage Δ
3.10 73.12% <100.00%> (+0.28%) ⬆️
3.11 73.12% <100.00%> (+0.28%) ⬆️
3.12 73.12% <100.00%> (+0.28%) ⬆️
3.13 73.12% <100.00%> (+0.28%) ⬆️
macos-latest 73.09% <100.00%> (+0.28%) ⬆️
ubuntu-latest 73.09% <100.00%> (+0.28%) ⬆️
windows-latest 73.09% <100.00%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@faberno
Copy link
Contributor Author

faberno commented Nov 28, 2024

Hey @waltsims,

I added a last test for the coverage. I also made the _remove_pml(...) function a normal member function of Executor (instead of a subfunction in parse_executable output), to still be able to test the cropping. If thats alright for you, everything should be ready :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time reversal example
2 participants