Skip to content

Commit cb2fd91

Browse files
authored
Merge pull request #546 from dbic/adds_populate_intended_for
ENH: specify POPULATE_INTENDED_FOR_OPTS within reproin following the doc
2 parents e747f05 + e76750a commit cb2fd91

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@
199199
"TODO: adjust to your case.",
200200
}
201201

202+
POPULATE_INTENDED_FOR_OPTS = {
203+
'matching_parameters': ['ImagingVolume', 'Shims'],
204+
'criterion': 'Closest'
205+
}
202206

203207
def _delete_chars(from_str, deletechars):
204208
""" Delete characters from string allowing for Python 2 / 3 difference

heudiconv/tests/test_convert.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,14 @@ def mock_populate_intended_for(session, matching_parameters='Shims', criterion='
229229
output = capfd.readouterr()
230230
# if the heuristic module has a 'POPULATE_INTENDED_FOR_OPTS' field, we expect
231231
# to get the output of the mock_populate_intended_for, otherwise, no output:
232-
if getattr(heuristic, 'POPULATE_INTENDED_FOR_OPTS', None):
232+
pif_cfg = getattr(heuristic, 'POPULATE_INTENDED_FOR_OPTS', None)
233+
if pif_cfg:
233234
assert all([
234235
"\n".join([
235236
"session: " + outfolder.format(sID=s, ses=sesID),
236237
# "ImagingVolume" is defined in heuristic file; "Shims" is the default
237-
"matching_parameters: " + "ImagingVolume",
238-
"criterion: Closest"
238+
f"matching_parameters: {pif_cfg['matching_parameters']}",
239+
f"criterion: {pif_cfg['criterion']}"
239240
]) in output.out
240241
for s in subjects
241242
])

0 commit comments

Comments
 (0)