canlab / MediationToolbox

Single-level and multi-level mediation analyses for any kind of data, with bootstrap-based significance testing. Neuroimaging-oriented functions allow for mediation effect parametric mapping (mapping of mediation effects across the brain) and multivariate mediation.
https://canlabweb.colorado.edu/wiki/doku.php/help/mediation/m3_mediation_fmri_toolbox
78 stars 28 forks source link

Problem with publish_mediation_report #12

Closed amnsbr closed 4 years ago

amnsbr commented 4 years ago

Hi,

I am doing a multilevel mediation analysis on N = 21 subjects with the following variables:

I ran mediation_brain_multilevel with and without bootstrapping using the following codes:

Which runs without any errors and generates pval images for different pathways (X -> M, M -> Y, X -> M -> Y) that I can easily view in fsleyes.

Now the problem is at the last stage, where I call mediation_brain_results_all_script or publish_mediation_report to get the final results. When I call mediation_brain_results_all_script I get this output:

Analysis Mask
----------------------------------------------
Using mask.img stored in current directory (automatically written for mediation analyses) for mask.
Using default anatomical underlay image.
montage_clusters: no activation blobs; displaying underlay image.
0 Clusters found.
No overlap plotting.
----------------------------------------------
Overlap between Paths a and b
----------------------------------------------
-------------------------------------------------------------------
-------------------------------------------------------------------
MEDIATION: OVERLAP BETWEEN PATH A AND B MAPS
-------------------------------------------------------------------
-------------------------------------------------------------------

Direct calls to spm_defauts are deprecated.
Please use spm('Defaults',modality) or spm_get_defaults instead.
Matrix dimensions must agree.

Error in mediation_brain_results_a_b_overlap (line 91)
bothpos = bothsig & all(effect_obj.dat > 0, 2);

Error in mediation_brain_results_all_script (line 231)
    mediation_brain_results_a_b_overlap('p', pthresh(1), 'k', kthresh(1), 'overlay', overlay, 'save', 'mask', mask, 'slices');

And when I call publish_mediation_report I get an incomplete html report, with this output in Matlab:

Creating HTML report for results in:
/media/amin/761CC7571CC71153/Neuroimaging/Vicar/mediation_analysis/all_fear_r_iii_reflexes_noboot
Index in position 1 exceeds array bounds.

Error in canlab_results_fmridisplay (line 336)
                    [o2, dat] = montage(o2, orientation, 'wh_slice', xyz(i, :), 'onerow', 'existing_axes', axh(i), 'existing_figure', 'noverbose');

Error in region/montage (line 221)
    o2 = canlab_results_fmridisplay(obj, 'noverbose', varargin{:}, 'noblobs', 'nooutline');

Error in mediation_brain_results_report (line 82)
montage(a_regions_fdr, 'colormap', 'regioncenters');

ans =

    '/media/amin/761CC7571CC71153/Neuroimaging/Vicar/mediation_analysis/all_fear_r_iii_reflexes_noboot/published_output/mediation_brain_report_03-Aug-2020_09_08/mediation_brain_results_report.html'

By looking at pval images, it looks like there are no significant clusters in any of the pathways (although there are some significant voxels), maybe that's why I'm getting this error?

Of note, all the subjects had 48 trials except for subject 1 for which the data of 48th trial is missing. I also tried removing the first subject, but still got the same error.

My Matlab version is R2018b, and I have tested it with both spm8 and spm5 and none of them have worked. Can you please help me in identifying the source of the problem? Thank you very much.

amnsbr commented 4 years ago

I figured it out. The problem was that I've been using an incorrect mask. The mask I used was the FSL's MNI152_T1_1mm_brain_mask.nii which was aligned with the beta images that were in the MNI space, but they didn't have the same dimensions.

torwager commented 4 years ago

Great!

On Aug 14, 2020, at 2:23 PM, Amin Saberi notifications@github.com wrote:

I figured it out. The problem was that I've been using an incorrect mask. The mask I used was the FSL's MNI152_T1_1mm_brain_mask.nii which was aligned with the beta images that were in the MNI space, but they didn't have the same dimensions.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/canlab/MediationToolbox/issues/12#issuecomment-674204213, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPY7LDBTAKRR52GLGIE6E3SAV6L7ANCNFSM4PTJPKDA.