Error processing GLM (homer 3)

392 views
Skip to first unread message

adam.v....@gmail.com

unread,
Oct 15, 2020, 8:07:50 AM10/15/20
to Homer-fNIRS and AtlasViewer Community
Dear Homer community,

I'm trying to run the GLM in Homer 3 with a dataset that I've been processing successfully in Homer 2.8, which results in the following error only when using consecutive gaussians as the basis function no matter what parameters I use for the gaussians (preferably [2.0 3.0]):

Undefined function or variable 'ar_glm_final'. (line 541)          (see full error at the bottom)

Any help would be much appreciated. I'm using the following cfg file (google wont allow me to upload neither cfg nor snirf/nirs file).

Kind regards,
Adam

------
cfg-file:

% Homer3 (v1.26) 

% group

@ hmrG_SubjAvg [dcAvg,nTrials] (dcAvgSubjs,nTrialsSubjs

@ hmrG_SubjAvgStd dcAvgStd (dcAvgSubjs 

% subj

@ hmrS_RunAvg [dcAvg,nTrials] (dcAvgRuns,mlActRuns,nTrialsRuns 

@ hmrS_RunAvgStd2 dcAvgStd (dcAvgRuns,dcSum2Runs,mlActRuns,nTrialsRuns 

% run

@ hmrR_Intensity2OD dod (data

@ hmrR_PruneChannels mlActAuto (data,probe,mlActMan,tIncMan dRange %0.0e_%0.0e 0_10000000 SNRthresh %d 2.5 SDrange %0.1f_%0.1f 0_45 reset %d 0

@ hmrR_MotionArtifactByChannel [tIncAuto,tIncAutoCh] (dod,probe,mlActMan,tIncMan tMotion %0.1f 0.5 tMask %0.1f 1 STDEVthresh %0.1f 10 AMPthresh %0.2f 100

@ hmrR_MotionCorrectSpline dod (dod,mlActAuto,tIncAutoCh p %0.2f 0.99 turnon %d 1

@ hmrR_MotionArtifactByChannel [tIncAuto,tIncAutoCh] (dod,probe,mlActMan,tIncMan tMotion %0.1f 0.5 tMask %0.1f 1 STDEVthresh %0.1f 10 AMPthresh %0.2f 100

@ hmrR_MotionCorrectWavelet dod (dod,mlAct iqr %0.2f 1.5 turnon %d 1

@ hmrR_OD2Conc_new dc (dod,probe ppf %0.1f_%0.1f 1_1

@ hmrR_GLM [dcAvg,dcAvgStd,nTrials,dcNew,dcResid,dcSum2,beta,R] (dc,stim,probe,mlActAuto,Aaux,tIncAuto,rcMap trange %0.1f_%0.1f -2_20 glmSolveMethod %d 2 idxBasis %d 2 paramsBasis %0.1f_%0.1f_%0.1f_%0.1f_%0.1f_%0.1f 2.0_3.0 rhoSD_ssThresh %0.1f 15 flagNuisanceRMethod %d 1 driftOrder %d 0 flagMotionCorrect %d 0

-------

Full error message from matlab command window

Undefined function or variable 'ar_glm_final'.

Error in hmrR_GLM (line 541)
                        [dmoco, beta, tstat, pval, sigma, CovB, dfe, w, P, f] =
                        ar_glm_final(squeeze(ytmp2),At(lstInc,:));

Error in ProcStreamClass/Calc (line 232)
                    eval( fcall );

Error in RunClass/Calc (line 299)
            obj.procStream.Calc(obj.GetFilename);

Error in DataTreeClass/CalcCurrElem (line 505)
            obj.currElem.Calc();

Error in MainGUI>pushbuttonCalcProcStream_Callback (line 464)
    maingui.dataTree.CalcCurrElem();

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in MainGUI (line 21)
    gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)MainGUI('pushbuttonCalcProcStream_Callback',hObject,eventdata,guidata(hObject)) 
Error while evaluating UIControl Callback.


Stephen Tucker

unread,
Oct 15, 2020, 9:13:35 AM10/15/20
to Homer-fNIRS and AtlasViewer Community
Hi Adam,

Thanks for bringing this to our attention

It seems like the AR-iWLS scripts from Homer2 were accidentally excluded from Homer3. 've just pushed a quick fix to the GitHub repository that should fix this issue.

Let me know if you still have issues after updating Homer.

Best,

Stephen Tucker

Adam Andersen

unread,
Oct 16, 2020, 3:28:21 AM10/16/20
to homer...@googlegroups.com
Hi Stephen,

Quick fix indeed - thanks a lot.

Kind regards,
Adam

--
You received this message because you are subscribed to a topic in the Google Groups "Homer-fNIRS and AtlasViewer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/homer-fnirs/B_8jZneqPws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to homer-fnirs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/homer-fnirs/ac653dfb-0039-4602-845c-77b33f60bd1fn%40googlegroups.com.

Adam Andersen

unread,
Oct 16, 2020, 3:43:59 AM10/16/20
to homer...@googlegroups.com
Hi Stephen,

Downloaded homer 3 from Github just now and the same error still occurs. 

Kind regards,
Adam

Boas, David

unread,
Oct 16, 2020, 8:29:19 AM10/16/20
to homer...@googlegroups.com

Adam,

Maybe Stephen forgot a file… but just in case, which version of matlab are you using? We’ve been testing everything with 2019b and also 2017b.

David

--
You received this message because you are subscribed to the Google Groups "Homer-fNIRS and AtlasViewer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to homer-fnirs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/homer-fnirs/CAPu%3D%3DLyHZFm5hKSXJ5%3DptB0MgrCC-cRmQdu6_8DTgbzhUhHkPg%40mail.gmail.com.

Adam Andersen

unread,
Oct 16, 2020, 9:58:02 AM10/16/20
to homer...@googlegroups.com
Hi David,

I'm using 2018b. 

I'll try downloading 2019b and see if it works.

Kind regards,
Adam

Boas, David

unread,
Oct 16, 2020, 9:58:46 AM10/16/20
to homer...@googlegroups.com

Should be fine with 2018b…. let’s see what Stephen and hopefully Jay have to say.

Stephen Tucker

unread,
Oct 16, 2020, 10:31:58 AM10/16/20
to Homer-fNIRS and AtlasViewer Community
Hi Adam,

I forgot to tell Homer where to find the new iWLS files I added. I've just pushed a change that should fix it.

Thanks!

Adam Andersen

unread,
Oct 20, 2020, 6:36:02 AM10/20/20
to homer...@googlegroups.com
Hi Stephen,

Now it works, thanks!

Kind regards,
Adam

anil kamat

unread,
Oct 20, 2020, 2:42:15 PM10/20/20
to homer...@googlegroups.com
Hi all, 
I have a beginner question. 

How do you extract a large number of HRF data when you have a large number of subjects and the data were collected over several days with few trials each day?

Currently, I am working with such humongous data and my processing streams take about 10 min to produce the HRF for a single subject. So, it is highly time-consuming and I have to wait for the stream processing to complete. 

Is there any automation method (maybe using Linux or something like that) to do this repetitive task? 
Also, I am a little confused about how the block average works. Especially; with the time-range to calculate the average of the HRF of the given trials? I see the time-range can exceed the trail time. 

I hope the questions are understandable. Appreciate your time. 

Many Thanks, 
-Anil

Boas, David

unread,
Oct 25, 2020, 12:52:43 PM10/25/20
to homer...@googlegroups.com

For analyzing lots of data in a non-interactive way, you want to run the analysis script in matlab directly and not through the Homer GUI. Homer2 would export the script for you to execute to do this. We are working on implementing this in Homer3… it is not there yet.

But, there are instructions on the wiki here

https://github.com/BUNPC/Homer3/wiki/Using-homer-functions-offline

That guides you in setting this up manually yourself.

 

 

 

From: <homer...@googlegroups.com> on behalf of anil kamat <alvin...@gmail.com>
Reply-To: "homer...@googlegroups.com" <homer...@googlegroups.com>
Date: Tuesday, October 20, 2020 at 2:42 PM
To: "homer...@googlegroups.com" <homer...@googlegroups.com>
Subject: Re: Error processing GLM (homer 3)

 

Hi all, 

I have a beginner question. 

 

How do you extract a large number of HRF data when you have a large number of subjects and the data were collected over several days with few trials each day?

 

Currently, I am working with such humongous data and my processing streams take about 10 min to produce the HRF for a single subject. So, it is highly time-consuming and I have to wait for the stream processing to complete. 

 

Is there any automation method (maybe using Linux or something like that) to do this repetitive task? 

Also, I am a little confused about how the block average works. Especially; with the time-range to calculate the average of the HRF of the given trials? I see the time-range can exceed the trail time. 

 

I hope the questions are understandable. Appreciate your time. 

 

Many Thanks, 

-Anil

Image removed by sender.

Reply all
Reply to author
Forward
0 new messages