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

mediation_brain.m stops prematurely #5

Open wjvlno opened 7 years ago

wjvlno commented 7 years ago

I am using the following script to perform a whole brain mediation analysis on volumes with 153 1mm axial slices. When running mediation_brain.mat, the program stops after analyzing only 62 of the 153 total slices. I am unsure if this is the result of a memory issue or a constraint that is built into the program.

loss_smooth_imgs = filenames('/deep/heller/work/savorema/0*/FinancialWin/glm_WinLoss_310/loss_smooth.nii', 'char', 'absolute'); cd /deep/heller/work/savorema/GroupAna/Mediation NAxSTAI_data = importdata('MSSD_NA_bl x STAI.txt'); cd /deep/heller/work/savorema/GroupAna/Mediation mask = filenames('MNI152_T1_1mm_brain_mask.nii', 'char', 'absolute') newdir = 'mediation_NAxSTAIround2'; mkdir(newdir) cd(newdir) scn_map_image(mask, deblank(loss_smooth_imgs(1,:)), 'write', 'resliced_mask.img'); x = NAxSTAI_data.data(:,1); y = NAxSTAI_data.data(:,2); names = {'X:MSSD_NA' 'Y:STAI' 'M:BrainMediator'}; results = mediation_brain(x, y, loss_smooth_imgs, 'names', names, 'mask', 'resliced_mask.img', 'boot', 'pvals', 5);