Skip to content

Commit 9825d92

Browse files
author
Jörg Stadler
committed
fix for Philips
1 parent 8cdf06d commit 9825d92

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

heudiconv/heuristics/reproin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,15 @@ def ls(study_session, seqinfo):
426426
# So we just need subdir and file_suffix!
427427
def infotodict(seqinfo):
428428
"""Heuristic evaluator for determining which runs belong where
429-
430-
allowed template fields - follow python string module:
431-
429+
430+
allowed template fields - follow python string module:
431+
432432
item: index within category
433433
subject: participant id
434434
seqitem: run number during scanning
435435
subindex: sub index within group
436436
session: scan index for longitudinal acq
437437
"""
438-
439438
seqinfo = fix_seqinfo(seqinfo)
440439
lgr.info("Processing %d seqinfo entries", len(seqinfo))
441440
and_dicom = ('dicom', 'nii.gz')
@@ -841,6 +840,7 @@ def parse_series_spec(series_spec):
841840
# https://github.com/ReproNim/reproin/issues/14
842841
# where PU: prefix is added by the scanner
843842
series_spec = re.sub("^[A-Z]*:", "", series_spec)
843+
series_spec = re.sub("^WIP ", "", series_spec) # remove Philips WIP prefix
844844

845845
# Remove possible suffix we don't care about after __
846846
series_spec = series_spec.split('__', 1)[0]
@@ -889,6 +889,7 @@ def split2(s):
889889
# sanitize values, which must not have _ and - is undesirable ATM as well
890890
# TODO: BIDSv2.0 -- allows "-" so replace with it instead
891891
value = str(value).replace('_', 'X').replace('-', 'X')
892+
value = str(value).replace('(', '{').replace(')', '}') # for Philips
892893

893894
if key in ['ses', 'run', 'task', 'acq']:
894895
# those we care about explicitly

0 commit comments

Comments
 (0)