nipy / nitransforms

a standalone fork of nipy/nibabel#656
https://nitransforms.readthedocs.io
MIT License
28 stars 17 forks source link

Slice-timing correction representation #105

Open effigies opened 3 years ago

effigies commented 3 years ago

I haven't had the time to sit down and really understand this, but nipy has STC implemented as part of realign4d. It uses affine transforms, so I suspect we can find a compact serializable representation of STC for nitransforms.

https://github.com/nipy/nipy/blob/d16d268938dcd5c15748ca051532c21f57cf8a22/nipy/algorithms/registration/groupwise_registration.py

This is brought up in the context of attempting to reduce the outputs of preprocessing to a minimum while preserving flexibility for downstream uses. In the absence of an STC transform, the ST-corrected BOLD series would be a required output, if calculated.

effigies commented 3 years ago

Having read the paper and looked through the code a bit, it turns out the affine is a constraint on the spatial transform, but the final representation of the space-time realign is a cubic spline. I don't know if it would make sense to come up with our own representation of a temporal realignment, or figure out how to degenerate the spline representation to one that is constant over time and has no spatial component.

effigies commented 3 years ago

Other algorithms:

oesteban commented 3 years ago

The limitation to this is that scipy only supports up to 3D cubic B-Spline interpolation. The extension to 4D is not trivial but not hard (esp. reusing the 3D implementation on scipy).

The rest of it is dealing with the additional dimension when converting from IJK+L to RAS+t and viceversa.

oesteban commented 3 years ago

Adding on the above - that works for volume (gridded) data.

For surfaced-sampled data, we need to finish #106, and add the t-axis interpolator basis. I'm not sure how computationally heavy this will be (probably affordable for fsaverage5 resolution and <1k timesteps, but probably excessively slow for fsaverage6).