Hello everybody.
Things generally seem to be working, but while I can get batch_fitting_single to run, batch_fitting encounters an error which reads "Error using batch_fitting (line 89) Index in position 1 exceeds array bounds."
It is worth mentioning that this is after I have modified the batch_fitting script according to advice given in this other thread on this forum -
https://groups.google.com/forum/#!topic/noddi/OVjAy4OL_DM . Like Blake in that thread I was
initially getting that error around the "roi" term in the same script, and modified it so that I now include " roi=[]; " on a line immediately before the line reading " voxel = roi(i,:)'; ". Doing this appeared to fix that initial error, and now I get this new one instead. I do not know if this modification has anything to do with the issue I am posting about. For completeness sake, I'm including below the entirety of this modified / problematic section as it currently is. The line tagged as causing the current "array bounds" error is in bold, and my inserted "roi" line shortly follows:
% start the parallel fitting
for split_start=current_split_start:progressStepSize:numOfVoxels
% set up the split end
split_end = split_start + progressStepSize - 1;
if split_end > numOfVoxels
split_end = numOfVoxels;
end
% fit the split
parfor i=split_start:split_end
% get the MR signals for the voxel i
roi=[];
voxel = roi(i,:)';
% fit the voxel
if model.noOfStages == 2
[gsps(i,:), fobj_gs(i), mlps(i,:), fobj_ml(i), error_code(i)] = ThreeStageFittingVoxel(voxel, protocol, model);
else
[gsps(i,:), fobj_gs(i), mlps(i,:), fobj_ml(i), error_code(i), mcmcps(i,:,:)] = ThreeStageFittingVoxel(voxel, protocol, model);
end
% report to the progress monitor
if mod(i, progressStepSize)==0
ppm.increment();
end
end
% save the temporary results of the split
if model.noOfStages == 2
save(outputfile, 'split_end', 'model', 'gsps', 'fobj_gs', 'mlps', 'fobj_ml', 'error_code');
else
save(outputfile, 'split_end', 'model', 'gsps', 'fobj_gs', 'mlps', 'fobj_ml', 'mcmcps', 'error_code');
end
end