Closed mattcieslak closed 4 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?
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.
Ah gotcha. So just adding to the seqinfo object on the fly?
@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)
Did this get merged?
Yep this got done
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