Hello,
I happened to find what I think is a bug during the computation of the GLM from the HbO sources extracted at cortex level. In line 439 of process_nst_glm_fit:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if save_betas
% Saving B as maps
for i_reg_name=1:length(model.reg_names)
data_out = zeros(size(DataMat.F, 1), 1); ←– This
output_tag = sprintf('ir%d_beta%d', sInput.iItem, i_reg_name);
output_comment = \[output_prefix '- beta ' model.reg_names{i_reg_name}\];
if surface_data
\[sStudy, ResultFile\] = nst_bst_add_surf_data(results.B(i_reg_name,:)', \[1\], \[\], output_tag, output_comment, ...
\[\], sStudy, 'GLM', DataMat.SurfaceFile);
else
data_out(nirs_ichans,:) = results.B(i_reg_name,:);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
the row:
data_out = zeros(size(DataMat.F, 1), 1);
always returns error, since DataMat, when GLM is computed from sources, does not contain the F field.
I happened to resolve this problem moving that line in the else section of the following if.
Can you verify if this behaviour was intended and the GLM is not supposed to run on sources, or if it was unintended?
Thanks,
Zanchi