Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Adds "AcquisitionTime" to the seqinfo #487

Merged
merged 5 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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