Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with publish_mediation_report #12

Closed
amnsbr opened this issue Aug 3, 2020 · 2 comments
Closed

Problem with publish_mediation_report #12

amnsbr opened this issue Aug 3, 2020 · 2 comments

Comments

@amnsbr
Copy link

amnsbr commented Aug 3, 2020

Hi,

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

  • X is a 1x21 cell, and each item in the cell is an array of 0s and 1s, representing the presence or absence of emotional faces in each trial
  • Y is a 1x21 cell, and each item in the cell is an array of subjective pain ratings in each trial
  • M is a 1x21 cell, and each item in the cell is an array of pathways to corresponding beta images (in response to painful stimuli) in each trial

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

  • Without bootstrapping:
    mediation_brain_multilevel(X, Y, M, struct('names', names, 'mask', '../MNI152_T1_1mm_brain_mask.nii'), 'nopreproc');
  • With bootstrapping:
    mediation_brain_multilevel(X, Y, M, struct('mask', '../MNI152_T1_1mm_brain_mask.nii', 'pvals', 5, 'bootsamples', 10000), 'boot', 'nopreproc')

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
Copy link
Author

amnsbr commented Aug 14, 2020

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.

@amnsbr amnsbr closed this as completed Aug 14, 2020
@torwager
Copy link
Contributor

torwager commented Aug 14, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants