Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-08 Thread Dan Levitas
External Email - Use Caution

Hi Kersten,

If that's alright with you then that would be great. I completely accept if
my threshold is accurate and leaves no significant findings, I just can't
find a comparable threshold on this forum or elsewhere with such an
elevated threshold value.

I can touch base next week to see what you need from me.

Thanks again,

Dan

On Tue, May 7, 2024 at 3:09 PM Diers, Kersten /DZNE 
wrote:

> Hi Dan,
>
> I can see no obvious issues at the moment, but am happy to take a closer
> look when I am back in office next week.
>
> The fslmer tool ist just an R Implementation of the Matlab scripts, so I
> don't see any need to use them in your case.
>
> Best,
>
> Kersten
>
> Gesendet von Outlook für Android 
> <https://secure-web.cisco.com/1KzII-MfH6rTxaOnzZUTUvJp9x_boMj6aQnEUUoTp8Re7Rr4eIbAOsmWUNCD24Q5G2YKnZkeA0beqW82swgVNn2aqBFx7EPhpOPW04GRnGaUy4HKeICmF-VMmq8A0rhPudf0SxA-Fw96fprYmVQTZEL8E3HcJ1VC3pHHl05ikGCDPwtshhXoQrepPZD7xQ-Tj51zjpVNADfYys9RLESo-m915sEalCZnBywiajA4ynomnRYT3jWgV5StqFNJ7K-Sky_XkJnneJewTvCR_j6I1NPgbBYWAw_kgZfMDihgni24Z0d8xyewc5BNfDNxQfU2HiLkjcTh7ymFt6BEzz3Zg8A/https%3A%2F%2Faka.ms%2FAAb9ysg>
>
> --
> *Von:* Dan Levitas 
> *Gesendet:* Dienstag, Mai 7, 2024 7:11:58 PM
> *An:* djlevitas...@gmail.com 
> *Cc:* kersten.di...@dzne.de ;
> mreu...@mgh.harvard.edu ;
> freesurfer@nmr.mgh.harvard.edu 
> *Betreff:* Re: [Freesurfer] Lingering questions for Longitudinal
> spatiotemporal LME analysis
>
> CAUTION: This email originated from outside of DZNE. Do not click links
> or open attachments unless you recognize the sender and know the content is
> safe.
> ACHTUNG: Dies ist eine externe E-Mail, bitte seien Sie vorsichtig beim
> Anklicken von Links oder Öffnen von Anhängen
>
> Hi Kersten & Martin,
>
> I just wanted to ping this thread again, as I'm still unsure about my pcor
> value (4.4) that I'm getting. I've seen other posts where the threshold
> (thmin) value specified in functions such as *mri_surfcluster* are around
> 2 (corresponding to a p-value of 0.01) when threshold *sig.mgh file(s).
> Given that I'm interested in both right and left hemispheres, I'm surprised
> that my single threshold value to account for both hemispheres is so high
> relative to others posts I've come across in the forum. I seem to have
> followed the LME approach correctly (
> https://secure-web.cisco.com/1SQ58WEznZe-ibw3QO19omrHSeej1iX-z28jkMlUtsQ61ntFqO78Z5WsmZPKSefBlApX7ijnNUsVb2PiYTMcLSHgq5Hf73E1qeczBabjq91RDS_J8NHpKFXZcedng6CSw5Dslno59UqFqwqKe0MlynvG0fLgW9CmBvYVyJOMfjqOkUnj-mZQrmtPHn6QGW9EgT6h77RTNNDYi3JzDqC5D-8yvOGOGy_rD2YAqFsyCnmAEdNhiGyU9zP2ii1jchj6eNZzKhgEp6ddY9VNl7yxVdP8JVkPxnFrj87WLBBrvjJrY7zXnrji5tdpZjvFiwVJQ/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FLinearMixedEffectsModels)
>  but
> I'm unsure if I've done something that has resulted in an elevated pcor
> value.
>
> Martin had recommended the *fslmer* tool (
> https://secure-web.cisco.com/1k8MMiLU-B44BypnewP6obBaoWvRatpcAdkGjbKYO0VGEedf5voupfVkhQXTbs8FThmGd4k5YzTCjcadNDPYbJvVhxCb-iyEmORVnucke7TNUZJKLtAvZmqGquU-VGxTC1N3bTuFZox3yd6f3tKd1Rk37nNQ7paxYwYXE-abGIb4qGHlxAecu3On7dDBTVotVlBChle8YVCs1qrJSKBkOe9Szvup6SomFsZzegV5ZSHpBJnVpNgH6vZYwY_Si4OOvW2M1ZhCLPfN_3zy75ccIM-x39bDlZKH9EWWAEIqYmvpVs6mp4CuDMHgJdI5t19o9rFDy-P4Gw8E3bHc8IJLjSA/https%3A%2F%2Fgithub.com%2Fdeep-mi%2Ffslmer),
>  I'd be happy to use that instead if
> it's more current and the preferred tool for this kind of analysis.
>
> Thanks again,
>
> Dan
>
>
___
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. 


Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-07 Thread Dan Levitas
External Email - Use Caution

Hi Kersten & Martin,

I just wanted to ping this thread again, as I'm still unsure about my pcor 
value (4.4) that I'm getting. I've seen other posts where the threshold (thmin) 
value specified in functions such as mri_surfcluster are around 2 
(corresponding to a p-value of 0.01) when threshold *sig.mgh file(s). Given 
that I'm interested in both right and left hemispheres, I'm surprised that my 
single threshold value to account for both hemispheres is so high relative to 
others posts I've come across in the forum. I seem to have followed the LME 
approach correctly 
(https://secure-web.cisco.com/1P1DqCgATuRJ8Gb_Cv23uM_tkjhG63bDl2SmrFrqCZVQtvVbHQS8mBMjen-kyKVz-FHDOZkAsJGG1DVRGpaFKTeDjg018Mg7Us0gCiJuSt9wg8P0AVc4qSxJSnKSMX6mnBthVdKpPGHWNhlm54QJHIPPywgoXMjN_75H-aApJpFyRuFMwk-5fsy7NNGvq6Bt7D_aTkcmqOCRPc0Qhtao7PTC1Wa647zPjfC5WMvogY318nyXI-NDKST7SgFOO8lrWe4OOR1B8D6vY3hvbW60vWm_asRrwMN5eaQ4dmhsyeCVMQB6pM_C2cmoEkNkH90ic-sFaG5UcQPlLLrLXyH_9Ww/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FLinearMixedEffectsModels
 
)
 but I'm unsure if I've done something that has resulted in an elevated pcor 
value. 

Martin had recommended the fslmer tool 
(https://secure-web.cisco.com/1f2ZYTXcSbFY4HqsjtbVZ5WFtQdhPr_P5UgrBHbi4cv6tXzH9AkMoC49SJidvN8KOesUL__-7wJaz-w-YBO9-JLSgN-s66cA_ATb3O9uESFLHsGDAHIbpXGV0NQzjMbccK9zFntec0iXjIoPF7pS67PhEIMRzIXxcsGD0vhclVwy1UQRFHr1IeNdNkvX57ShVW4OFh4LlDgaf5pdSCwvZw02TguHSSdl2cDidGQzWF_BZATX7IJkhDlP6JYZOLRlxCZmGhc6MdZhqsffzL7jzj64OW0O_fkZFOIFXlEzv780lDOHQINb51LAEeV7Ub0GsuwuuqNOHogzoUM9c0iLSIw/https%3A%2F%2Fgithub.com%2Fdeep-mi%2Ffslmer
 
),
 I'd be happy to use that instead if it's more current and the preferred tool 
for this kind of analysis. 

Thanks again,

Dan___
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 
 .
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. 


Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-05 Thread Dan Levitas
External Email - Use Caution

Hi Kersten,

Thanks for this helpful summary. 

It seems then that it’s best to apply the threshold to the *sig.mgh file and 
visualize its results since it contains the sign that specifies the direction 
of the interaction effect. Assuming this is the case, would an appropriate 
visualization of the results in Freeview be the following?

freeview

\
-f 
$SUBJECTS_DIR/fsaverage/surf/lh.pial:overlay=lh_sig.mgh:overlay_threshold=4.4,10
 \
-f 
$SUBJECTS_DIR/fsaverage/surf/rh.pial:overlay=rh_sig.mgh:overlay_threshold=4.4,10
 \
--viewport 3d

Where the pcor value is 4.4 (pth = 0.38474), based on the LME 
spatiotemporal tutorial, including both hemispheres. This appears overly 
strict; if I go to the Configure Overlay panel in Freeview and adjust the min 
Threshold value to 97.5 % (Use percentile), I get some results. I want to 
ensure that I’m applying the correction properly. 

Thanks,

Dan

___
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 
 .
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. 


Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-03 Thread Diers, Kersten /DZNE
External Email - Use Caution

Hi Dan,

excuse the late response; regarding your remaining questions:

1)
This sounds correct to me, pcor is the corrected threshold that can be applied 
to the sig.mgh files.

2)
If I am not mistaken, the spval file should be equivalent to the sig file, at 
least for two-sided tests (the default), and with the exception that the sig 
file is at the -log10 scale and may have a sign attached to it to indicate the 
direction of effects. Since the spval file is, if I recall correctly, plain 
p-values, one could use the pth value to set a threshold for this file.
This means that we don't transform the p-values to achieve multiple comparison 
correction, but instead use a stricter threshold that controls the FDR2 at the 
0.05 level.

Best regards,

Kersten

On Thu, 2024-05-02 at 14:25 -0400, Dan Levitas wrote:
> CAUTION: This email originated from outside of DZNE. Do not click
> links or open attachments unless you recognize the sender and know
> the content is safe.
> ACHTUNG: Dies ist eine externe E-Mail, bitte seien Sie vorsichtig
> beim Anklicken von Links oder Öffnen von Anhängen
>
>
> External Email - Use Caution
>
> Hi Martin,
>
> Thanks for the response!
>
> After my original post I went through things more carefully based on
> my two original two questions and made a follow-up post here
> (https://secure-web.cisco.com/19ziz4OS6HL3HuOwgHLcrspNdIovd6NTUuIdpJ-
> mDFOvCAyWs2kPDBlUfdSjbT8fclH9nL7GIu1MIetcqQwD2s6-5_CVIvLCVZ6V0NHWw83d
> N7z4bxX8JjTlz4F5ySCoY2Hn-W5BAu721AwV6QhGaqXBgr32xC1Hj1I1rKrQTyQlP1eIg
> 9Gw3g91iL5agTdIsuQfhuCLS5fDVYGvek_rQh6ZDb-tutbyEWAlZ7ea8enpBmRCBEaMTH
> GC1pIKz_9aNARmcDOkjf-Znc91tyjFrHT7suqi_CYkPmpMZGFa4URHOcVwpqegNeEb-sV
> 6X4R-YqiERw6UNMAaIXGQAFjAQ4Q/https%3A%2F%2Fwww.mail-archive.com%2Ffre
> esurfer%40nmr.mgh.harvard.edu%2Fmsg76783.html) with two final
> questions. The gist of these is that I’m unsure how to apply my
> multiple comparisons (for both hemispheres) to the analysis and
> subsequent visualization. Do you have any guidance on how I should
> proceed.
>
> Much appreciated,
>
> Dan
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1LHUjF6lGiO0A_W8DzYIsDHPaOt_YTva_X54MgKxpLSJTSOqiWF7slk83nenW6rSXYuTL9qgqc8BseK5Ie4OI5OFoEG93ZOwBIiQLRRzG4wMIPzafMuZt5WxKHCfPvBIqZ7ZROU94XluuY35FwLB8am1dbWKV71IBGZybpydelE5fBNopyPRMf366iW-r9F86bw5c5u0E7dPtSLkaUHyBbBKbbZEm4RKmawF9HgaudMetuDo6rT5cMnvsRNbU_pLivoib2yExlG-w_eUOZr7jzXMK7PJRqeyxbmA3qGs_7XmYKEFJUSgkxoDEwck7fWjX/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
> 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://secure-web.cisco.com/1-szKGklf53Nq0cAe1SZt29jWujzLSt_c_JkGiddumZxTQ5YNhdp0n_gRQrsFXwXDlX4jKpE0kzJ4o0a7tO4r32IE3AbFs0ghqxTnMqveSmsWGpDD9sXS63XwHBNQkp8DKPboB1PDTE5Xy15oZVtPadYFFsbKbqaV6aTAGOonTwcBItsFshFTsnqqAptwilytbALmYEf9MP7E6hZ2sN1DlBWh66vXrpiosqi3BQAzCppnq0SqgIxYcDsSvyoWxE18J9m9qmhM-6vVY6Qij7A53c-hRjFsfN8ZWfcvk_mxcTRpggFZmLjnekpO_3eG5nHd/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline
>  
> 
> .
> 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.

___
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 

Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-02 Thread Reuter, Martin,Ph.D.
Hi Dan,

I have not worked with this code in a decade, but Kersten in my group maintains 
our  R package of it ( see https://github.com/deep-mi/fslmer ). I will bring 
this to his attention.

Basically I think you determine the joint p-threshold across hemispheres and 
convert it to FreeSurfer ( - log10 pth) and use that value as a threshold when 
plotting the original p-values. That way you only need one threshold for the 
full plot, rather than two different ones (or the more pessimistic of the two).

Also you may be interested in our whippersnappy python tool to generate nice 
looking screenshots of the surface overlay:
https://github.com/Deep-MI/whippersnappy

which is pip installable.

Best, Martin

On 2. May 2024, at 20:25, Dan Levitas  wrote:


Hi Martin,

Thanks for the response!

After my original post I went through things more carefully based on my two 
original two questions and made a follow-up post here 
(https://secure-web.cisco.com/1sMx-dupqFSyAsxsQl8ukXwR4v0-vTUkX2pc5vfwlqp166rCrDoo2bdx6p4keFMRMtTwBjqZmzCoopCuxETJGlS8kVcVUlFiUtWqouZifh-kkm5McZTXjC343IuxhPxggRZIGBfOCndTyBEfHU5yg-L0SF7Jk48ZP-_Yqg9JiZoQkXi347bobVlhhfUqU5umz6cI2eBD7bplC11HyJwUubhLdjnAYGV4QPy_JoqteaGamkmGiiirkesm6JsOmE4dUgh5w8JJfJIwHhiSus176NtxI70y9Cnc5-fIyFxbJ4NUpR41z8diD-6jjtGRt3yoMyyevPtGsNu9rgHK_-JalrQ/https%3A%2F%2Fwww.mail-archive.com%2Ffreesurfer%40nmr.mgh.harvard.edu%2Fmsg76783.html)
 with two final questions. The gist of these is that I’m unsure how to apply my 
multiple comparisons (for both hemispheres) to the analysis and subsequent 
visualization. Do you have any guidance on how I should proceed.

Much appreciated,

Dan

___
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 
 .
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. 


Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-02 Thread Dan Levitas
External Email - Use Caution

Hi Martin,

Thanks for the response!  

After my original post I went through things more carefully based on my two 
original two questions and made a follow-up post here 
(https://secure-web.cisco.com/19ziz4OS6HL3HuOwgHLcrspNdIovd6NTUuIdpJ-mDFOvCAyWs2kPDBlUfdSjbT8fclH9nL7GIu1MIetcqQwD2s6-5_CVIvLCVZ6V0NHWw83dN7z4bxX8JjTlz4F5ySCoY2Hn-W5BAu721AwV6QhGaqXBgr32xC1Hj1I1rKrQTyQlP1eIg9Gw3g91iL5agTdIsuQfhuCLS5fDVYGvek_rQh6ZDb-tutbyEWAlZ7ea8enpBmRCBEaMTHGC1pIKz_9aNARmcDOkjf-Znc91tyjFrHT7suqi_CYkPmpMZGFa4URHOcVwpqegNeEb-sV6X4R-YqiERw6UNMAaIXGQAFjAQ4Q/https%3A%2F%2Fwww.mail-archive.com%2Ffreesurfer%40nmr.mgh.harvard.edu%2Fmsg76783.html)
 with two final questions. The gist of these is that I’m unsure how to apply my 
multiple comparisons (for both hemispheres) to the analysis and subsequent 
visualization. Do you have any guidance on how I should proceed.

Much appreciated,

Dan

___
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 
 .
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. 


Re: [Freesurfer] Lingering questions for Longitudinal spatiotemporal LME analysis

2024-05-02 Thread Reuter, Martin,Ph.D.
Hi Dan,

a) yes
b) yes

Best, Martin


On 22. Apr 2024, at 17:09, Dan Levitas  wrote:


Hello,

I've been following the FreeSurfer longitudinal LME analysis tutorial 
(MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" 
claiming to be 
https://surfer.nmr.mgh.harvard.edu/fswiki/LinearMixedEffectsModels),
 which has been excellent; however I have a few lingering questions pertaining 
to my specific analysis. For reference, I am interested in assessing rates of 
longitudinal atrophy in each of my two groups (0=controls, 1=clinical). 
Regarding what I've currently done:

1). My Qdec file contains 4 columns: fsid, fsid_base, time(years), group

2). I followed the steps to create the appropriate M matrix, and since my 
preliminary analysis is simply to create a group x time linear model, my design 
matrix is X = [ones(length(M),1) M M(:,1).*M(:,2)]; and my contrast is CM = [0 
0 0 1]

3). I've followed the pipeline for the lme_mass_fit_EMinit, lme_mass_RgGrow, 
and lme_mass_fit_Rgw functions.

4). I'm skipping the model comparison steps, as I prefer my model with the two 
random effects (intercept, time).

5). Get stats (F_lhstats = lme_mass_F(lhstats, CM), applied multiple comparison 
correction ([detvtx,sided_pval,pth] = 
lme_mass_FDR2(F_lhstats.pval,F_lhstats.sgn,lhcortex,0.05,0); and saved the 
sided p-values.

My questions are:

a). Since I'm interested in both hemispheres and the tutorial only assesses the 
left, do I need to do step #3 with the right hemisphere data?

b). Would I need to do the last step in the tutorial to get a single threshold 
for both hemispheres and then perform the analysis this way?

P = [ F_lhstats.pval(lhcortex) F_rhstats.pval(rhcortex) ];
G = [ F_lhstats.sgn(lhcortex) F_rhstats.sgn(rhcortex) ];
[detvtx,sided_pval,pth] = lme_mass_FDR2(P,G,[],0.05,0);

pcor = -log10(pth)

Thank you for the clarification.

Dan





___
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
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 
 .
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.