I would like to show the timecourse of the voxel I center on when I plot a statistical map.

For plotting I use nilearn.plotting.plot_stat_map(), which takes cut_coords (for which I give a length-3 tuple) as arguments.

I load the 4D timeseries with nib.load(), but I can’t seem to be able to apply a mask to it without having a (manually?) constructed NIfTI on disk. I am aware that I can extract the data from the timeseries as a numpy array, but then I would be slicing in the data matrix coordinates. The cut_coords I have are in the image space.

I also realize that I could calculate all o this with the help of the values in the affine matrix. I was just thinking that maybe someone already implemented this, and I was just unable to find it. It sounds like a fairly basic feature.