Skip to content

Commit f30fc92

Browse files
committed
fix: allow --files usage without infotoids
1 parent 266de4a commit f30fc92

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

heudiconv/parser.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,18 @@ def get_study_sessions(dicom_dir_template, files_opt, heuristic, outdir,
168168
grouping=grouping)
169169

170170
if not getattr(heuristic, 'infotoids', None):
171-
raise NotImplementedError(
172-
"For now, if no subj template is provided, requiring "
173-
"heuristic to have infotoids")
171+
lgr.warn("Heuristic is missing an `infotoids` method, assigning "
172+
"empty method. For best results, define an `infotoids`")
173+
def infotoids(seqinfos, outdir):
174+
return {
175+
'locator': None,
176+
'session': None,
177+
'subject': None
178+
}
179+
heuristic.infotoids = infotoids
180+
# raise NotImplementedError(
181+
# "For now, if no subj template is provided, requiring "
182+
# "heuristic to have infotoids")
174183

175184
if sids:
176185
if not (len(sids) == 1 and len(seqinfo_dict) == 1):

0 commit comments

Comments
 (0)