Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bfcorr gives "Index exceeds the number of array elements." error #10

Open
pwrightkcl opened this issue Oct 8, 2022 · 0 comments
Open

Comments

@pwrightkcl
Copy link
Collaborator

Running a pipeline with two images, including segmentation and bias field correction, the bias field correction step crashes with "Index exceeds the number of array elements.". It is looking for a bias-corrected image for each of the segmentation inputs, but there is only one in line 7:
Nii{1}(n) = nifti(pth_seg{7}{n});

Inputs to bf_correct.m:
Nii - 1x1 cell array
Nii{1} - 1x2 nifti
pth_seg - 1x8 cell array
pth_seg{5:7} - 1x1 cell arrays
pth_seg{[1:4,8]} - empty (0x0 double)
pth_seg{7} - 1x1 cell array, with a bias corrected image filename corresponding to the first input image

It looks like the internal SPM function only writes bias corrected for one image. It seems like a decision is needed about whether to limit the user to one bias-corrected image (which may break later steps), or save the bias field and apply it to each image after SPM has finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant