Skip to content

Bug fix: fix loading image name containing dots bug #1249

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

Conversation

ybouilla
Copy link
Contributor

PR description
Fixes and closes #1105 .

Provides a fix and unit test

Nota: bug fix may not be complete, because if an image has not the correct extension, loading it in Fed-BioMed MedicalFolderDataset will still fail.

Developer Certificate Of Origin (DCO)

By opening this merge request, you agree to the
Developer Certificate of Origin (DCO)

This DCO essentially means that:

  • you offer the changes under the same license agreement as the project, and
  • you have the right to do that,
  • you did not steal somebody else’s work.

License

Project code files should begin with these comment lines to help trace their origin:

# This file is originally part of Fed-BioMed
# SPDX-License-Identifier: Apache-2.0

Code files can be reused from another project with a compatible non-contaminating license.
They shall retain the original license and copyright mentions.
The CREDIT.md file and credit/ directory shall be completed and updated accordingly.

Guidelines for PR review

General:

Specific to some cases:

  • update all conda envs consistently (development and vpn, Linux and MacOS)
  • if modified researcher (eg new attributes in classes) check if breakpoint needs update (breakpoint/load_breakpoint in Experiment(), save_state_breakpoint/load_state_breakpoint in aggregators, strategies, secagg, etc.)
  • if modified a component with versioning (config files, breakpoint, messaging protocol) then update the version following the rules in common/utils/_versions.py

…n issue #1105

Details:
This bug is raised if the image name contains dots( eg '1.345.234.nii` will fail).
 This is due to how nifti images are detected in the code of medical folder
…ts (`.`)

Details:
Previous behaviour was that the extension was captured when the first dot in th>
name of the file was found.
Now, with the bug fix, it Only checks the ending of the string, and compares it
to allowed extension.
@ybouilla ybouilla requested a review from srcansiz November 21, 2024 15:04
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.44%. Comparing base (78f4543) to head (8f9f5a8).
Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
fedbiomed/common/data/_medical_datasets.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1249      +/-   ##
===========================================
- Coverage    89.25%   88.44%   -0.81%     
===========================================
  Files           96      116      +20     
  Lines        10906    11165     +259     
===========================================
+ Hits          9734     9875     +141     
- Misses        1172     1290     +118     
Flag Coverage Δ
unittests-fedora38 ?
unittests-macos-latest 88.44% <71.42%> (?)
unittests-macos-m1 88.44% <71.42%> (?)
unittests-ubuntu-22-04 ?
unittests-ubuntu-22.04 88.44% <71.42%> (?)
unittests-ubuntu-latest 88.44% <71.42%> (?)

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.

…/1105-fix-loading-image-name-containing-dots-bug
…/1105-fix-loading-image-name-containing-dots-bug
@ybouilla ybouilla force-pushed the feature/1105-fix-loading-image-name-containing-dots-bug branch from 8f9f5a8 to 85c17b2 Compare January 31, 2025 12:50
@ybouilla ybouilla closed this Jan 31, 2025
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.

[BUG]: cannot load a nifti image in the medical folder dataset of Fed-BioMed if it contains dots (.) in its name
1 participant