Hello Anders, Can you upload the two input images to: https://oxfile.ox.ac.uk/oxfile/work/extBox?id=700839B35190E48BF So I can look at them directly? Kind Regards Matthew -------------------------------- Dr Matthew Webster FMRIB Centre John Radcliffe Hospital University of Oxford On 3 Jul 2019, at 13:50, Anders Eklund <[log in to unmask]<mailto:[log in to unmask]>> wrote: Hello, we have some problems with the 'fslcomplex' function. We get the following error message fslcomplex -complexmerge image_complex1.nii.gz image_complex2.nii.gz test.nii.gz Image Exception : #5 :: Out of Bounds (time index) terminate called after throwing an instance of 'RBD_COMMON::BaseException' Aborted (core dumped) When we look at the code, a potential problem can be that the for loop in the function 'complexmerge' is for (int n=vr1.mint(); n<=vr1.maxt(); n++) { instead of for (int n=vr1.mint(); n<vr1.maxt(); n++) { i.e. <= instead of < https://github.com/mshvartsman/FSL/blob/7aa2932949129f5c61af912ea677d4dbda843895/src/avwutils/fslcomplex.cc Is this a bug or are we using the function incorrectly? - Anders ________________________________ To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1 ######################################################################## To unsubscribe from the FSL list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1