I have similar error as follows and I have tried correcting it but to no avail.
Any help would be appreciated. Thanks
Rigid registration done.
Setting up data for non-rigid registration based distortion correction…
Correcting intensity non-uniformity in b=0 image…Index exceeds the number of array elements (0).
Error in find_bounding_box (line 41)
Error in EPI_correct_files_registration_INVERSION>trim_msk_PED (line 538)
Error in EPI_correct_files_registration_INVERSION (line 296)
Error in coregister_diffusion_mprage_pipeline (line 244)
Error in BrainSuite_Diffusion_pipeline (line 51)
MATLAB:badsubscript