Here is a Matlab script for computing slice timing for non-multiband data:
TRsec = 3;
nSlices = 48;
TA = TRsec/nSlices; %assumes no temporal gap between volumes
bidsSliceTiming=[0:TA:TRsec-TA]; %ascending
if false %descending
bidsSliceTiming = flip(bidsSliceTiming);
end
if true %interleaved
order = [1:2:nSlices 2:2:nSlices]
bidsSliceTiming(order) = bidsSliceTiming;
end
%report results
fprintf(’ “SliceTiming”: [\n’);
for i = 1 : nSlices
fprintf(’ %g’, bidsSliceTiming(i));
if (i < nSlices)
fprintf(‘,\n’);
else
fprintf(’ ],\n’);
end
end
Here I assume that there is no temporal gap between volumes. This will not be the case for sparse sequences (GE refers to this as Group Delay, Siemens as Delay in TR). Also, Philips users should be aware that the Prospective Motion Correction option adds a slight pause between volumes. My experience is that this is usually very brief (~17ms) so can probably be ignored.
Multi-band patterns can be a bit unusual, and to determine these you probably need help from the vendor. For example, with GE the pattern changed with 27.0 R3 to minimize interference between volumes. Therefore, for GE you need to not only know the multi-band factor, but the software stepping as well.