We have an old study that involved two scans per session seperated by a task. We’re ultimately interested in dnamic connectivity which we’re going to run with conn_toolbox. However, despite the thread linked below, it doesn’t seem to accept assigning multiple image files per session.
I’m therefore trying to concatenate them using nibabel. I’m unable to load them properly using
nib.Nifti1Image.from_filename(PATH)
however when I try to concatenate them using
ni.bfuncs.concat_images(imgs)
it gives the error message shown below
nibabel.spatialimages.HeaderDataError: data code 30588 not recognized
I then tried what was suggested in this thread. However, it ended up giving as error that
AttributeError: ‘str’ object has no attribute ‘shape’
in the step to load the image with the header specified and the affine specified to None (it required that the poisitonal argument be there).
I suppose there are a number of ways to do what you want from what I understand. For example, nilearn provides a function to directly concatenate images: