Re: [Freesurfer] mri_glmfit ill-conditioned matrix question {Disarmed}

2019-10-30 Thread Greve, Douglas N.,Ph.D.
I'm not sure what you are asking. What do you mean you want to compare 
the correlation maps between the two groups? If you just want to look at 
them, then set up contrasts for each.

On 10/28/2019 3:36 PM, Nillo, Ryan Michael R wrote:
>  External Email - Use Caution
>
> Thanks, Doug. One more question: I want to see how correlated my covariate 
> ROI is with LGI and compare the correlation maps between the two groups. Is 
> my glmfit command the correct setup? I have tried running glmfit on a 
> different fsgd and contrast matrix with only one of the two groups and have a 
> pcc.mgh for that analysis. When I compare that to the pcc.mgh I get from my 
> original analysis for that same group, the value at each vertex is slightly 
> different.
>
> Ryan Michael Nillo
> UCSF Department is Radiology and Biomedical Imaging
> Lab for Precision Neuroimaging
> Staff Research Associate 1
>
>> On Oct 28, 2019, at 11:17, Greve, Douglas N.,Ph.D.  
>> wrote:
>>
>> Yes
>>
>>> On 10/28/19 1:04 PM, Nillo, Ryan Michael R wrote:
>>> Am I correct in assuming this results in z-scoring/normalizing the
>>> covariates?
>>>
>>> Ryan Michael Nillo
>>> Staff Research Associate I
>>> University of California San Francisco
>>> Department of Radiology and Biomedical Imaging
>>>
 On Oct 28, 2019, at 7:33 AM, Greve, Douglas N.,Ph.D.
 mailto:dgr...@mgh.harvard.edu>> wrote:

 My guess is that your covariates have almost no range to them and so
 look like constant (similar to columns 1 and 2). You can try
 demeaning and rescaling the covariates. You can do this by hand and
 create a new FSGD file or you can add the following lines anywhere in
 the fsgd:
 RescaleFlag 1
 DemeanFlag 1


 On 10/26/19 10:45 PM, Nillo, Ryan Michael R wrote:
> Hello,
>
> I ran mri_glmfit with the following fsgd file:
>
> GroupDescriptorFile 1
> Title CJD
>
> Class MM1_MV1
> Class MV2_VV2
>
> Variablesfrontal
>
> Input7693MV2_VV22.930667
> Input11985MV2_VV22.410333
> Input13082MV2_VV22.529333
> Input13425MV2_VV22.593667
> Input13667MM1_MV12.628667
> Input13900MM1_MV12.675333
> Input14094MM1_MV12.549333
> Input15566MV2_VV22.67
> Input15999MM1_MV12.641
> Input16714MV2_VV22.643
> Input16848MV2_VV22.63
> Input16952MV2_VV22.516
> Input7693aMV2_VV23.054
> Input11985aMV2_VV22.42
> Input13082aMV2_VV22.454
> Input13425aMV2_VV22.602
> Input13667aMM1_MV12.604333
> Input13900aMM1_MV12.601333
> Input14094aMM1_MV12.52
> Input15566aMV2_VV22.71
> Input15999aMM1_MV12.584333
> Input16714aMV2_VV22.67
> Input16848aMV2_VV22.53
> Input16952aMV2_VV22.486
>
> My two contrast matrices are:
> one.mtx = [ 0 0 1 0 ]
> two.mtx = [ 0 0 0 1 ]
>
> When running the mri_glmfit command "*mri_glmfit --glmdir
> new.frontal.lgi --fsgd new.frontal.fsgd.txt --fwhm 30 --surf
> fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx --C two.mtx*”, I
> get the following output:
>
> INFO: gd2mtx_method is dods
> Saving design matrix to new.frontal.lgi/Xg.dat
> Computing normalized matrix
> Normalized matrix condition is 12820.7
> Design matrix --
>   0.0   1.0   0.0 2.93067;
>   0.0   1.0   0.0 2.41033;
>   0.0   1.0   0.0 2.52933;
>   0.0   1.0   0.0 2.59367;
>   1.0   0.0   2.62867 0.0;
>   1.0   0.0   2.67533 0.0;
>   1.0   0.0   2.54933 0.0;
>   0.0   1.0   0.0 2.7;
>   1.0   0.0   2.64100 0.0;
>   0.0   1.0   0.0 2.64300;
>   0.0   1.0   0.0 2.63000;
>   0.0   1.0   0.0 2.51600;
>   0.0   1.0   0.0 3.05400;
>   0.0   1.0   0.0 2.42000;
>   0.0   1.0   0.0 2.45400;
>   0.0   1.0   0.0 2.60200;
>   1.0   0.0   2.60433 0.0;
>   1.0   0.0   2.60133 0.0;
>   1.0   0.0   2.52333 0.0;
>   0.0   1.0   0.0 2.71333;
>   1.0   0.0   2.58433 0.0;
>   0.0   1.0   0.0 2.67333;
>   0.0   1.0   0.0 2.5;
>   0.0   1.0   0.0 2.48600;
> 
> ERROR: matrix is ill-conditioned or badly scaled, condno = 12820.7
> 
> Possible problem with experimental design:
> Check for duplicate entries and/or lack of range of
> continuous variables within a class.
> If you seek help with this problem, make sure to send:
>1. Your command line:
>  mri_glmfit --glmdir new.frontal.lgi --fsgd new.frontal.fsgd.txt
> --fwhm 30 --surf fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx
> --C two.mtx
>2. The FSGD file (if using one)
>3. And the 

Re: [Freesurfer] mri_glmfit ill-conditioned matrix question {Disarmed}

2019-10-28 Thread Nillo, Ryan Michael R
External Email - Use Caution

Thanks, Doug. One more question: I want to see how correlated my covariate ROI 
is with LGI and compare the correlation maps between the two groups. Is my 
glmfit command the correct setup? I have tried running glmfit on a different 
fsgd and contrast matrix with only one of the two groups and have a pcc.mgh for 
that analysis. When I compare that to the pcc.mgh I get from my original 
analysis for that same group, the value at each vertex is slightly different. 

Ryan Michael Nillo
UCSF Department is Radiology and Biomedical Imaging
Lab for Precision Neuroimaging
Staff Research Associate 1

> On Oct 28, 2019, at 11:17, Greve, Douglas N.,Ph.D.  
> wrote:
> 
> Yes
> 
>> On 10/28/19 1:04 PM, Nillo, Ryan Michael R wrote:
>> Am I correct in assuming this results in z-scoring/normalizing the 
>> covariates?
>> 
>> Ryan Michael Nillo
>> Staff Research Associate I
>> University of California San Francisco
>> Department of Radiology and Biomedical Imaging
>> 
>>> On Oct 28, 2019, at 7:33 AM, Greve, Douglas N.,Ph.D. 
>>> mailto:dgr...@mgh.harvard.edu>> wrote:
>>> 
>>> My guess is that your covariates have almost no range to them and so 
>>> look like constant (similar to columns 1 and 2). You can try 
>>> demeaning and rescaling the covariates. You can do this by hand and 
>>> create a new FSGD file or you can add the following lines anywhere in 
>>> the fsgd:
>>> RescaleFlag 1
>>> DemeanFlag 1
>>> 
>>> 
>>> On 10/26/19 10:45 PM, Nillo, Ryan Michael R wrote:
 Hello,
 
 I ran mri_glmfit with the following fsgd file:
 
 GroupDescriptorFile 1
 Title CJD
 
 Class MM1_MV1
 Class MV2_VV2
 
 Variablesfrontal
 
 Input7693MV2_VV22.930667
 Input11985MV2_VV22.410333
 Input13082MV2_VV22.529333
 Input13425MV2_VV22.593667
 Input13667MM1_MV12.628667
 Input13900MM1_MV12.675333
 Input14094MM1_MV12.549333
 Input15566MV2_VV22.67
 Input15999MM1_MV12.641
 Input16714MV2_VV22.643
 Input16848MV2_VV22.63
 Input16952MV2_VV22.516
 Input7693aMV2_VV23.054
 Input11985aMV2_VV22.42
 Input13082aMV2_VV22.454
 Input13425aMV2_VV22.602
 Input13667aMM1_MV12.604333
 Input13900aMM1_MV12.601333
 Input14094aMM1_MV12.52
 Input15566aMV2_VV22.71
 Input15999aMM1_MV12.584333
 Input16714aMV2_VV22.67
 Input16848aMV2_VV22.53
 Input16952aMV2_VV22.486
 
 My two contrast matrices are:
 one.mtx = [ 0 0 1 0 ]
 two.mtx = [ 0 0 0 1 ]
 
 When running the mri_glmfit command "*mri_glmfit --glmdir 
 new.frontal.lgi --fsgd new.frontal.fsgd.txt --fwhm 30 --surf 
 fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx --C two.mtx*”, I 
 get the following output:
 
 INFO: gd2mtx_method is dods
 Saving design matrix to new.frontal.lgi/Xg.dat
 Computing normalized matrix
 Normalized matrix condition is 12820.7
 Design matrix --
  0.0   1.0   0.0 2.93067;
  0.0   1.0   0.0 2.41033;
  0.0   1.0   0.0 2.52933;
  0.0   1.0   0.0 2.59367;
  1.0   0.0   2.62867 0.0;
  1.0   0.0   2.67533 0.0;
  1.0   0.0   2.54933 0.0;
  0.0   1.0   0.0 2.7;
  1.0   0.0   2.64100 0.0;
  0.0   1.0   0.0 2.64300;
  0.0   1.0   0.0 2.63000;
  0.0   1.0   0.0 2.51600;
  0.0   1.0   0.0 3.05400;
  0.0   1.0   0.0 2.42000;
  0.0   1.0   0.0 2.45400;
  0.0   1.0   0.0 2.60200;
  1.0   0.0   2.60433 0.0;
  1.0   0.0   2.60133 0.0;
  1.0   0.0   2.52333 0.0;
  0.0   1.0   0.0 2.71333;
  1.0   0.0   2.58433 0.0;
  0.0   1.0   0.0 2.67333;
  0.0   1.0   0.0 2.5;
  0.0   1.0   0.0 2.48600;
 
 ERROR: matrix is ill-conditioned or badly scaled, condno = 12820.7
 
 Possible problem with experimental design:
 Check for duplicate entries and/or lack of range of
 continuous variables within a class.
 If you seek help with this problem, make sure to send:
   1. Your command line:
 mri_glmfit --glmdir new.frontal.lgi --fsgd new.frontal.fsgd.txt 
 --fwhm 30 --surf fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx 
 --C two.mtx
   2. The FSGD file (if using one)
   3. And the design matrix above
 Attempting to diagnose further
 SumSq: Min=2.828427 (col 1), Max=10.485683 (col 4)
  ... could not determine the cause of the problem
 
 
 Can anyone give me some insight into what might be going wrong?
 
 Thanks so much,
 
 Ryan Michael Nillo
 Staff Research Associate I
 University of California San 

Re: [Freesurfer] mri_glmfit ill-conditioned matrix question {Disarmed}

2019-10-28 Thread Greve, Douglas N.,Ph.D.
Yes

On 10/28/19 1:04 PM, Nillo, Ryan Michael R wrote:
> Am I correct in assuming this results in z-scoring/normalizing the 
> covariates?
>
> Ryan Michael Nillo
> Staff Research Associate I
> University of California San Francisco
> Department of Radiology and Biomedical Imaging
>
>> On Oct 28, 2019, at 7:33 AM, Greve, Douglas N.,Ph.D. 
>> mailto:dgr...@mgh.harvard.edu>> wrote:
>>
>> My guess is that your covariates have almost no range to them and so 
>> look like constant (similar to columns 1 and 2). You can try 
>> demeaning and rescaling the covariates. You can do this by hand and 
>> create a new FSGD file or you can add the following lines anywhere in 
>> the fsgd:
>> RescaleFlag 1
>> DemeanFlag 1
>>
>>
>> On 10/26/19 10:45 PM, Nillo, Ryan Michael R wrote:
>>> Hello,
>>>
>>> I ran mri_glmfit with the following fsgd file:
>>>
>>> GroupDescriptorFile 1
>>> Title CJD
>>>
>>> Class MM1_MV1
>>> Class MV2_VV2
>>>
>>> Variablesfrontal
>>>
>>> Input7693MV2_VV22.930667
>>> Input11985MV2_VV22.410333
>>> Input13082MV2_VV22.529333
>>> Input13425MV2_VV22.593667
>>> Input13667MM1_MV12.628667
>>> Input13900MM1_MV12.675333
>>> Input14094MM1_MV12.549333
>>> Input15566MV2_VV22.67
>>> Input15999MM1_MV12.641
>>> Input16714MV2_VV22.643
>>> Input16848MV2_VV22.63
>>> Input16952MV2_VV22.516
>>> Input7693aMV2_VV23.054
>>> Input11985aMV2_VV22.42
>>> Input13082aMV2_VV22.454
>>> Input13425aMV2_VV22.602
>>> Input13667aMM1_MV12.604333
>>> Input13900aMM1_MV12.601333
>>> Input14094aMM1_MV12.52
>>> Input15566aMV2_VV22.71
>>> Input15999aMM1_MV12.584333
>>> Input16714aMV2_VV22.67
>>> Input16848aMV2_VV22.53
>>> Input16952aMV2_VV22.486
>>>
>>> My two contrast matrices are:
>>> one.mtx = [ 0 0 1 0 ]
>>> two.mtx = [ 0 0 0 1 ]
>>>
>>> When running the mri_glmfit command "*mri_glmfit --glmdir 
>>> new.frontal.lgi --fsgd new.frontal.fsgd.txt --fwhm 30 --surf 
>>> fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx --C two.mtx*”, I 
>>> get the following output:
>>>
>>> INFO: gd2mtx_method is dods
>>> Saving design matrix to new.frontal.lgi/Xg.dat
>>> Computing normalized matrix
>>> Normalized matrix condition is 12820.7
>>> Design matrix --
>>>  0.0   1.0   0.0 2.93067;
>>>  0.0   1.0   0.0 2.41033;
>>>  0.0   1.0   0.0 2.52933;
>>>  0.0   1.0   0.0 2.59367;
>>>  1.0   0.0   2.62867 0.0;
>>>  1.0   0.0   2.67533 0.0;
>>>  1.0   0.0   2.54933 0.0;
>>>  0.0   1.0   0.0 2.7;
>>>  1.0   0.0   2.64100 0.0;
>>>  0.0   1.0   0.0 2.64300;
>>>  0.0   1.0   0.0 2.63000;
>>>  0.0   1.0   0.0 2.51600;
>>>  0.0   1.0   0.0 3.05400;
>>>  0.0   1.0   0.0 2.42000;
>>>  0.0   1.0   0.0 2.45400;
>>>  0.0   1.0   0.0 2.60200;
>>>  1.0   0.0   2.60433 0.0;
>>>  1.0   0.0   2.60133 0.0;
>>>  1.0   0.0   2.52333 0.0;
>>>  0.0   1.0   0.0 2.71333;
>>>  1.0   0.0   2.58433 0.0;
>>>  0.0   1.0   0.0 2.67333;
>>>  0.0   1.0   0.0 2.5;
>>>  0.0   1.0   0.0 2.48600;
>>> 
>>> ERROR: matrix is ill-conditioned or badly scaled, condno = 12820.7
>>> 
>>> Possible problem with experimental design:
>>> Check for duplicate entries and/or lack of range of
>>> continuous variables within a class.
>>> If you seek help with this problem, make sure to send:
>>>   1. Your command line:
>>>     mri_glmfit --glmdir new.frontal.lgi --fsgd new.frontal.fsgd.txt 
>>> --fwhm 30 --surf fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx 
>>> --C two.mtx
>>>   2. The FSGD file (if using one)
>>>   3. And the design matrix above
>>> Attempting to diagnose further
>>> SumSq: Min=2.828427 (col 1), Max=10.485683 (col 4)
>>>  ... could not determine the cause of the problem
>>>
>>>
>>> Can anyone give me some insight into what might be going wrong?
>>>
>>> Thanks so much,
>>>
>>> Ryan Michael Nillo
>>> Staff Research Associate I
>>> University of California San Francisco
>>> Department of Radiology and Biomedical Imaging
>>>
>>>
>>> External Email - Use Caution
>>>
>>>
>>> ___
>>> Freesurfer mailing list
>>> Freesurfer@nmr.mgh.harvard.edu
>>> *MailScanner has detected a possible fraud attempt from 
>>> "urldefense.proofpoint.com" claiming to be* 
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu 
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.edu_mailman_listinfo_freesurfer=DwICAg=iORugZls2LlYyCAZRB3XLg=-dSNp2WfY7DySdV4_Sqc4m6hoXOmD3OskcWVyhGbe1U=vKhgpt5PEzT-yI2H0mxJSvVsVu8umLM48iQq3tLnYSo=3T7IJN0p7_TTHTPG05lWEjp2P2IbHoD4ZHnsVQn7_OE=
>>  
>>
>
>
> 

Re: [Freesurfer] mri_glmfit ill-conditioned matrix question {Disarmed}

2019-10-28 Thread Nillo, Ryan Michael R
Am I correct in assuming this results in z-scoring/normalizing the covariates?

Ryan Michael Nillo
Staff Research Associate I
University of California San Francisco
Department of Radiology and Biomedical Imaging

> On Oct 28, 2019, at 7:33 AM, Greve, Douglas N.,Ph.D.  
> wrote:
> 
> My guess is that your covariates have almost no range to them and so look 
> like constant (similar to columns 1 and 2). You can try demeaning and 
> rescaling the covariates. You can do this by hand and create a new FSGD file 
> or you can add the following lines anywhere in the fsgd:
> RescaleFlag 1
> DemeanFlag 1
> 
> 
> On 10/26/19 10:45 PM, Nillo, Ryan Michael R wrote:
>> Hello,
>> 
>> I ran mri_glmfit with the following fsgd file:
>> 
>> GroupDescriptorFile 1
>> Title CJD 
>> 
>> Class MM1_MV1 
>> Class MV2_VV2 
>> 
>> Variables  frontal 
>> 
>> Input 7693
>> MV2_VV2 2.930667
>> Input 11985
>> MV2_VV2 2.410333
>> Input 13082
>> MV2_VV2 2.529333
>> Input 13425
>> MV2_VV2 2.593667
>> Input 13667
>> MM1_MV1 2.628667
>> Input 13900
>> MM1_MV1 2.675333
>> Input 14094
>> MM1_MV1 2.549333
>> Input 15566
>> MV2_VV2 2.67
>> Input 15999
>> MM1_MV1 2.641
>> Input 16714
>> MV2_VV2 2.643
>> Input 16848
>> MV2_VV2 2.63
>> Input 16952
>> MV2_VV2 2.516
>> Input 7693a
>> MV2_VV2 3.054
>> Input 11985a
>> MV2_VV2 2.42
>> Input 13082a
>> MV2_VV2 2.454
>> Input 13425a
>> MV2_VV2 2.602
>> Input 13667a
>> MM1_MV1 2.604333
>> Input 13900a
>> MM1_MV1 2.601333
>> Input 14094a
>> MM1_MV1 2.52
>> Input 15566a
>> MV2_VV2 2.71
>> Input 15999a
>> MM1_MV1 2.584333
>> Input 16714a
>> MV2_VV2 2.67
>> Input 16848a
>> MV2_VV2 2.53
>> Input 16952a
>> MV2_VV2 2.486
>> 
>> My two contrast matrices are:
>> one.mtx = [ 0 0 1 0 ]
>> two.mtx = [ 0 0 0 1 ]
>> 
>> When running the mri_glmfit command "mri_glmfit --glmdir new.frontal.lgi 
>> --fsgd new.frontal.fsgd.txt --fwhm 30 --surf fsaverage lh --y 
>> lh.pial_lgi.fwhm0.mgh --C one.mtx --C two.mtx”, I get the following output:
>> 
>> INFO: gd2mtx_method is dods
>> Saving design matrix to new.frontal.lgi/Xg.dat
>> Computing normalized matrix
>> Normalized matrix condition is 12820.7
>> Design matrix --
>>  0.0   1.0   0.0   2.93067;
>>  0.0   1.0   0.0   2.41033;
>>  0.0   1.0   0.0   2.52933;
>>  0.0   1.0   0.0   2.59367;
>>  1.0   0.0   2.62867   0.0;
>>  1.0   0.0   2.67533   0.0;
>>  1.0   0.0   2.54933   0.0;
>>  0.0   1.0   0.0   2.7;
>>  1.0   0.0   2.64100   0.0;
>>  0.0   1.0   0.0   2.64300;
>>  0.0   1.0   0.0   2.63000;
>>  0.0   1.0   0.0   2.51600;
>>  0.0   1.0   0.0   3.05400;
>>  0.0   1.0   0.0   2.42000;
>>  0.0   1.0   0.0   2.45400;
>>  0.0   1.0   0.0   2.60200;
>>  1.0   0.0   2.60433   0.0;
>>  1.0   0.0   2.60133   0.0;
>>  1.0   0.0   2.52333   0.0;
>>  0.0   1.0   0.0   2.71333;
>>  1.0   0.0   2.58433   0.0;
>>  0.0   1.0   0.0   2.67333;
>>  0.0   1.0   0.0   2.5;
>>  0.0   1.0   0.0   2.48600;
>> 
>> ERROR: matrix is ill-conditioned or badly scaled, condno = 12820.7
>> 
>> Possible problem with experimental design:
>> Check for duplicate entries and/or lack of range of
>> continuous variables within a class.
>> If you seek help with this problem, make sure to send:
>>   1. Your command line:
>> mri_glmfit --glmdir new.frontal.lgi --fsgd new.frontal.fsgd.txt --fwhm 
>> 30 --surf fsaverage lh --y lh.pial_lgi.fwhm0.mgh --C one.mtx --C two.mtx 
>>   2. The FSGD file (if using one)
>>   3. And the design matrix above
>> Attempting to diagnose further 
>> SumSq: Min=2.828427 (col 1), Max=10.485683 (col 4)
>>  ... could not determine the cause of the problem
>> 
>> 
>> Can anyone give me some insight into what might be going wrong? 
>> 
>> Thanks so much,
>> 
>> Ryan Michael Nillo
>> Staff Research Associate I
>> University of California San Francisco
>> Department of Radiology and Biomedical Imaging
>> 
>> 
>> 
>> External Email - Use Caution
>> 
>> 
>> 
>> ___
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu 
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer 
>> 
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
>