Skip to content

Commit

Permalink
Merge pull request #487 from cbinyu/adds_acq_time_to_seqinfo
Browse files Browse the repository at this point in the history
ENH: Adds "AcquisitionTime" to the `seqinfo`
  • Loading branch information
yarikoptic authored Jan 13, 2021
2 parents 599cb83 + 2768e7a commit f757dd8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion heudiconv/dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def create_seqinfo(mw, series_files, series_id):
patient_age=dcminfo.get('PatientAge'),
patient_sex=dcminfo.get('PatientSex'),
date=dcminfo.get('AcquisitionDate'),
series_uid=dcminfo.get('SeriesInstanceUID')
series_uid=dcminfo.get('SeriesInstanceUID'),
time=dcminfo.get('AcquisitionTime'),
)
return seqinfo

Expand Down
5 changes: 5 additions & 0 deletions heudiconv/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ def test_cache(tmpdir):
assert (cachedir / 'S01.auto.txt').exists()
assert (cachedir / 'S01.edit.txt').exists()

# check dicominfo has "time" as last column:
with open(str(cachedir / 'dicominfo.tsv'), 'r') as f:
cols = f.readline().split()
assert cols[26] == "time"


def test_no_etelemetry():
# smoke test at large - just verifying that no crash if no etelemetry
Expand Down
3 changes: 2 additions & 1 deletion heudiconv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
'patient_sex', # 23
'date', # 24
'series_uid', # 25
]
'time', # 26
]

SeqInfo = namedtuple('SeqInfo', seqinfo_fields)

Expand Down

0 comments on commit f757dd8

Please sign in to comment.