-
Notifications
You must be signed in to change notification settings - Fork 4
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
MDR #183
base: dev
Are you sure you want to change the base?
MDR #183
Conversation
Hello @JSousa-UoL, thank you for updating! Cheers! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated at 2022-04-20 12:21:15 UTC |
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 haven't gone through with a fine tooth comb and done line by line comments (apart from the bits I noticed when testing) but rather just reviewed the overall structure so far.
Notebooks
- I think it would be better to just have a single MDR notebook, the part you're demonstrating is the motion correction, the fact its being used for different measurements is incidental. You could still keep both a T1 and diffusion example, just in a single
motion_correction
notebook. - Might be nice to include difference images to highlight the effect moco has had.
MOCO Module
- General structure seems fine. Obviously documentation is lacking at the moment.
- It was really handy that in the T1 mapping moco notebook, the fitted and coregistered images were output with time along dimension three so you could quickly see the effect moco was having on each slice (example below). It might just be that it works well for my workflow, do you think it would be useful to have a flag in the
to_nifti
method that swaps dimensions 3 and 4 so you can see slices through time easily on all data rather than just 2D data? Might also be worth adding a similar figure to the notebook.
- Why is there no get_log method?
- If you're expecting people to retrieve things like
fitted
with getters thenself.mdr_results
etc should be the python version of private variables i.e.self._mdr_results
Tests
- I understand why you've only done tests for diffusion. Just thinking of ways to remedy this without making the test runtime silly, how does the runtime of the MDR package scale with a. image size and b. how much motion there is in the image and c. the number of time points/b-vals its registering? All these could perhaps be controlled a bit more by using simulated data rather than real data. I started working on an in-silico phantom module for nephtools at one point. I'm not necessarily suggesting we add this to ukat, but I could generate some low resolution simulated diffusion and T1 data that's corrupted by a defined amount of motion and save that as a nifti. That way a. the tests would run quicker, b. you could test both DWI and T1 moco and c. we would know what the gold standard, uncorrupted, data should have been like. Just an idea.
- I think the
registration.run()
step should be in the setup (start of the class) rather than a function within it as most other tests rely on the results of this. - I assume theres still some work to do on the actual tests as theres still a lot of
assert 1==1
and expected values that are empty lists.
Thank you so much for your feedback @alexdaniel654. I will take into account your comments about the Notebooks and Tests. Regarding the MOCO Module section:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #183 +/- ##
==========================================
- Coverage 97.92% 97.57% -0.36%
==========================================
Files 39 45 +6
Lines 3513 4036 +523
==========================================
+ Hits 3440 3938 +498
- Misses 73 98 +25 ☔ View full report in Codecov by Sentry. |
This PR will close issue #164.
This draft PR doesn't contain docstrings (some place holders).
The purpose is to discuss code structure and think of smarter ways to do unit testing. Please ignore PEP8 and other minor issues for now, I'd like to hear higher level feedback at this stage.