Skip to content

Commit 31e5109

Browse files
authored
Merge pull request #66 from leej3/sequence_names
Add sequence name to metadata extracted for heuristics
2 parents 778723c + d7bc5c2 commit 31e5109

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bin/heudiconv

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ SeqInfo = namedtuple(
103103
'study_description',
104104
'referring_physician_name',
105105
'series_description',
106+
'sequence_name',
106107
'image_type',
107108
'accession_number',
108109
'patient_age',
@@ -480,6 +481,16 @@ def group_dicoms_into_seqinfos(
480481
image_type = tuple(dcminfo.ImageType)
481482
motion_corrected = 'MoCo' in dcminfo.SeriesDescription \
482483
or 'MOCO' in image_type
484+
485+
if dcminfo.get([0x18,0x24], None):
486+
# GE and Philips scanners
487+
sequence_name = dcminfo[0x18,0x24].value
488+
elif dcminfo.get([0x19, 0x109c], None):
489+
# Siemens scanners
490+
sequence_name = dcminfo[0x19, 0x109c].value
491+
else:
492+
sequence_name = 'Not found'
493+
483494
info = SeqInfo(
484495
total,
485496
os.path.split(series_files[0])[1],
@@ -496,6 +507,7 @@ def group_dicoms_into_seqinfos(
496507
dcminfo.get('StudyDescription'),
497508
refphys,
498509
dcminfo.get('SeriesDescription'),
510+
sequence_name,
499511
image_type,
500512
accession_number,
501513
# For demographics to populate BIDS participants.tsv

0 commit comments

Comments
 (0)