Skip to content

Commit 3ed14f6

Browse files
committed
RF/BF(?): do not mark as motion corrected based on seriesdescription
Since it is not necessarily the case. Decision should be made solely based on the image_type
1 parent 20beacb commit 3ed14f6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bin/heudiconv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,7 @@ def group_dicoms_into_seqinfos(
527527
refphys = '-'
528528

529529
image_type = tuple(dcminfo.ImageType)
530-
motion_corrected = 'MoCo' in dcminfo.SeriesDescription \
531-
or 'MOCO' in image_type
530+
motion_corrected = 'MOCO' in image_type
532531

533532
if dcminfo.get([0x18,0x24], None):
534533
# GE and Philips scanners

heuristics/dbic_bids.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ def infotodict(seqinfo):
309309
image_data_type = None
310310
for s in seqinfo:
311311
# XXX: skip derived sequences, we don't store them to avoid polluting
312-
# the directory
313-
if s.is_derived:
312+
# the directory, unless it is the motion corrected ones
313+
# (will get _rec-moco suffix)
314+
if s.is_derived and not s.is_motion_corrected:
314315
skipped.append(s.series_id)
315316
lgr.debug("Ignoring derived data %s", s.series_id)
316317
continue
@@ -435,6 +436,9 @@ def infotodict(seqinfo):
435436
# if there is no _run -- no run label addded
436437
run_label = None
437438

439+
if s.is_motion_corrected:
440+
assert s.is_derived, "Motion corrected images must be 'derived'"
441+
438442
if s.is_motion_corrected and 'rec-' in regd.get('bids', ''):
439443
raise NotImplementedError("want to add _acq-moco but there is _acq- already")
440444

0 commit comments

Comments
 (0)