Skip to content
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

Drop functions to read sidecar JSONs #760

Merged
merged 11 commits into from
Jul 13, 2024

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Jun 4, 2024

Closes #759.

Changes proposed in this pull request

  • Remove qsiprep.interfaces.bids.ReadSidecarJSON (this was actually unused, as the interface that was used in init_phdiff_wf was the one imported from niworkflows).
  • Remove qsiprep.interfaces.bids.get_metadata_for_nifti in favor of config.execution.layout.get_metadata.
  • Remove niworkflows's ReadSidecarJSON calls in favor of config.execution.layout.get_metadata.
  • Add phase_meta input to init_phdiff_wf. This actually matches the SDCFlows workflow a bit better as an added bonus.

@tsalo tsalo added the refactor Changes to the codebase that don't impact workflow inputs or outputs. label Jun 4, 2024
@tsalo
Copy link
Member Author

tsalo commented Jun 4, 2024

I haven't removed read_nifti_sidecar, which is a big barrier to using the inheritance principle in DWI datasets.

@@ -115,7 +114,9 @@ def init_merge_and_denoise_wf(
bids_dwi_files=raw_dwi_files,
b0_threshold=config.workflow.b0_threshold,
harmonize_b0_intensities=not config.workflow.no_b0_harmonization,
scan_metadata={scan: get_metadata_for_nifti(scan) for scan in raw_dwi_files},
scan_metadata={
scan: config.execution.layout.get_metadata(scan) for scan in raw_dwi_files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue is that read_nifti_sidecar is still used in places. It looks like there are a few interfaces/functions (get_distortion_grouping and get_best_b0_topup_inputs_from) that use read_nifti_sidecar and do some complicated stuff, so I didn't try to remove it.

@mattcieslak
Copy link
Collaborator

The readthedocs error is very strange, I don't think this PR changes anything in extras_require

@tsalo
Copy link
Member Author

tsalo commented Jun 24, 2024

No, but I'm seeing the same failure in #766. I think it might be an issue with DiPy.

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 29.84%. Comparing base (db15b6d) to head (6cf13ac).
Report is 1 commits behind head on master.

Files Patch % Lines
qsiprep/workflows/fieldmap/base.py 0.00% 2 Missing ⚠️
qsiprep/workflows/fieldmap/phdiff.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #760      +/-   ##
==========================================
+ Coverage   29.76%   29.84%   +0.07%     
==========================================
  Files          97       97              
  Lines       14586    14604      +18     
  Branches     1887     1885       -2     
==========================================
+ Hits         4342     4359      +17     
+ Misses      10118    10117       -1     
- Partials      126      128       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattcieslak
Copy link
Collaborator

I think this will work, but I'm wondering if we should hold off on major refactors until we add a couple more CI tests (like for GRE fieldmaps). Wdyt?

@tsalo
Copy link
Member Author

tsalo commented Jul 12, 2024

I'm happy to wait on it.

@mattcieslak mattcieslak merged commit fb0d03d into PennLINC:master Jul 13, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Changes to the codebase that don't impact workflow inputs or outputs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ReadSidecarJSON and get_metadata_for_nifti
3 participants