External Email - Use Caution        

Hello Freesurfer experts,

I am trying to perform a GLM, using the volume of a brain region as a 
covariate. I am doing a two-group, one covariate design. I originally tried to 
use QDEC to facilitate the process and received an error message that the 
mri_glmfit command had failed. I then saw that QDEC was deprecated and followed 
the instructions set out on the freesurfer wiki for doing it manually 
(https://secure-web.cisco.com/1W0gEAYXZeH6XMYzikihrf4Ct-vcV_3e-WmTr1eqTVlVGWz8ZAzr0ToHAdQVWw6seyPj2yu31w7pqzGFZrFu7wQ5so3ZFfYQjKCTQ_ExMc1qL3caPs38GvVhvpKQ2NXDmLYaNxgZkGAilAmdd8JnWqAEkh_EBy23scDzimQ4p5fuMO002JYf6Si2hgy5xDHl5Yf748DEHIe1u3vA-E3BtAxiCGBB67Hm4Dc6xHuUk_Na_DLM_uYMDcy3z8UttfwM1TTMP0_JLn_rmvpcqSqGN2rtaA3UGOE5aOOm0GnQgDXQWm5MIgG9_A0PeUuBfAxRgunRr7ZxcVBapNEIOwCUPdg/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FFsTutorial%2FGroupAnalysisV6.0).

I received the same error message as I had with QDEC on the command line:

ERROR: MatrixResidualForming(): X is not invertable
RD is not invertable n = 1

This only occurs for certain of the brain regions used as covariates; for 
others, the QDEC and command-line streams work perfectly. Additionally, I've 
noticed that if I input different numbers for the covariate values in the fsgd 
file, the command runs smoothly.

I haven't been able to find a similar error on the mailing list, does anyone 
have an idea of how to work around this? I would greatly appreciate it.

Please find attached my fsgd file, and the full log of what happens after I run 
the mri_glmfit command (when it works and when it doesn't)
The hands.fsgd file doesn't work, whereas the hands_works.fsgd file does.

Freesurfer version: 7.2.0, Ubuntu 20.04, Windows WSL

Best wishes,
Alex

--

Alexandre Piot, MSc.
Queen Square Institute of Neurology
President of the Application of Psychedelics Society 
<https://secure-web.cisco.com/1txv4iCOx4-mObxXkQBwlHnKAPMdNbmkUOMySvRIxTq9ls1uXZ8Kl62y3I49HdkLsX6y7u-cbb0hhFAgyYtQiLyvLqmJHRpVile95hsJIW_BkEPsZYU7xlCSImzrBqWQ04vGC-z5o197phurtwnpjWg9swrt2VVrxiiXYGg9bY0RbMOrknb9AaoPwF5FSDuMc0WVXrwnhjXQY6v4i38hVb6sLx6MLR2rCdDLI8W_lEtTFtoddcERVMfMlp1QPST7zgdW1ISSG1NIw0Y7AGPrRMAOgyDEDDbcO5Bw5ZAdy0JZpVjRnYzg9UIT_Svi--kUWS1MEmI_sDO3lstJ-3GIgMQ/https%3A%2F%2Fwww.uclsap.com%2F>
 -- UCL
UNITy 
Project<https://secure-web.cisco.com/11-VCBFrldtskQk64mTlGciM29YjbhiPBFq0qJNEn4t16fq2dpqPk8MULNrPk_hdW3xFgDWoez2dpX7V5EsWwjhjv5xLowcqQlWm8H8z1bfrLct3k0RqTnpX1n8ctYdYTBN4YZweUcivxmxcuvMem-Gc6V7-VqRYMBpF6H6kHTK_UcUi5UnP5yWRqhIkMLWkdPffFie-WcMxkLkdKIpTISAHztKFwrtv1Z0KJlrr03qryskIQu6LNxCa5spVh0LxIs6qkUPD7pRD2E8dl-jERSFNiw0WJygtI9HdMjxfWc8x9C2KVtbdX5UmF1A-hcqoRaqNXrfS42WsaQI_sTTEKdA/https%3A%2F%2Fwww.psychedelicunit.com%2F>


Attachment: mri_glmfit.log
Description: mri_glmfit.log

Attachment: hand.fsgd
Description: hand.fsgd

mri_glmfit --y 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 
--fsgd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hands_works.fsgd
 
--glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 
--surf fsaverage lh --label 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 
--C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-Intercept-volume.mat
 
--C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-volume-lh_cingul-ant_volume-Cor.mat
 
--C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Intercept-volume.mat
 
--C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Cor-volume-lh_cingul-ant_volume.mat
  

gdfRead(): reading 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hands_works.fsgd
 
INFO: DeMeanFlag keyword not found, DeMeaning will NOT be done. 
Continuous Variable Means (all subjects) 
0 lh_G_frontomargin_volume 2404.2 361.981
Class Size and Means of each Continuous Variable
1 GroupAyahuasca 22 2355.0909
2 GroupControl 22 2453.3182 
INFO: gd2mtx_method is dods 
Reading source surface 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/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.2.0 
cwd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 
cmdline mri_glmfit --y 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 --fsgd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hands_works.fsgd
 --glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 --surf fsaverage lh --label 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-volume-lh_cingul-ant_volume-Cor.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Cor-volume-lh_cingul-ant_volume.mat
 
sysname  Linux
hostname Zenbook
   machine  x86_64 
user     psychedelic
FixVertexAreaFlag = 1 
UseMaskWithSmoothing     1 
OneSampleGroupMean 0 
y    
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 
logyflag 0 
usedti  0 
FSGD 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hands_works.fsgd
 
labelmask  
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 
maskinv 0
glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
IllCondOK 0
ReScaleX 1
DoFFx 0 
 Creating output directory 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
Loading y from 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
... done reading.
INFO: gd2mtx_method is dods 
Saving design matrix to 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/Xg.dat
 
Computing normalized matrix 
Normalized matrix condition is 209.313
Matrix condition is 3.24526e+08
Found 148151 points in label.
 Pruning voxels by thr: 1.175494e-38 
Found 146665 voxels in mask
Saving mask to 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/mask.mgh
 
Reshaping mriglm->mask...
search space = 72932.786449
DOF = 40
Starting fit and test
Fit completed in 0.04985 minutes
Computing spatial AR1 on surface
        Residual: ar1mn=0.995918, ar1std=0.002169, gstd=6.327300, fwhm=14.899653
Writing results
lh-Avg-Intercept-volume 
maxvox sig=11.5306  F=97.0993  at  index 154924 0 0    seed=1662639010
lh-Avg-volume-lh_cingul-ant_volume-Cor
maxvox sig=14.4629  F=151.655  at  index 20301 0 0    seed=1662639010
lh-Diff-Ayahuasca-Control-Intercept-volume
maxvox sig=-3.05447  F=12.9196  at  index 64976 0 0    seed=1662639010
lh-Diff-Ayahuasca-Control-Cor-volume-lh_cingul-ant_volume
maxvox sig=3.00408  F=12.6325  at  index 130687 0 0    seed=1662639010
mri_glmfit done
mri_glmfit --y 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 --fsgd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hand.fsgd
 --glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 --surf fsaverage lh --label 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-volume-lh_cingul-ant_volume-Cor.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Cor-volume-lh_cingul-ant_volume.mat
     gdfRead(): reading 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hand.fsgd
 
INFO: DeMeanFlag keyword not found, DeMeaning will NOT be done
Continuous Variable Means (all subjects) 
0 lh_G_cingul_Ant_volume 4311.07 588.108
Class Size and Means of each Continuous Variable
1 GroupAyahuasca 22 4295.8182
2 GroupControl 22 4326.3182
INFO: gd2mtx_method is dods
Reading source surface 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/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.2.0 
cwd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 
cmdline mri_glmfit --y 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 --fsgd 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hand.fsgd
 --glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 --surf fsaverage lh --label 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Avg-volume-lh_cingul-ant_volume-Cor.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Intercept-volume.mat
 --C 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/contrasts/lh-Diff-Ayahuasca-Control-Cor-volume-lh_cingul-ant_volume.mat
 
sysname  Linux 
hostname Zenbook
machine  x86_64 
user     psychedelic 
FixVertexAreaFlag = 1  
UseMaskWithSmoothing     1 
OneSampleGroupMean 0 
y    
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
 
logyflag 0
usedti  
FSGD 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/hand.fsgd
  
labelmask  
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/fsaverage/label/lh.aparc.label
 
maskinv 0 
glmdir 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
 
IllCondOK 0  
ReScaleX 1  
DoFFx 0 
Creating output directory 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi
  
Loading y from 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/y.mgh
... done reading. 
INFO: gd2mtx_method is dods 
Saving design matrix to 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/Xg.dat
 
Computing normalized matrix  
Normalized matrix condition is 417.412 
Matrix condition is 2.034e+09
Found 148151 points in label.
 Pruning voxels by thr: 1.175494e-38
Found 146665 voxels in mask
Saving mask to 
/usr/local/freesurfer/7.2.0/subjects/Ayahuasca_Data_paired/qdec/Leftantcingut_LeftHemi/mask.mgh
 
Reshaping mriglm->mask
search space = 72932.786449
DOF = 40
ERROR: MatrixResidualForming(): X is not invertable 
RD is not invertable n = 1 

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is 
addressed.  If you believe this e-mail was sent to you in error and the e-mail 
contains patient information, please contact the Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
<https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail. 

Reply via email to