PennLINC / fw-heudiconv

Heuristic-based Data Curation on Flywheel
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

[ENH] Use AcquisitionTime as the "date" field in SeqInfo #28

Closed mattcieslak closed 4 years ago

mattcieslak commented 5 years ago

We usually remove dates from data before it goes on to flywheel, so this field is usually empty. It would be great to populate this with the AcquisitionTime field. That way the user can sort the scans by acquisition time if there are multiple repeats of the same sequence name in a row

TinasheMTapera commented 5 years ago

@mattcieslak

sort the scans by acquisition time if there are multiple repeats of the same sequence name in a row

Where exactly would someone be doing this? In the GUI?

mattcieslak commented 5 years ago

I was thinking in a heuristic it might be useful. Here's an example I've been using recently:


    diff_scans = defaultdict(list)
    for s in seqinfo:
        protocol = s.protocol_name.lower()
        if "dti" in protocol:
            diff_scans[s.dcm_dir_name].append(s.series_id)

    dwi_uids = sorted(diff_scans.keys())
    dwi_keys = [dwi01, dwi02, dwi03, dwi04, dwi05, dwi06,
                dwi07, dwi08, dwi09, dwi10, dwi11, dwi12][:len(dwi_uids)]

    for dwi_uid, dwi_key in zip(dwi_uids, dwi_keys):
        for series_id in diff_scans[dwi_uid]:
            info[dwi_key].append(series_id)

This sorts the scans by series_uid, but AcquisitionTime would be better. At the moment this isn't accessible in the SeqInfo object.

TinasheMTapera commented 5 years ago

Ah gotcha. So just adding to the seqinfo object on the fly?

TinasheMTapera commented 5 years ago

@mattcieslak do we want to print the date in that debug line?

DEBUG: Found SeqInfos:
localizer:
        [TR=0.0086 TE=0.004 shape=(512, 512, 3, -1) image_type=('ORIGINAL', 'PRIMARY', 'M', 'ND', 'NORM'), date=2010-04-17T11:24:22.207500] (5c79630adf93e30029fc4746)
mattcieslak commented 4 years ago

Did this get merged?

TinasheMTapera commented 4 years ago

Yep this got done