Port over solution creation and scaling code (#126)#146
Conversation
This adds the `calc_solution` member from `Protocol` which checks the validity of session targets, setup the simulation scene, beamform the signal, run the simulation, analyze the solution and rescale it. This currently does not perform any segmentation but create a default water volume (with unform isotropic medium), there is an initial implementation for MRI tissue segmentation that will be re-worked in the future.
|
Some tests are failing because of json serialization with |
|
I used internally the MNI template (also used in matlab) but git prevents me to commit it (of course). Ideally we would like to add it in the dvc collection when we will work on the MR segmentation. |
I'll have a look while I review
It's in the dvc collection already -- the dvc collection version of "example_subject" contains the full MNI template volume |
Adding solution_analysis module to improve import architecture.
Json serialization with |
Tests will now run with simulation not enabled to alleviate test runtime.
|
The rest of the tests now are passing. I disabled the simulation to alleviate test runtime, ideally we should enable it but with a reduced parameter set (simulation dt,, time, grid size...). |
|
|
ebrahimebrahim
left a comment
There was a problem hiding this comment.
I gave it a first pass review -- thanks for all this work!
Before we merge also remember:
- Make all commit messages reference an issue number
- Would be good to remove any remaining TODO comments at the end, turning them into github issues if they are meant to be addressed in later work.
This is currently investigated here: https://github.com/OpenwaterHealth/OpenLIFU-python/pull/146/files/edb303cfe76aca36f667701f9678ad17e06f2bb6#r1830285652 |
we keep `example_volume` for reference but it is not used anymore Removed unused SegmentMRI module
…equence. `Protocol.calc_solution` now returns the scaled `SolutionAnalysis`
…rn.units` attribute
Co-authored-by: Ebrahim Ebrahim <ebrahim.ebrahim@kitware.com>
All commits will be squashed into one commit (rebased to main) as previously. I will keep each commit message for reference. |
|
@ebrahimebrahim at this stage it would be also important to test the workflow on the Slicer plugin side. |
Yes I am testing that in my review. If you want to test it yourself from a particular commit then I can build a package and share it with you. Or if you were to build it yourself let me know and I can help with what modifications are needed to get it working. |
ebrahimebrahim
left a comment
There was a problem hiding this comment.
Dropped a couple more comments and replies. Thanks and let me know when I should do another review 😃
Co-authored-by: Ebrahim Ebrahim <ebrahim.ebrahim@kitware.com>
…pecific and verified data
…simplify future tests for `Solution.scale`
|
Code looks great!! Just testing it in the slicer app now, feel free to do your squashing if you want. |
|
On second thought let's enable "squash and merge" for this PR only. I don't. So don't squash it yourself please. I want to maintain the history in this branch here and in this PR. |
ebrahimebrahim
left a comment
There was a problem hiding this comment.
It worked perfectly in SlicerOpenLIFU, I will squash and merge shortly!
This adds the
calc_solutionmember fromProtocolwhich checks the validity of session targets, setup the simulation scene, beamform the signal, run the simulation, analyze the solution and rescale it.This currently does not perform any segmentation but create a default water volume (with unform isotropic medium), there is an initial implementation for MRI tissue segmentation that will be re-worked in the future.