-
Notifications
You must be signed in to change notification settings - Fork 62
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
Volumes test #942
Volumes test #942
Conversation
Hello @EmmaRenauld, Thank you for updating ! There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-05-06 18:07:34 UTC |
7827048
to
e2a28de
Compare
8670a1c
to
6ba884d
Compare
# Test 2: No background | ||
# In both cases, compares a bunch of 0 with a bunch of 1, should be a | ||
# perfect correlation. | ||
img_data_1 = np.zeros((3, 3, 3)).astype(float) |
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.
Here it wont work with an image full of zeros, because 0 is assume to be background (i.e. no information), to ensure there is no division by zero in np.corrcoef and no resulting NaN we add noise to background.
Therefore the correlation between an image full of zeros and full of ones is very poor (because one is 100% background), an image full of ones and twos would work (no background)
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.
@frheault After doing many tests...
Actually, result of corr is NaN whenever one patch has only the same value everywhere. So instead of adding random values, I managed possible NaN values:
- 0 if at least one neighborhood was entirely containing background
- 1 if the voxel's neighborhoods are uniform in both images
- 0 if the voxel's neighborhoods is uniform in one image, but not the other.
Tell me if that's ok with you.
7797a68
to
52d7cda
Compare
There were failing tests in test_reproducibility_measures. The error is fixed. But while searching for the error, I modified that other test quite a lot, and discovered that origin of SFT had an impact on results. Placed |
46bcae0
to
1f23f87
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #942 +/- ##
==========================================
- Coverage 68.00% 67.85% -0.15%
==========================================
Files 419 419
Lines 21569 21604 +35
Branches 3242 3248 +6
==========================================
- Hits 14668 14660 -8
- Misses 5609 5653 +44
+ Partials 1292 1291 -1
|
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.
A couple of question but will need another reviewer.
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.
Looks good from what I understand...
de42129
to
480449d
Compare
Quick description
New tests for more code coverage, ye!!
Changes:
- Tests: added a test for the correlation method, was missing. Fixes issue Image correlation correct? #940 .
- Methods: Moved sub-method (
def correlate
) out of the loop.-
register_image
: My initials tests failed because my fake images were too small. Took me a long time to figure out. Added a verification.-
compute_snr
: verified if both noise_mask and noise_map were given. Added more explanation.Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
...
Checklist