|
95 | 95 | } |
96 | 96 | } |
97 | 97 | ] |
| 98 | + }, |
| 99 | + { |
| 100 | + "session": "04", |
| 101 | + "anat": [{"suffix": "T1w", "metadata": {"EchoTime": 1}}], |
| 102 | + "fmap": [ |
| 103 | + {"suffix": "epi", "dir": "AP", "metadata": { |
| 104 | + "EchoTime": 1.2, |
| 105 | + "PhaseEncodingDirection": "j-", |
| 106 | + "TotalReadoutTime": 0.8, |
| 107 | + "IntendedFor": [ |
| 108 | + "ses-04/func/sub-01_ses-04_task-rest_run-1_bold.nii.gz", |
| 109 | + "ses-04/func/sub-01_ses-04_task-rest_run-2_bold.nii.gz", |
| 110 | + ], |
| 111 | + }}, |
| 112 | + ], |
| 113 | + "func": [ |
| 114 | + { |
| 115 | + "task": "rest", |
| 116 | + "run": 1, |
| 117 | + "suffix": "bold", |
| 118 | + "metadata": { |
| 119 | + "RepetitionTime": 0.8, |
| 120 | + "TotalReadoutTime": 0.5, |
| 121 | + "PhaseEncodingDirection": "j" |
| 122 | + } |
| 123 | + }, |
| 124 | + { |
| 125 | + "task": "rest", |
| 126 | + "run": 2, |
| 127 | + "suffix": "bold", |
| 128 | + "metadata": { |
| 129 | + "RepetitionTime": 0.8, |
| 130 | + "TotalReadoutTime": 0.5, |
| 131 | + "PhaseEncodingDirection": "j" |
| 132 | + } |
| 133 | + }, |
| 134 | + ] |
98 | 135 | } |
99 | 136 | ] |
100 | 137 | } |
@@ -216,3 +253,20 @@ def test_wrangler_filter(tmpdir, name, skeleton, estimations): |
216 | 253 | est = find_estimators(layout=layout, subject='01', bids_filters=filters['fmap']) |
217 | 254 | assert len(est) == estimations |
218 | 255 | clear_registry() |
| 256 | + |
| 257 | + |
| 258 | +def test_single_reverse_pedir(tmp_path): |
| 259 | + bids_dir = tmp_path / "bids" |
| 260 | + generate_bids_skeleton(bids_dir, pepolar) |
| 261 | + layout = gen_layout(bids_dir) |
| 262 | + est = find_estimators(layout=layout, subject='01', bids_filters={'session': '04'}) |
| 263 | + assert len(est) == 2 |
| 264 | + subject_root = bids_dir / 'sub-01' |
| 265 | + for estimator in est: |
| 266 | + assert len(estimator.sources) == 2 |
| 267 | + epi, bold = estimator.sources |
| 268 | + # Just checking order |
| 269 | + assert epi.entities['fmap'] == 'epi' |
| 270 | + # IntendedFor is a list of strings |
| 271 | + # REGRESSION: The result was a PyBIDS BIDSFile (fmriprep#3020) |
| 272 | + assert epi.metadata['IntendedFor'] == [str(bold.path.relative_to(subject_root))] |
0 commit comments