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: Add SliceTimingCorrected and StartTime fields to BOLD metadata #2540

Merged
merged 2 commits into from
Sep 28, 2021

Conversation

effigies
Copy link
Member

Changes proposed in this pull request

Closes #2539.
Addresses #2477.
Implements provisional bids-standard/bids-specification#836

This does not update the toffset field in NIfTI at present.

One thing to address: when we're calculating the acquisition time (TA), we use st[-1] + (st[1] - st[0]), which treats each slice as having a duration. When we're calculating tzero, we use (st[-1] - st[0]) * frac + st[0], which treats each slice as an instantaneous acquisition. So tzero is a half "slice duration" less than half TA (tzero = (t[0] + TA) / 2 - (t[1] - t[0]) / 2).

Our tzero calculation is consistent with AFNI's default, but while we're here, maybe we want to adjust it to be tzero = (t[0] + TA) / 2. Or is the calculation of TA incorrect?

cc @MartinHebert @theoschaefer @nitschalex @oliver-contier @kellyhennigan

@theoschaefer
Copy link
Contributor

Hi Chris,

I just remember that SPM defines TA as TA = TR - (TR / number_of_slices) (e.g. see here). That would result in a shorter TA (minus one slice duration) compared to your calculation. I do not know if treating slices as durations or instances is better (although intuitively durations makes more sense to me), but I would say consistency is most important. Thus, I would recommend to change either the tzero calculation to tzero = (st[0] + TA) / 2 as you suggested or treat slices as instantaneous acquisitions and keep the old tzero calculation.

Copy link
Member

@oesteban oesteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder of the option we talked about in a meeting some days ago. Once that idea is set back, this LGTM.

Comment on lines +70 to +71
{'VolumeTiming': [0.0, 1.0, 2.0, 5.0, 6.0, 7.0], 'SliceTimingCorrected': True,
'AcquisitionDuration': 1.0, 'StartTime': 0.4}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{'VolumeTiming': [0.0, 1.0, 2.0, 5.0, 6.0, 7.0], 'SliceTimingCorrected': True,
'AcquisitionDuration': 1.0, 'StartTime': 0.4}
{'VolumeTiming': [0.0, 1.0, 2.0, 5.0, 6.0, 7.0], 'SliceTiming'=[0.4, 0.4, 0.4, 0.4, 0.4],
'AcquisitionDuration': 1.0}

What are your thoughts about making it explicit that the SliceTiming metadata is a list of uniform values? This would be readily supported by BIDS and leaves no room for confusion - even if you try to run STC over again on these data, the algorithm should notice you are sampling on-grid all the time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened an issue on BIDS: bids-standard/bids-specification#879

@mgxd mgxd added this to the 21.0.0 milestone Sep 21, 2021
@effigies effigies merged commit 348ebee into nipreps:master Sep 28, 2021
@effigies effigies deleted the enh/stc_metadata branch September 28, 2021 16:26
effigies added a commit to effigies/fmriprep that referenced this pull request Sep 30, 2021
mgxd added a commit to mgxd/nibabies that referenced this pull request Oct 13, 2021
This ports over nipreps/fmriprep#2540, allowing for control of the slice timing reference used during correction.
Additionally, add SliceTimingCorrected and StartTime fields to the BOLD metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata indicating whether or not slice-timing correction has been performed
4 participants