External Email - Use Caution
Dear FreeSurfer experts,
I ran many analyses on a large sample and everything goes well. However, I encounter here a problem I've never encountered before about one of my analyses. I'm looking at the presence of a difference in slope between three groups while covarying for several variables and classes. My contrasts are:
contrast1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 -0.5 -0.5 0 0 contrast2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 0 0 -0.5 -0.5
contrast3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 -0.5 -0.5
6 classes (gender 2, disease 3), so first 6 for intercepts, next 30 for the covariates 1 to 5, and the last columns to test the slope difference between the three groups on the variable
I have used these contrasts to test the differences in slopes of several variables and I found significant clusters. However, for one variable specifically, mri_glmfit seems to be unable to quantify the FWHM from the data and when running mri_glmfit-sim, the resulting output, for every contrast (positive direction), gives a significant cluster where the whole cortex is included; see for contrast2 (it's the same result for every contrast anyways):
yuri@rodonor:/lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13$ cat cache.th40.pos.sig.cluster.summary # Cluster Growing Summary (mri_surfcluster) # 7.3.2 # 7.3.2 # CreationTime 2023/03/16-13:19:18-GMT # cmdline mri_surfcluster --in lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/sig.mgh --mask lh.Cogn.moca.egfr.thickness.15.glmdir/mask.mgh --cwsig lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.cluster.mgh --sum lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.cluster.summary --ocn lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.ocn.mgh --annot aparc --cwpvalthresh 0.05 --o lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.masked.mgh --no-fixmni --csd-out lh.Cogn.moca.egfr.thickness.15.glmdir/csd/all.cache.th40.pos-Cogn-egfr-g13.csd --csd lab/yuri/FreeSurfer/average/mult-comp-cor/fsaverage/lh/cortex/fwhm01/pos/th40/mc-z.csd --csdpdf lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.pdf.dat --vwsig lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.voxel.mgh --vwsigmax lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.voxel.max.dat --oannot lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.ocn.annot --bonferroni 2 --surf white # cwd /lab/yuri/egfrproject # sysname Linux # hostname rodonor.bri.upall.sv # machine x86_64 # FixVertexAreaFlag 1 # FixSurfClusterArea 1 # # Input lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/sig.mgh # Frame Number 0 # srcsubj fsaverage # hemi lh # surface white # group_avg_surface_area 82220 # group_avg_vtxarea_loaded 1 # annot aparc # SUBJECTS_DIR /lab/yuri/egfrproject # SearchSpace_mm2 74258.8 # SearchSpace_vtx 144277 # Bonferroni 2 # Minimum Threshold 4 # Maximum Threshold infinity # Threshold Sign pos # AdjustThreshWhenOneTail 1 # CW PValue Threshold: 0.05 # Area Threshold 0 mm^2 # CSD thresh 4.000000 # CSD nreps 10000 # CSD simtype null-z # CSD contrast NA # CSD confint 90.000000 # Overall max 1e+10 at vertex 0 # Overall min 0 at vertex 8 # NClusters 1 # FixMNI = 0 # # ClusterNo Max VtxMax Size(mm^2) MNIX MNIY MNIZ CWP CWPLow CWPHi NVtxs WghtVtx Annot 1 10000000000.0000 0 74258.42 -36.8 -18.3 64.5 0.00020 0.00000 0.00040 144276 1442760045363200.00 precentral
I feel that something is wrong in there, unless you think that it is possible that the slope difference manifests as a global effect for every contrast. It really seems to happen to happen specifically with this variable, as when replacing this variable by another, I can generate specific clusters that do not cover the whole cortex. Here is the terminal output from mri_glmfit when I run it on my "problematic" variable:
yuri@rodonor:/lab/yuri/egfrproject$ mri_glmfit --y lh.Cogn.moca.egfr.thickness.15.mgh --fsgd analysis/egfr-Cogn-moca-egfr.fsgd dods --C analysis/Cogn-egfr-g12.mtx --C analysis/Cogn-egfr-g13.mtx --C analysis/Cogn-egfr-g23.mtx --surf fsaverage lh --cortex --glmdir lh.Cogn.moca.egfr.thickness.15.glmdir gdfRead(): reading analysis/egfr-Cogn-moca-egfr.fsgd INFO: DeMeanFlag keyword not found, DeMeaning will NOT be done. Continuous Variable Means (all subjects) 0 Age 60.1017 7.57085 1 Bmi 26.8664 4.97535 2 FRS 10.9088 9.29652 3 wm 1642.17 1761.49 4 educ 3.48198 0.959607 5 moca 27.2733 2.25488 Class Size and Means of each Continuous Variable 1 g1gender0 324 57.7939 25.8998 5.0538 1164.8920 3.4753 27.6883 2 g1gender1 309 58.2326 27.0854 14.3098 1722.7615 3.4822 26.9450 3 g2gender0 311 61.0777 26.8550 6.1809 1492.9781 3.4084 27.6785 4 g2gender1 345 62.4106 27.2979 16.8165 2059.6704 3.5391 26.8986 5 g3gender0 20 63.1610 27.9590 6.8020 1252.0200 3.4500 27.4000 6 g3gender1 23 67.2335 30.2713 26.5796 3377.0609 3.7391 25.8696 INFO: gd2mtx_method is dods Reading source surface /lab/yuri/FreeSurfer/fsaverage/surf/lh.white Number of vertices 163842 Number of faces 327680 Total area 65417.000000 AvgVtxArea 0.399269 AvgVtxDist 0.721953 StdVtxDist 0.195472
7.3.2 cwd /lab/yuri/egfrproject cmdline mri_glmfit --y lh.Cogn.moca.egfr.thickness.15.mgh --fsgd analysis/egfr-Cogn-moca-egfr.fsgd dods --C analysis/Cogn-egfr-g12.mtx --C analysis/Cogn-egfr-g13.mtx --C analysis/Cogn-egfr-g23.mtx --surf fsaverage lh --cortex --glmdir lh.Cogn.moca.egfr.thickness.15.glmdir sysname Linux hostname rodonor.bri.upall.sv machine x86_64 user yuri FixVertexAreaFlag = 1 UseMaskWithSmoothing 1 OneSampleGroupMean 0 y /lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.mgh logyflag 0 usedti 0 FSGD analysis/egfr-Cogn-moca-egfr.fsgd labelmask /lab/yuri/FreeSurfer/fsaverage/label/lh.cortex.label maskinv 0 glmdir lh.Cogn.moca.egfr.thickness.15.glmdir IllCondOK 0 ReScaleX 1 DoFFx 0 Creating output directory lh.Cogn.moca.egfr.thickness.15.glmdir Loading y from /lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.mgh ... done reading. INFO: gd2mtx_method is dods Saving design matrix to lh.Cogn.moca.egfr.thickness.15.glmdir/Xg.dat Computing normalized matrix Normalized matrix condition is 6285.08 Matrix condition is 8.72285e+09 Found 149955 points in label. Pruning voxels by thr: 1.175494e-38 Found 144277 voxels in mask Saving mask to lh.Cogn.moca.egfr.thickness.15.glmdir/mask.mgh Reshaping mriglm->mask... search space = 71879.345725 DOF = 1290 Starting fit and test Fit completed in 28.4991 minutes Computing spatial AR1 on surface WARNING: ar1 = 0 <= 0. Setting fwhm to 0. Residual: ar1mn=0.000000, ar1std=0.000000, gstd=0.000000, fwhm=0.000000 Writing results Cogn-egfr-g12 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiency Cogn-egfr-g13 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiency Cogn-egfr-g23 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiencymri_glmfit done
Many thanks,
Yuri
I noticed that your DOF is 1290, so it is possible that you are maxing out the float computation. By coincidence, I just reprogrammed this to use double instead of float precision. You can get it from here https://gate.nmr.mgh.harvard.edu/safelinks/greve/mri_glmfit
username guest pwd collab
Let me know if that fixes your problem
On 3/16/2023 9:47 AM, Yuri Yeshinsky wrote:
External Email - Use Caution
Dear FreeSurfer experts,
I ran many analyses on a large sample and everything goes well. However, I encounter here a problem I've never encountered before about one of my analyses. I'm looking at the presence of a difference in slope between three groups while covarying for several variables and classes. My contrasts are:
contrast1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 -0.5 -0.5 0 0 contrast2: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 0 0 -0.5 -0.5 contrast3: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 -0.5 -0.5 6 classes (gender 2, disease 3), so first 6 for intercepts, next 30 for the covariates 1 to 5, and the last columns to test the slope difference between the three groups on the variable
I have used these contrasts to test the differences in slopes of several variables and I found significant clusters. However, for one variable specifically, mri_glmfit seems to be unable to quantify the FWHM from the data and when running mri_glmfit-sim, the resulting output, for every contrast (positive direction), gives a significant cluster where the whole cortex is included; see for contrast2 (it's the same result for every contrast anyways):
yuri@rodonor:/lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13$ cat cache.th40.pos.sig.cluster.summary # Cluster Growing Summary (mri_surfcluster) # 7.3.2 # 7.3.2 # CreationTime 2023/03/16-13:19:18-GMT # cmdline mri_surfcluster --in lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/sig.mgh --mask lh.Cogn.moca.egfr.thickness.15.glmdir/mask.mgh --cwsig lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.cluster.mgh --sum lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.cluster.summary --ocn lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.ocn.mgh --annot aparc --cwpvalthresh 0.05 --o lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.masked.mgh --no-fixmni --csd-out lh.Cogn.moca.egfr.thickness.15.glmdir/csd/all.cache.th40.pos-Cogn-egfr-g13.csd --csd lab/yuri/FreeSurfer/average/mult-comp-cor/fsaverage/lh/cortex/fwhm01/pos/th40/mc-z.csd --csdpdf lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.pdf.dat --vwsig lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.voxel.mgh --vwsigmax lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.voxel.max.dat --oannot lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/cache.th40.pos.sig.ocn.annot --bonferroni 2 --surf white # cwd /lab/yuri/egfrproject # sysname Linux # hostname rodonor.bri.upall.sv # machine x86_64 # FixVertexAreaFlag 1 # FixSurfClusterArea 1 # # Input lh.Cogn.moca.egfr.thickness.15.glmdir/Cogn-egfr-g13/sig.mgh # Frame Number 0 # srcsubj fsaverage # hemi lh # surface white # group_avg_surface_area 82220 # group_avg_vtxarea_loaded 1 # annot aparc # SUBJECTS_DIR /lab/yuri/egfrproject # SearchSpace_mm2 74258.8 # SearchSpace_vtx 144277 # Bonferroni 2 # Minimum Threshold 4 # Maximum Threshold infinity # Threshold Sign pos # AdjustThreshWhenOneTail 1 # CW PValue Threshold: 0.05 # Area Threshold 0 mm^2 # CSD thresh 4.000000 # CSD nreps 10000 # CSD simtype null-z # CSD contrast NA # CSD confint 90.000000 # Overall max 1e+10 at vertex 0 # Overall min 0 at vertex 8 # NClusters 1 # FixMNI = 0 # # ClusterNo Max VtxMax Size(mm^2) MNIX MNIY MNIZ CWP CWPLow CWPHi NVtxs WghtVtx Annot 1 10000000000.0000 0 74258.42 -36.8 -18.3 64.5 0.00020 0.00000 0.00040 144276 1442760045363200.00 precentral
I feel that something is wrong in there, unless you think that it is possible that the slope difference manifests as a global effect for every contrast. It really seems to happen to happen specifically with this variable, as when replacing this variable by another, I can generate specific clusters that do not cover the whole cortex. Here is the terminal output from mri_glmfit when I run it on my "problematic" variable:
yuri@rodonor:/lab/yuri/egfrproject$ mri_glmfit --y lh.Cogn.moca.egfr.thickness.15.mgh --fsgd analysis/egfr-Cogn-moca-egfr.fsgd dods --C analysis/Cogn-egfr-g12.mtx --C analysis/Cogn-egfr-g13.mtx --C analysis/Cogn-egfr-g23.mtx --surf fsaverage lh --cortex --glmdir lh.Cogn.moca.egfr.thickness.15.glmdir gdfRead(): reading analysis/egfr-Cogn-moca-egfr.fsgd INFO: DeMeanFlag keyword not found, DeMeaning will NOT be done. Continuous Variable Means (all subjects) 0 Age 60.1017 7.57085 1 Bmi 26.8664 4.97535 2 FRS 10.9088 9.29652 3 wm 1642.17 1761.49 4 educ 3.48198 0.959607 5 moca 27.2733 2.25488 Class Size and Means of each Continuous Variable 1 g1gender0 324 57.7939 25.8998 5.0538 1164.8920 3.4753 27.6883 2 g1gender1 309 58.2326 27.0854 14.3098 1722.7615 3.4822 26.9450 3 g2gender0 311 61.0777 26.8550 6.1809 1492.9781 3.4084 27.6785 4 g2gender1 345 62.4106 27.2979 16.8165 2059.6704 3.5391 26.8986 5 g3gender0 20 63.1610 27.9590 6.8020 1252.0200 3.4500 27.4000 6 g3gender1 23 67.2335 30.2713 26.5796 3377.0609 3.7391 25.8696 INFO: gd2mtx_method is dods Reading source surface /lab/yuri/FreeSurfer/fsaverage/surf/lh.white Number of vertices 163842 Number of faces 327680 Total area 65417.000000 AvgVtxArea 0.399269 AvgVtxDist 0.721953 StdVtxDist 0.195472
7.3.2 cwd /lab/yuri/egfrproject cmdline mri_glmfit --y lh.Cogn.moca.egfr.thickness.15.mgh --fsgd analysis/egfr-Cogn-moca-egfr.fsgd dods --C analysis/Cogn-egfr-g12.mtx --C analysis/Cogn-egfr-g13.mtx --C analysis/Cogn-egfr-g23.mtx --surf fsaverage lh --cortex --glmdir lh.Cogn.moca.egfr.thickness.15.glmdir sysname Linux hostname rodonor.bri.upall.sv machine x86_64 user yuri FixVertexAreaFlag = 1 UseMaskWithSmoothing 1 OneSampleGroupMean 0 y /lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.mgh logyflag 0 usedti 0 FSGD analysis/egfr-Cogn-moca-egfr.fsgd labelmask /lab/yuri/FreeSurfer/fsaverage/label/lh.cortex.label maskinv 0 glmdir lh.Cogn.moca.egfr.thickness.15.glmdir IllCondOK 0 ReScaleX 1 DoFFx 0 Creating output directory lh.Cogn.moca.egfr.thickness.15.glmdir Loading y from /lab/yuri/egfrproject/lh.Cogn.moca.egfr.thickness.15.mgh ... done reading. INFO: gd2mtx_method is dods Saving design matrix to lh.Cogn.moca.egfr.thickness.15.glmdir/Xg.dat Computing normalized matrix Normalized matrix condition is 6285.08 Matrix condition is 8.72285e+09 Found 149955 points in label. Pruning voxels by thr: 1.175494e-38 Found 144277 voxels in mask Saving mask to lh.Cogn.moca.egfr.thickness.15.glmdir/mask.mgh Reshaping mriglm->mask... search space = 71879.345725 DOF = 1290 Starting fit and test Fit completed in 28.4991 minutes Computing spatial AR1 on surface WARNING: ar1 = 0 <= 0. Setting fwhm to 0. Residual: ar1mn=0.000000, ar1std=0.000000, gstd=0.000000, fwhm=0.000000 Writing results Cogn-egfr-g12 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiency Cogn-egfr-g13 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiency Cogn-egfr-g23 maxvox sig=1e+10 F=0 at index 0 0 0 seed=1679933797 Computing efficiency mri_glmfit done
Many thanks,
Yuri
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu