Conversation
|
I can drop the BIDS-URI tests for now so we at least get these tests in. |
I'll just modify everything so it passes and then we can dig into why the results are the way they are.
| fname: meta.get('PhaseEncodingDirection', 'None') | ||
| fname: meta.get('PhaseEncodingDirection', None) |
There was a problem hiding this comment.
This is potentially a meaningful change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #927 +/- ##
==========================================
+ Coverage 46.02% 46.12% +0.10%
==========================================
Files 65 65
Lines 9764 9764
Branches 1074 1074
==========================================
+ Hits 4494 4504 +10
+ Misses 5044 5036 -8
+ Partials 226 224 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| scan_groups, _ = grouping.group_dwi_scans( | ||
| layout=layout, | ||
| subject_data=subject_data, | ||
| using_fsl=True, |
There was a problem hiding this comment.
@mattcieslak said to remove using_fsl. It's always True(?), so use that.
| using_fsl=True, | ||
| combine_scans=True, | ||
| ignore_fieldmaps=False, | ||
| concatenate_distortion_groups=True, |
There was a problem hiding this comment.
Tied to combine_before_denoising. If True, will concatenate across distortion groups before MP-PCA.
This should be respecting MultipartID (concatenate AP run-01 and AP run-02, but not PA) but isn't.
RPE DWI scans are higher priority for distortion correction than EPI fmaps, so it makes sense that we have selected the rpe_series for SDC.
However, the epi field maps that are collected are not correct. The IntendedFor fields I set should only use the AP EPI for the PA DWI. The PA EPI does not have the PA DWI in its IntendedFor.
There was a problem hiding this comment.
We need to enumerate the possible combinations of metadata fields and what the resulting processing should be. For example, should MultipartID be limited to scans with the same parameters, or can we use it to determine which runs should be concatenated, even across distortion groups?
And if MultipartID should only be applied within distortion groups, then how should users specify which runs should be concatenated?
| generate_bids_skeleton(str(bids_dir), dset_yaml) | ||
| layout = BIDSLayout(str(bids_dir)) | ||
| subject_data = {'dwi': layout.get(suffix='dwi', extension='nii.gz', return_type='file')} | ||
| scan_groups, _ = grouping.group_dwi_scans( |
There was a problem hiding this comment.
We need to add a grouping parameter reflecting if DRBUDDI is used. TOPUP allows various different phase encoding directions (e.g., dir-AP, dir-RL, and dir-SI are a valid combination), but DRBUDDI only allows two reverse-PEDs (dir-AP and dir-PA are solid, but don't throw dir-RL into the mix). This needs to be reflected in the groups.
| 'fieldmap_info': { | ||
| 'epi': [ | ||
| 'sub-01_dir-AP_epi.nii.gz', | ||
| 'sub-01_dir-PA_epi.nii.gz', |
| 'sub-01_dir-AP_run-1_dwi.nii.gz', | ||
| 'sub-01_dir-AP_run-2_dwi.nii.gz', | ||
| ], | ||
| 'suffix': 'rpe_series', |
There was a problem hiding this comment.
Conclusion: Build dictionary around the selected distortion correction suffix, so there's no need for a second dictionary for the AP scans linking to the PA fmap EPI. HOWEVER, we do need to prioritize supporting B0Field* fields in order to give users control over what is chosen.
| ignore_fieldmaps=False, | ||
| concatenate_distortion_groups=False, | ||
| ) | ||
| expected = [ |
There was a problem hiding this comment.
@mattcieslak: This one is clearly an error. Amelie probably used this option recently, and it worked at the time so this might just be weird.
| ] | ||
| check_expected(scan_groups, expected) | ||
|
|
||
| scan_groups, _ = grouping.group_dwi_scans( |
There was a problem hiding this comment.
This is probably what Amelie had.
There was a problem hiding this comment.
Weirdly, using_fsl is hardcoded as True in QSIPrep so 🤷
| subject_data=subject_data, | ||
| using_fsl=True, | ||
| combine_scans=True, | ||
| ignore_fieldmaps=True, |
There was a problem hiding this comment.
This means ignore distortion correction, not just ignore field maps. Should rename, but logic makes sense.
There was a problem hiding this comment.
--ignore fmaps in the CLI apparently ignores all distortion correction, including reverse PED DWI runs. Let's change that!
Closes none.
Changes proposed in this pull request
group_dwi_scansto accept the BIDSLayout as a parameter instead of relying on the config object. This makes it easier to test. Also the nipreps folks only use the config in workflow functions. They tend to pass fields from it into interfaces and utility functions.