-
Notifications
You must be signed in to change notification settings - Fork 125
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
Use AcquisitionTime for acq_time column of scans tsv files #450
Comments
Interesting, in 0.4 we "correct date/time in BIDS _scans files", will check later from what other field we switched |
It looks like it was switched from SeriesTime in #73 a few years ago. |
looking at a sample (well -- abit atypical - the PD+T1w):
For syncing phys recordings, as I have mentioned in our chat at AFNI hackathon, I think we need some markers to get clocks in sync, unless phys signal has consistent artifacts from MR so we could identify beginning/end of sequence. Relying on times alone would never be sufficient I am afraid regardless if it is Acquisition or Content Time. any of those could be used to only roughly identify and match sequences. And given that there is no ContentTime in sidecar .json, may be it is even better to keep that one in |
TL;DR Long answer: I guess the
I assume so: the smallest acquisition time for all the DICOM files that go into a given NIfTI image. Because the PD- and the T2-weighted images come from different DICOM files, the AcquisitionTime for each one will be the minimum |
I have had success just using the relative times (i.e., working off of the exact times between scans and between physio trigger onsets in their own respective time series to figure out how they match up across time series). You can see in physiopy/phys2bids#219 (comment) a couple of figures showing how the method performs on an example scanning session. That said, I can grab AcquisitionTime from json files if necessary. In fact, that's currently how the method is set up. But it would be easier to grab the scan tsv file. Plus, given what @pvelasco has said, it just seems like AcquisitionTime is the most appropriate time to keep. |
Just wanted to ping this so I can make some progress on physiopy/phys2bids#219. Would folks feel comfortable with me opening a PR? |
thank you @tsalo for the ping! I think we
|
Okay, I can open an issue/PR to the BIDS specification. Thanks! |
Actually, after looking at the specification I'm wary of trying to prescribe the field used for |
You could define the field |
The manufacturer is something I haven't considered. @pvelasco do you have any idea who might know about other vendors? |
I think @neurolabusc, or he might know somebody who knows. |
I think there should be some wording in BIDS which would at least say something like "time when the first data point (could be a value in a time series, an MRI slice, etc) was acquired" -- something specific. Now it is not really clear what it corresponds to - beginning or the end... Someone could argue though that "end time" (the last data point) is a better time to keep track of, since then beginning of the data collection could be computed taking the full data time range. With "first data point" it might be a bit unclear since it doesn't account for that data point (e.g. a slice) actual acquisition duration, so it is really the time point AFTER acquisition of the first data sample. |
For input, are we talking specifically about Siemens data here? I wrote some notes on this several years ago:
My memory is that the MPCU clock drifts a lot relative to the MDH. So failure to choose the correct clock could have profound consequences. Siemens fMRI data from systems VA-VE are typically stored as mosaics, with one acquisition time 0008,0032 for the entire volume (the volume start time). The CSA file provides the MosaicRefAcqTimes which reports the slice times relative to this value. I would raise one caveat, which is Siemens Motion Correction (MoCo). I never use this, as I would prefer to model motion parameters offline. However, be aware that MoCo can generate negative slice time values. I am really not sure how the presence of negative slice times in MosaicRefAcqTimes should be interpreted with respect to the Physio clock. |
For completeness, here is a public example showing that the DICOM AcquisitionTime (0008,0032) for the first slice of the first volume of a fMRI series is preserved in the BIDS json file:
|
I looked at the code for @ostanley physio2bids and @pitchaim physio2bids. Both assume that the sampling rate stored in the .puls and .resp files is precise, with no drift relative to the DICOM clock. Specifically, if the file lists
The times of the triggers must be calculated with respect to this sample rate to avoid drift. Since the MDH times are with respect to the DICOM clock, one only needs to read the AcquisitionTime for the start of the series (saved in the BIDS JSON file) to know the time of all triggers relative to the DICOM images in the series. |
@neurolabusc Thank you for the info about the physio data! On the physio side of things, I'm primarily working with BioPac data, where calculating sample rate like that wouldn't be possible since timestamps aren't included. Still, in the future when phys2bids (hopefully) supports scanner-generated physio data as well, it will be good to account for drift.
Does that mean that AcquisitionTime is standard for DICOMs from all vendors? |
Yes, the tag AcquisitionTime (0008,0032) is specified in the DICOM standard. It has a Value Representation (VR) of TM: |
That's good to hear. So then it makes sense to use the minimum It's unfortunate that |
@yarikoptic I just opened bids-standard/bids-specification#503. I can open an associated PR in the next couple of days. |
@tsalo, I have a tool (bidsphysio) that reads a variety of different physiology files (BioPac, DICOM from CMRR multiband EPIs and PMU (Siemens scanner-generated)) and saves them in BIDS physio format. You might want to take a look at it. After looking at your PR in phys2bids (physiopy/phys2bids#219), I'm working on the synchronization of the physio files and the images, for our use case: when you have one physio file per functional run (a little bit different from yours). I hope you don't mind if I use your conversion.py function... |
@pvelasco lol I have glanced at Absolutely, feel free to use |
Summary
It looks like heudiconv uses ContentTime in the scans tsv files instead of AcquisitionTime, although I think that AcquisitionTime would be more appropriate (i.e., closer to the actual start of the scan).
Quoting @pvelasco in physiopy/phys2bids#219 (comment):
This issue is related to #447.
The text was updated successfully, but these errors were encountered: