error in FIVE/plotVOI

346 views
Skip to first unread message

Pauline FAVRE

unread,
Mar 14, 2016, 12:30:05 PM3/14/16
to Aaron's fMRI matlab tools.
Dear Donald and Aaron,
Thanks for nice toolboxes and documentation.
My question regards an error I get systematically when I try to plot post-hoc results in FIVE (it works well with the contrasts automatically generated by GLMflex):

Reference to non-existent field 'NegvsNeu'.

Error in GLM_Plot_Fast>ParseEffect (line 263)
            var = data.(step6{1});

Error in GLM_Plot_Fast (line 197)
    [con ind tr] = ParseEffect(effect,mod.X,mod.data);

Error in FIVE/plotVOI (line 3062)
                [yres xres part] = GLM_Plot_Fast(VOI.data,DM,effect);
 
Error while evaluating Menu Callback


Many thanks for your help,
Best,

Pauline

Aaron Schultz

unread,
Mar 14, 2016, 4:32:33 PM3/14/16
to Aaron's fMRI matlab tools.
Post Hoc contrast plotting is not currently working.  The scripts get confused about how to parse the design.  For the present, you should pull that data out of VOI.data, and use that to manually plot / measure whatever you are interested in.

-Aaron

--
You received this message because you are subscribed to the Google Groups "Aaron's fMRI matlab tools." group.
To unsubscribe from this group and stop receiving emails from it, send an email to fmri_matlab_to...@googlegroups.com.
To post to this group, send email to fmri_mat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fmri_matlab_tools/e31658ec-671e-4991-ba59-be7d83d2dddf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pauline FAVRE

unread,
Mar 15, 2016, 1:13:37 PM3/15/16
to Aaron's fMRI matlab tools.
Thank you for your answer.

May I ask another question? I can't figure out how to get the cluster-corrected statistics with FIVE (get cluster info). I always get the following warning:

Using default option of whole brain for statistics, even if there is a mask.
Using the default of no RESELS. FWHM was incorrectly specified or missing.
Using the default corrected threshold of p<0.05.
Using the default option of not saving corrected output.

Is there any way to modify the default output options while using peak.nii in FIVE?

Thank you for your time,
Best
Pauline

MCLAREN, Donald

unread,
Mar 15, 2016, 1:16:29 PM3/15/16
to fMRI MATLAB Tools
Without the RESELS/FWHM, peak_nii can't generate the corrected statistics.

Aaron -- do you know how to pass in the RESELS/FWHM to peak_nii from FIVE?

Best Regards, 
Donald McLaren, PhD


--
You received this message because you are subscribed to the Google Groups "Aaron's fMRI matlab tools." group.
To unsubscribe from this group and stop receiving emails from it, send an email to fmri_matlab_to...@googlegroups.com.
To post to this group, send email to fmri_mat...@googlegroups.com.

Pauline FAVRE

unread,
Mar 16, 2016, 8:15:00 AM3/16/16
to Aaron's fMRI matlab tools.
Would be great! (I didn't find how to).
Thanks

Aaron Schultz

unread,
Mar 16, 2016, 9:23:38 AM3/16/16
to Aaron's fMRI matlab tools.
Can you send me the SPM.mat file you are working with?

-Aaron


Pauline FAVRE

unread,
Mar 16, 2016, 9:33:38 AM3/16/16
to Aaron's fMRI matlab tools.
I'm working with GLMflex, so I don't have SPM.mat
I have the FWHM values in the I.mat structure (too heavy to be attached), but I wonder how to pass them directly in FIVE?

Aaron Schultz

unread,
Mar 16, 2016, 10:15:10 AM3/16/16
to Aaron's fMRI matlab tools.
FIVE should use those values automatically when you hit the FWE button.  In terms of how those get passed to peak_nii, I'm not sure.  I will see about discussing this with Donald.

-Aaron


Pauline FAVRE

unread,
Mar 16, 2016, 10:25:18 AM3/16/16
to Aaron's fMRI matlab tools.
That works for whole-brain FWE corrected results but not for cluster FWE corrected (I attached the table I got from getClusterInfo).
Thank you for your consideration.
Screenshot - 03162016 - 03:21:14 PM.png

Pauline FAVRE

unread,
Mar 16, 2016, 10:52:01 AM3/16/16
to Aaron's fMRI matlab tools.
I also attached the output structure from peak (maybe useful?). Here you can see that the cluster stat are empty, and FWEc and FDRc not defined. But maybe I'm missing something?
Thanks for your help.
Peak_0003_T_NegvsNeu_peaks20160316T153314_thresh4.6883_extent0.mat

Aaron Schultz

unread,
Mar 16, 2016, 10:58:01 AM3/16/16
to Aaron's fMRI matlab tools.
Ok, so the issue will be getting the FWHM info passed into peak_nii properly.  Donald, is there an input in peak_nii for this?  If so what form does it want the information in?

-Aaron

MCLAREN, Donald

unread,
Mar 16, 2016, 11:05:08 AM3/16/16
to fMRI MATLAB Tools
If you can pass in an additional parameter field called FWHM with the FWHM values (e.g. P.FWHM=[FWHMx FWHMy FWHMz]), then it should work. Although, I suspect some of the output settings might need to be changed in FIVE.

I can take a closer look tomorrow.

Best Regards, 
Donald McLaren, PhD


MCLAREN, Donald

unread,
Mar 18, 2016, 8:27:08 PM3/18/16
to fMRI MATLAB Tools
In the case of FIVE, 

S.FWHM = [x y z];


This should be added to the getClusterParams section of FIVE.


Best Regards, 
Donald McLaren, PhD


Pauline FAVRE

unread,
Apr 18, 2016, 7:24:56 AM4/18/16
to Aaron's fMRI matlab tools.
Thank you for your responses,
I'm sorry but I'm not sure to follow you. Where can I pass the FWHM values in FIVE? I didn't find the getClusterParams section in the script.
Thanks for your help

MCLAREN, Donald

unread,
Apr 18, 2016, 8:39:18 PM4/18/16
to fMRI MATLAB Tools
function getClusterParams starts on line 2532 of my version of FIVE.

A line will need to be added for S.FWHM.

Aaron will need to provide the details of where the FWHM values are stored. 

He should be able to provide more details about FIVE and where the S.FWHM lined should go in the code.

Best Regards, 
Donald McLaren, PhD


Anika Stockert

unread,
May 9, 2016, 3:47:33 AM5/9/16
to Aaron's fMRI matlab tools.
Dear Aaron,

I come back to the question Pauline raised earlier. I would also like to get cluster-corrected statistics but ended up with the same problem Pauline had (FWHM values not being passed to FIVE). Second level analysis was done with GLM_Flex_Fast4, so I do not have an SPM.mat. When using the FIVE Get Peak Info Option it gives me the same table Pauline attached (cluster size, T/F values) and the follwing error message that she posted earlier:


Using default option of whole brain for statistics, even if there is a mask.
Using the default of no RESELS. FWHM was incorrectly specified or missing.
Using the default corrected threshold of p<0.05.
Using the default option of not saving corrected output.
Threshold is:7.71
Subscripted assignment dimension mismatch.

Error in FIVE/getPeakInfo (line 3182)
        Out(2:end,1:7) = num2cell(peak.voxels{1});

As Donald McLaren said in his earlier message you might be able to provide more information how to pass FWHM (in the I.mat) to FIVE?

In addition, when trying to do whole brain FWE correction in FIVE it tries to load a SPM.mat. Is there any option to change the code to get FWE correction without a SPM.mat?

Thank you for your help

Best
Anika

Anika Stockert

unread,
May 31, 2016, 4:48:27 AM5/31/16
to Aaron's fMRI matlab tools.
Dear Aaron,

sorry for reposting this. I have not been able to find a solution to get cluster corrected statistics (see above). Can you help me with this?

Thank you and best regards

Anika

Aaron Schultz

unread,
Jun 4, 2016, 2:41:56 PM6/4/16
to fmri_mat...@googlegroups.com
We are almost there.  There one last bit that I'm working on with Donald, but then it should be ready to go.

-Aaron



--
You received this message because you are subscribed to the Google Groups "Aaron's fMRI matlab tools." group.
To unsubscribe from this group and stop receiving emails from it, send an email to fmri_matlab_to...@googlegroups.com.
To post to this group, send email to fmri_mat...@googlegroups.com.

Aaron Schultz

unread,
Jun 6, 2016, 11:04:12 AM6/6/16
to fmri_mat...@googlegroups.com
Ok, try this version.  Please note that this version of peak_nii will only work correctly with SPM8 or SPM12b; using the current version of SPM12 will generate errors.

-Aaron
FIVE.m

Anika Stockert

unread,
Jun 6, 2016, 1:10:10 PM6/6/16
to Aaron's fMRI matlab tools.
Dear Aaron and Donald, thank you for your help!

I added SPM8 to my matlab path and replaced FIVE with the script you have provided and tried FWE correction -- but I end up with the following error

Warning: Returning NaN for out of range arguments
> In spm_invTcdf (line 95)
  In spm_u (line 31)
  In spm_uc_RF (line 30)
  In spm_uc (line 39)
  In FIVE/correctThresh (line 3975)
  In peak_nii (line 267)
  In FIVE/getPeakInfo (line 3243)
Error using betainc
X must be in the interval [0,1].

Error in spm_Tcdf (line 109)
F(Q) = xQxPos -(xQxPos*2-1).*0.5.*betainc(v(Qv)./(v(Qv)+x(Qx).^2),v(Qv)/2,1/2);

Error in spm_P_RF>spm_ECdensity (line 156)
    EC(1,:) = 1 - spm_Tcdf(t,v);

Error in spm_P_RF (line 63)
EC  = spm_ECdensity(STAT,Z,df);

Error in spm_uc_RF (line 37)
    [P, P, p] = spm_P_RF(1,0,u,df,STAT,R,n);

Error in spm_uc (line 39)
u = spm_uc_RF(a,df,STAT,R,n);

Error in FIVE/correctThresh (line 3975)
                    thresh = spm_uc(p,df,stat,reselinfo,1,numel(find(msk>0)));
 
Error while evaluating UIControl Callback


After I tried this, the get peak info option gets me to a breakpoint in peak_nii (line 267). I also attached the peak_nii I am using.
Can you help with this?
peak_nii.m

Anika Stockert

unread,
Jul 5, 2016, 7:53:18 AM7/5/16
to Aaron's fMRI matlab tools.
Dear Aaron and Donald,

I'm sorry for bothering you again, but I am still having trouble correcting my results for multiple comparisons (whole brain FWE or cluster corrected). In FIVE (update you posted, SPM8) both the FWE option (error message form my previous post) and get peak info option (RESELS not passed. FWHM incorrectly specified or missing results in uncorrected ouput).

Again, I'm very greatful for any advice. Best, Anika



Pauline FAVRE

unread,
Nov 7, 2016, 8:49:04 AM11/7/16
to Aaron's fMRI matlab tools.
Dear Aaron and Donald,
I'm also coming back to you regarding FWE cluster correction values in FIVE. I tried the other version of FIVE you provided in the previous message under spm8 but, as for Anika, the get peak info option gets me to a breakpoint in peak_nii (line 267).

Do you have updates regarding this issue?

Many thanks
Pauline

Aaron Schultz

unread,
Nov 17, 2016, 8:30:52 AM11/17/16
to Aaron's fMRI matlab tools.
If you want GLM_Flex_Fast4 to compute the FWHM, you will need to set I.estSmooth=1;  This will produce a smoothness estimate for each error term in the model.

If you have your own values that you want to pass in, then you can manually put them in the I.mat file.

load I.mat;
I.FWHM{1} = FWHM1;
I.FWHM{2} = FWHM2;
save I.mat I

Again you will need to specify multiple if there are multiple error terms.

-Aaron

Nicolas Lori

unread,
Jun 22, 2018, 4:41:16 AM6/22/18
to Aaron's fMRI matlab tools.
Dear Aaron and Donald,

In 3/14/2016 Aaron posted "Post Hoc contrast plotting is not currently working".
I am using GLM_Flex_Fast4 and when I try to do Post Hoc contrast plotting I get the error:

Reference to non-existent field

Is the Post Hoc contrast plotting still not working?

Thank you,

PS: I am new to GLM_Flex_Fast.

Nicolas

Aaron Schultz

unread,
Jun 22, 2018, 1:57:38 PM6/22/18
to fmri_mat...@googlegroups.com
Auto-plotting of Post-hocs has not been added yet.  However when you plot a VOI, it should return data for all observations in the VOI structure.  You can use that data to generate your own plot of the data.

-Aaron

--
You received this message because you are subscribed to the Google Groups "Aaron's fMRI matlab tools." group.
To unsubscribe from this group and stop receiving emails from it, send an email to fmri_matlab_to...@googlegroups.com.
To post to this group, send email to fmri_mat...@googlegroups.com.

Harry Moore

unread,
Jul 10, 2018, 12:54:54 PM7/10/18
to Aaron's fMRI matlab tools.
Hi Aaron,

When trying to plot data for a post hoc image I don't get the VOI.data structure, although I do get it for main effect and interaction images. Do you know why this might be?

This is the error message in the command window:

Reference to non-existent field 'PostHoc1'.


Error in GLM_Plot_Fast>ParseEffect (line 263)
            var = data.(step6{1});

Error in GLM_Plot_Fast (line 197)
    [con ind tr] = ParseEffect(effect,mod.X,mod.data);

Error in FIVE/plotVOI (line 3062)
                [yres xres part] = GLM_Plot_Fast(VOI.data,DM,effect);
 
Error while evaluating Menu Callback


Cheers,
Harry

Aaron Schultz

unread,
Jul 10, 2018, 10:57:40 PM7/10/18
to fmri_mat...@googlegroups.com
I guess the post hoc contrast plotting is buggier than I remember. I would suggest plotting from one of the canonical contests to generate the voi. If you are plotting a blob, you can cache the cluster coordinates and then plot from a canonical contrast.

-Aaron
Reply all
Reply to author
Forward
0 new messages