-
Notifications
You must be signed in to change notification settings - Fork 60
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
Migrate code from aodf-toolkit #925
Conversation
Hello @CHrlS98, Thank you for updating ! There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-03-13 18:01:21 UTC |
There was a bug in the previous bilateral filter implementation, rendering test data unsuitable for testing the fixed script. I fixed the tests, they run locally. Here is the new test data: fodf_filtering.zip. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #925 +/- ##
==========================================
- Coverage 66.82% 66.63% -0.20%
==========================================
Files 392 392
Lines 20977 21094 +117
Branches 3207 3237 +30
==========================================
+ Hits 14017 14055 +38
- Misses 5658 5719 +61
- Partials 1302 1320 +18
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want very quickly over the bits of code I understood. I had e few questions but outside of that it looks good from my very limited knowledge of the subject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Phil, I can't really read the science, nor the .cl files. But everything seams clear and well documented. I didn't see any obvious bug. Some small suggestions.
return w | ||
|
||
|
||
def _get_sf_range(sh_data, B_mat): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arnaud, should this kind of small method go in, say, reconst.utils or something like this? Or, considering that it's only used here, keeping it here with a _ is fine?
@@ -6,420 +6,420 @@ | |||
# in the FiberCup. Order 8, descoteaux07 basis. | |||
fodf_3x3_order8_descoteaux07 = np.asarray([[[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same data as in the verifications in scil_sh_to_aodf? Are you doing twice the same test, once as unit test and once in the scripts tests? If so, the unit test could be removed if you wish, and you just add a comment to see the script test. If different, could you still add a comment in the unit test to reference to the script test and explain the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this data is only used in the unit tests while the script test uses a nifti image and tests the script input/output. I'll add a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant: did you open the nifti to see its values and copy them here? Or they are entirely other values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entirely other values, they are from the fibercup while the nifti is a whole brain dataset.
Quick description
This PR is a replacement for pull request #722 . Migrate code from https://github.com/CHrlS98/aodf-toolkit. Changes mostly apply to script
scil_sh_to_aodf.py
and replaces thebilateral
method by theunified
method implemented inaodf-toolkit
and described in https://doi.org/10.1016/j.neuroimage.2024.120516. I also added a 100% python implementation of the method which I plan to add in DIPY at some point.As you may know, opencl programs can not only run on GPU hardware, but also on CPU. So now there is an
--use_opencl
for using OpenCL as well as an option--device
allowing you to choose betweencpu
andgpu
. I don't know if it is the best way to do it as running on GPU requires that--use_opencl
and--device gpu
are manually set. By default the code will run on the CPU and won't use OpenCL.I also updated the
opencl_utils
module and modified theGPUTracker
to work with the new interface.Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
Checklist