Re: [Freesurfer] MRI image quality metrics

2023-03-06 Thread Douglas N. Greve
  2. For SNR, you'll have to calculate them as:
1.

Run the recon-all pipeline to process your MRI
data.

2.

Use the mri_binarize tool to create a binary
mask of the ROI in the image.

3.

Use the mri_segstats tool to calculate the
mean and standard deviation of the intensity
values within the ROI.

4.

Then your SNR = mean_intensity/std_of_intensity.


Best,

Avnish



*From:* freesurfer-boun...@nmr.mgh.harvard.edu
 on behalf of
Huang, Yujing 
*Sent:* Tuesday, February 7, 2023 9:09 AM
*To:* Freesurfer support list

*Subject:* Re: [Freesurfer] MRI image quality metrics

Hi,

The following is taken from *MailScanner has detected
a possible fraud attempt from "secure-web.cisco.com"
claiming to be*
https://github.com/ComaRecoveryLab/Lesion_Correction

<https://secure-web.cisco.com/1thfo9hWCJUK_nYfNM9axD5kjhrzv1nVC_cWmWT2aic2ttFqLtKhuhi9E6AA5fXRqlBpbp24-HV_sfbVQik2RJDyE7c9eALg8zbpl340Dwhl2aijQIJcCFqj9K_RZhk5xCVRHURT36bgdsm5C36VxQ3fQh7sVLpsmxKo0Ie0hB8HrgI8Rn7JySIK5iCJZWL9q1OqnFWJgdRUgMDrVlJVf356x-vM1sz0IWVGsGErBQNdxLAYcSvFCTWx0fb6tb1mCw7ljDzERXM7qU-fnbvpV-AKWSuj0eVKouZoNRp8SgTUOIA2mR_VbqAJw9K2PU4OKa4g3f30QsCJpd0U1hcNz7Q/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction>
as mentioned in this paper *MailScanner has detected a
possible fraud attempt from "secure-web.cisco.com"
claiming to be*

https://www.sciencedirect.com/science/article/pii/S2215016120302144

<https://secure-web.cisco.com/1aMzZKpIcKTLwbYP_79ZqCUH8p9h0Xh4xqpm8fsmVREKN8hATdl6DHCSkFDKqidqmKqoAydr5eDqjVLAQDKN0zmR2k2Wckx-sv1P3JgKJVQWfpIVeyrh0tqwnGzqQm3nK9BQGA7rUSYwaCBBjmogAhlrnepeAo1_J0CQXj4rKMM-V_g9sXIIirV1h-sajPjULI9qcQw2orS-vs9tl65xAbfrEtmtZ35-IZO43Wk-1D2CsVkFyKCsuGxT5qcGTg9FV3VSUbHpeA-dKS1qkv8zYKtz4i-JeRm0y4E6YAs_B91ccue5fFsCAMyN4jKTPxkhNk7f7IRaIrbfA6GYyWFCX7A/https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS2215016120302144>

“

Qualitative and Quantitative Assessment of MRI Data

SNR: We calculated SNR for each subject using the
“wm-anat-snr” FreeSurfer tool available in FreeSurfer
v6.0. Voxels from the subject’s normalized T1
(norm.mgz) that containing white matter (WM) as
defined by the subject’s aparc+aseg.mgz are used to
calculate SNR with this tool.

SNR = (mean WM)/(stdev WM)

We ran the following command for each subject:

wm-anat-snr –s

CNR: We calculated CNR for each subject using the
“mri_cnr” FreeSurfer tool available in FreeSurfer
v6.0. This tool finds the average between two CNRs:
the subject’s (1) WM and gray matter (GM) CNR and (2)
gray matter and cerebrospinal fluid (CSF) CNR. The
average CNR is then calculated and reported for each
hemisphere. Finally, the CNR for both hemispheres are
averaged to produce a full brain CNR.

WM-GM CNR = (delta(WM,GM)^2)/(total variance) GM-CSF
CNR = (delta(GM,CSF)^2)/(total variance) Hemisphere
CNR = (WM-GM CNR + GM-CSF CNR) x 2 Full Brain CNR =
(Left Hemisphere CNR + Right Hemisphere CNR) x 2

“

Best,

Yujing

*From:* freesurfer-boun...@nmr.mgh.harvard.edu
 *On Behalf Of
*MANSON ERIC NAAB
*Sent:* Tuesday, February 7, 2023 5:26 AM
*To:* Freesurfer support list

*Subject:* [Freesurfer] MRI image quality metrics

*External Email - Use Caution *

Dear FreeSurfer experts,

Please, I need your assistance and guidance on
calculating the contrast-to-noise ratio (CNR) and
signal-to-noise-ratio (SNR) of White matter, Gray
matter, and CSF of the brain after recon-all.

Thank you

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
*MailScanner has detected a possible fraud attempt
from "secure-web.cisco.co

Re: [Freesurfer] MRI image quality metrics

2023-02-17 Thread fsbuild
External Email - Use Caution

We provide example subjects, like bert, as part of the freesurfer distribution. 
But the install location on the Mac (and linux) is usually write 
protected and so while you can read data from there, you can’t write data 
there.  You can place your own subject data - or copy the subject data 
provided in the fresurfer distribution - to somewhere you can write to like 
your home directory, e.g.
… copy in the data …
$ cd $HOME$ rm -rf subjects$ (cd/Applications/freesurfer/7.1.1; tar cpf - 
subjects) | tar xpf -
… check it is there …
$ ls -dsubjects/bert/statssubjects/bert/stats
… reset SUBJECTS_DIR to the new location where you can both read and write data 
…
$ export SUBJECTS_DIR=$HOME/subjects
… try the command again …
$wm-anat-snr --s bert
- R.
On Feb 17, 2023, at 19:43, MANSON ERIC NAAB enman...@st.ug.edu.gh 
wrote:External Email - Use 
CautionThank you once again for 
your reply.After running the commandwm-anat-snr --s subject 
name to determine the white matter signal-to-noise ratio, I receive an 
error about the output. It fails to write the output. Please, how do I solve 
this?MACs-MacBook-Pro:~ mac$ export 
FREESURFER_HOME=/Applications/freesurfer/7.1.1MACs-MacBook-Pro:~ mac$ export 
SUBJECTS_DIR=$FREESURFER_HOME/subjectsMACs-MacBook-Pro:~ mac$ source 
$FREESURFER_HOME/SetUpFreeSurfer.sh 
freesurfer-darwin-macOS-7.1.1-20200811-8b40551 Setting up environment 
for FreeSurfer/FS-FAST (and FSL)FREESURFER_HOME  
/Applications/freesurfer/7.1.1FSFAST_HOME
/Applications/freesurfer/7.1.1/fsfastFSF_OUTPUT_FORMAT nii.gzSUBJECTS_DIR 
  /Applications/freesurfer/7.1.1/subjectsMNI_DIR   
   /Applications/freesurfer/7.1.1/mniFSL_DIR   
   /Users/mac/fslMACs-MacBook-Pro:~ mac$ cd 
$SUBJECTS_DIRMACs-MacBook-Pro:subjects mac$ wm-anat-snr --s bertERROR: cannot 
write to /Applications/freesurfer/7.1.1/subjects/bert/statsOn Sat, Feb 11, 2023 
at 2:11 PM John Anderson jb19790...@gmail.com 
wrote:External Email - Use 
Cautionexport 
SUBJECTS_DIR=path to your reconsmri_cnr $SUBJECTS_DIR/subject 
name/surf/ $SUBJECTS_DIR/subject name/mri/norm.mgz  
output_CNR.txtwm-anat-snr --s subject name check 
stats/wmsnr.e3.dat the output is snr for the whole white matter.if 
you need snr for every roi in aseg.stats or wmparc.stats, then you can add the 
flag --snr to thecommand mri_segstats as follows:mri_segstats --seg 
mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz --empty --brainmask 
mri/brainmask.mgz --brain-vol-from-seg --excludeid 0 --excl-ctxgmwm --supratent 
--subcortgray --in mri/norm.mgz --in-intensity-name norm --in-intensity-units 
MR --etiv --surf-wm-vol --surf-ctx-vol --totalgray --euler --ctab 
/usr/local/freesurfer/6.0/ASegStatsLUT.txt --subject subjectname 
--snrdo the same for wmparc.stats:mri_segstats --seg mri/wmparc.mgz --sum 
stats/wmparc.stats --pv mri/norm.mgz --excludeid 0 --brainmask 
mri/brainmask.mgz --in mri/norm.mgz --in-intensity-name norm 
--in-intensity-units MR --subject subjectname --surf-wm-vol --ctab 
/usr/local/freesurfer/6.0/WMParcStatsLUT.txt --etiv --snrmake sure to change 
/usr/local/freesurfer/6.0/ASegStatsLUT.txt in the previous command to the 
FS folderon your systemThe last two commands update aseg.stats and 
wmparc.stats. They both will get a new column for SNR values for every roi.On 
Fri, Feb 10, 2023 at 10:25 PM MANSON ERIC NAAB enman...@st.ug.edu.gh 
wrote:External Email - Use 
CautionThank you very much for 
your quick response. I still have a challenge locating the output file after 
running the suggested command(mri_cnr 
$SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz) with my subject.Can 
you please provide me with the full commandfor calculating 
contrast-to-noise ratio and signal-to-noise ratio of white matter, gray matter 
and CSF since am a beginner Or a video link to calculate them.This is what i 
see after running the commandmri_cnr 
/Applications/freesurfer/7.1.1/SUBNEW/PA1//label/lh.cortex.labelmri_cnr -- 
compute the gray/white/csf contrast-to-noise ratio for volumes.usage: mri_cnr 
[options] surf directory vol 1 vol 2 ...usage example 
(assumes fs pipeline has finished for subject subj1): mri_cnr subj1/surf 
subj1/mri/orig.mgzAvailable options:   -s slope_fname dist in 
dist out step in step out: compute slope based on given 
values, write it to slope and offset files labeled slope_fname (e.g., 
`lh.slope_fname.slope.mgz')-t : print only the total CNR to 
stdout (stderr still contains more information)-l logfile: log 
cnr to file logfile. Will contain 8 values in the following order: 
gray_white_cnr, gray_csf_cnr, white_mean, gray_mean, csf_mean, sqrt(white_var), 
sqrt(gray_var), sqrt(csf_var)label lh rh: read 
hemisphere labels from lh and rh  -u, -?, -help : print 
usage information and quit-version : print software version information 
and quit.On Thu, Feb 9, 2023 at 3:46 PM John Anderson 
jb19790...@gmail.com 
wrote:External Email - Use 

Re: [Freesurfer] MRI image quality metrics

2023-02-17 Thread MANSON ERIC NAAB
JECTS_DIR/bert/mri/norm.mgz
>>>>
>>>>
>>>>
>>>>1. For SNR, you'll have to calculate them as:
>>>>   1.
>>>>
>>>>   Run the recon-all pipeline to process your MRI data.
>>>>   2.
>>>>
>>>>   Use the mri_binarize tool to create a binary mask of the ROI in
>>>>   the image.
>>>>   3.
>>>>
>>>>   Use the mri_segstats tool to calculate the mean and standard
>>>>   deviation of the intensity values within the ROI.
>>>>   4.
>>>>
>>>>   Then your SNR = mean_intensity/std_of_intensity.
>>>>
>>>>
>>>> Best,
>>>>
>>>> Avnish
>>>> --
>>>> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
>>>> freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Huang, Yujing <
>>>> yhuan...@mgh.harvard.edu>
>>>> *Sent:* Tuesday, February 7, 2023 9:09 AM
>>>> *To:* Freesurfer support list 
>>>> *Subject:* Re: [Freesurfer] MRI image quality metrics
>>>>
>>>>
>>>> Hi,
>>>>
>>>>
>>>>
>>>> The following is taken from *MailScanner has detected a possible fraud
>>>> attempt from "secure-web.cisco.com" claiming to be*
>>>> https://secure-web.cisco.com/11mu5Z92C_e3q1BsN_m-fxmPfgVaI5fAjVEiKyY9ld5O9dLigNZtR9YeJX_NQa7I5Ng6dqjkK-N3HmLAhT3OanSixht-Or_WvSXP-xJQIrCtBo80BLCcndYsGRDr9NpodPe2WDwT5BjJTVWGCPsPRggd29l0COgyLIHekuAr3pXd7bW55PXLoXYrNIlT2tjCvkIkrS08mxgbHuHrRnCbLfVTUJq2ELKfC3vYn1HQHOLorfGhKSSLd-RA16rTT7VNwZfQM9qjL8Lt1WRPRXmLflNH7fz8pIaDdMss2MbkG7eqgFo6Gsa4s6x1D2NTU6av7CZOOHU5Lfmlouv0qNJMO0jPlnZmcJ3m7g6RXp23tLlQ/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction
>>>> <https://secure-web.cisco.com/1thfo9hWCJUK_nYfNM9axD5kjhrzv1nVC_cWmWT2aic2ttFqLtKhuhi9E6AA5fXRqlBpbp24-HV_sfbVQik2RJDyE7c9eALg8zbpl340Dwhl2aijQIJcCFqj9K_RZhk5xCVRHURT36bgdsm5C36VxQ3fQh7sVLpsmxKo0Ie0hB8HrgI8Rn7JySIK5iCJZWL9q1OqnFWJgdRUgMDrVlJVf356x-vM1sz0IWVGsGErBQNdxLAYcSvFCTWx0fb6tb1mCw7ljDzERXM7qU-fnbvpV-AKWSuj0eVKouZoNRp8SgTUOIA2mR_VbqAJw9K2PU4OKa4g3f30QsCJpd0U1hcNz7Q/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction>
>>>> as mentioned in this paper *MailScanner has detected a possible fraud
>>>> attempt from "secure-web.cisco.com" claiming to be*
>>>> https://secure-web.cisco.com/1B4hsBrTDj5uPk3jWb9xQYanyveclqTz1M10dOxs_Ae2pD3wHbnBV1NPXn8K1T5WgBN1FRo_GNRN5vlo8iE84OarChCbmYrpB43NArlQseCklPEU557f0auOY5k463WQIareBIEANJ7dPRTnWAIPObAo_PUzm505qDwXi9Gq074QTiFhHMxScbFHVsF3ZiOwwKQFKmnWYYPNsvdVmTSYQdNOpggYByzrAzsxuuyStVcjHizLgnUh3bXZFJw4DhMU4nexoKYGHbqNC5aR9aBQKGqkwo9sGnxSrPOgOhYMfA7OSITSdm2kCBw1XJCJwFjBQdiBPDhrWcL6VKhETH2fugTbItgiGbHmNOeBaKuKJr3s/https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS2215016120302144
>>>> <https://secure-web.cisco.com/1aMzZKpIcKTLwbYP_79ZqCUH8p9h0Xh4xqpm8fsmVREKN8hATdl6DHCSkFDKqidqmKqoAydr5eDqjVLAQDKN0zmR2k2Wckx-sv1P3JgKJVQWfpIVeyrh0tqwnGzqQm3nK9BQGA7rUSYwaCBBjmogAhlrnepeAo1_J0CQXj4rKMM-V_g9sXIIirV1h-sajPjULI9qcQw2orS-vs9tl65xAbfrEtmtZ35-IZO43Wk-1D2CsVkFyKCsuGxT5qcGTg9FV3VSUbHpeA-dKS1qkv8zYKtz4i-JeRm0y4E6YAs_B91ccue5fFsCAMyN4jKTPxkhNk7f7IRaIrbfA6GYyWFCX7A/https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS2215016120302144>
>>>>
>>>>
>>>>
>>>> “
>>>>
>>>> Qualitative and Quantitative Assessment of MRI Data
>>>>
>>>>
>>>>
>>>> SNR: We calculated SNR for each subject using the “wm-anat-snr”
>>>> FreeSurfer tool available in FreeSurfer v6.0. Voxels from the subject’s
>>>> normalized T1 (norm.mgz) that containing white matter (WM) as defined by
>>>> the subject’s aparc+aseg.mgz are used to calculate SNR with this tool.
>>>>
>>>>
>>>>
>>>> SNR = (mean WM)/(stdev WM)
>>>>
>>>>
>>>>
>>>> We ran the following command for each subject:
>>>>
>>>>
>>>>
>>>> wm-anat-snr –s
>>>>
>>>>
>>>>
>>>> CNR: We calculated CNR for each subject using the “mri_cnr” FreeSurfer
>>>> tool available in FreeSurfer v6.0. This tool finds the average between two
>>>> CNRs: the subject’s (1) WM and gray matter (GM) CNR and (2) gray matter and
>>>> cer

Re: [Freesurfer] MRI image quality metrics

2023-02-11 Thread John Anderson
External Email - Use Caution

export SUBJECTS_DIR=

mri_cnr $SUBJECTS_DIR//surf/ $SUBJECTS_DIR/ 
/mri/norm.mgz > output_CNR.txt
wm-anat-snr --s  check stats/wmsnr.e3.dat  the output is
snr for the whole white matter.

if you need snr for every roi in aseg.stats or wmparc.stats, then you can
add the flag --snr to the command mri_segstats as follows:

mri_segstats --seg mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz
--empty --brainmask mri/brainmask.mgz --brain-vol-from-seg --excludeid 0
--excl-ctxgmwm --supratent --subcortgray --in mri/norm.mgz
--in-intensity-name norm --in-intensity-units MR --etiv --surf-wm-vol
--surf-ctx-vol --totalgray --euler --ctab
/usr/local/freesurfer/6.0/ASegStatsLUT.txt --subject  --snr

do the same for wmparc.stats:
mri_segstats --seg mri/wmparc.mgz --sum stats/wmparc.stats --pv
mri/norm.mgz --excludeid 0 --brainmask mri/brainmask.mgz --in mri/norm.mgz
--in-intensity-name norm --in-intensity-units MR --subject 
--surf-wm-vol --ctab /usr/local/freesurfer/6.0/WMParcStatsLUT.txt --etiv
--snr

make sure to change /usr/local/freesurfer/6.0/ASegStatsLUT.txt  in the
previous command to the FS folder on your system

The last two commands update aseg.stats and wmparc.stats. They both will
get a new column for SNR values for every roi.


On Fri, Feb 10, 2023 at 10:25 PM MANSON ERIC NAAB 
wrote:

> External Email - Use Caution
>
> Thank you very much for your quick response. I still have a challenge
> locating the output file after running the suggested  command
> ( mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz) with
> my subject.
> Can you please provide me with the full command for calculating
> contrast-to-noise ratio and signal-to-noise ratio of white matter, gray
> matter and CSF since am a beginner Or a video link to calculate them.
>
> This is what i see after running the command
>
> mri_cnr /Applications/freesurfer/7.1.1/SUBNEW/PA1//label/lh.cortex.label
>
> mri_cnr -- compute the gray/white/csf contrast-to-noise ratio for volumes.
>
> usage: mri_cnr [options]...
>
> usage example (assumes fs pipeline has finished for subject subj1):
> mri_cnr subj1/surf subj1/mri/orig.mgz
>
> Available options:
>
> -s : compute slope
> based on given values, write it to slope and offset files labeled
>  (e.g., `lh..slope.mgz')
>
> -t : print only the total CNR to stdout (stderr still contains more
> information)
>
> -l : log cnr to file . Will contain 8 values in the
> following order: gray_white_cnr, gray_csf_cnr, white_mean, gray_mean,
> csf_mean, sqrt(white_var), sqrt(gray_var), sqrt(csf_var)
>
> label  : read hemisphere labels from  and 
>
> -u, -?, -help : print usage information and quit
>
> -version : print software version information and quit.
>
> On Thu, Feb 9, 2023 at 3:46 PM John Anderson  wrote:
>
>> External Email - Use Caution
>>
>> You might consider the command wm-anat-snr to compute SNR
>>
>> On Thu, Feb 9, 2023 at 10:38 AM Kumar, Avnish <
>> avnish.ku...@mgh.harvard.edu> wrote:
>>
>>> You could also use these:
>>>
>>>1. For CNR you can use the mri_cnr tool:
>>>
>>> mri_cnr [options]  
>>>
>>> For example:
>>>
>>> mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz
>>>
>>>
>>>
>>>1. For SNR, you'll have to calculate them as:
>>>   1.
>>>
>>>   Run the recon-all pipeline to process your MRI data.
>>>   2.
>>>
>>>   Use the mri_binarize tool to create a binary mask of the ROI in
>>>   the image.
>>>   3.
>>>
>>>   Use the mri_segstats tool to calculate the mean and standard
>>>   deviation of the intensity values within the ROI.
>>>   4.
>>>
>>>   Then your SNR = mean_intensity/std_of_intensity.
>>>
>>>
>>> Best,
>>>
>>> Avnish
>>> --
>>> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
>>> freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Huang, Yujing <
>>> yhuan...@mgh.harvard.edu>
>>> *Sent:* Tuesday, February 7, 2023 9:09 AM
>>> *To:* Freesurfer support list 
>>> *Subject:* Re: [Freesurfer] MRI image quality metrics
>>>
>>>
>>> Hi,
>>>
>>>
>>>
>>> The following is taken from *MailScanner has detected a possible fraud
>>> attempt from "secure-web.cisco.com" claiming to be*
>>> https://secure-web.cisco.com/15IwpbwQA-WCW8yltQ1qpLfRaQV-8nx8afnQdmUW16GAXDwTUuUE2Uo7ja53lo5m7QrlaFd47dzyShd9KzRS2Es

Re: [Freesurfer] MRI image quality metrics

2023-02-10 Thread MANSON ERIC NAAB
External Email - Use Caution

Thank you very much for your quick response. I still have a challenge
locating the output file after running the suggested  command
( mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz) with my
subject.
Can you please provide me with the full command for calculating
contrast-to-noise ratio and signal-to-noise ratio of white matter, gray
matter and CSF since am a beginner Or a video link to calculate them.

This is what i see after running the command

mri_cnr /Applications/freesurfer/7.1.1/SUBNEW/PA1//label/lh.cortex.label

mri_cnr -- compute the gray/white/csf contrast-to-noise ratio for volumes.

usage: mri_cnr [options]...

usage example (assumes fs pipeline has finished for subject subj1): mri_cnr
subj1/surf subj1/mri/orig.mgz

Available options:

-s : compute slope
based on given values, write it to slope and offset files labeled
 (e.g., `lh..slope.mgz')

-t : print only the total CNR to stdout (stderr still contains more
information)

-l : log cnr to file . Will contain 8 values in the
following order: gray_white_cnr, gray_csf_cnr, white_mean, gray_mean,
csf_mean, sqrt(white_var), sqrt(gray_var), sqrt(csf_var)

label  : read hemisphere labels from  and 

-u, -?, -help : print usage information and quit

-version : print software version information and quit.

On Thu, Feb 9, 2023 at 3:46 PM John Anderson  wrote:

> External Email - Use Caution
>
> You might consider the command wm-anat-snr to compute SNR
>
> On Thu, Feb 9, 2023 at 10:38 AM Kumar, Avnish <
> avnish.ku...@mgh.harvard.edu> wrote:
>
>> You could also use these:
>>
>>1. For CNR you can use the mri_cnr tool:
>>
>> mri_cnr [options]  
>>
>> For example:
>>
>> mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz
>>
>>
>>
>>1. For SNR, you'll have to calculate them as:
>>   1.
>>
>>   Run the recon-all pipeline to process your MRI data.
>>   2.
>>
>>   Use the mri_binarize tool to create a binary mask of the ROI in
>>   the image.
>>   3.
>>
>>   Use the mri_segstats tool to calculate the mean and standard
>>   deviation of the intensity values within the ROI.
>>   4.
>>
>>   Then your SNR = mean_intensity/std_of_intensity.
>>
>>
>> Best,
>>
>> Avnish
>> --
>> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
>> freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Huang, Yujing <
>> yhuan...@mgh.harvard.edu>
>> *Sent:* Tuesday, February 7, 2023 9:09 AM
>> *To:* Freesurfer support list 
>> *Subject:* Re: [Freesurfer] MRI image quality metrics
>>
>>
>> Hi,
>>
>>
>>
>> The following is taken from *MailScanner has detected a possible fraud
>> attempt from "secure-web.cisco.com" claiming to be*
>> https://secure-web.cisco.com/1yBb2GkovBSvAi4q4ORDMfb9gbA5D1lxhgbEGgbhkKPLCst71OzbiO7rlTXt6C6Wbg0iqueaHjfQM9_qum2y_-Y4u_C4WRrtG3dCaj3nM3_VYSuuF2eAWlqATUXQWw_xWGDFx5AAjuJPXZki7FqWWBTiadsDRipZu4deosCGVqBDkMdoRPo563fpbTTDXHISB8J6cHn1vqSjOpZScG5d3rHsfpwyO-0jRIVnkUhDElQfYL1Bq3_zQLNLxPppkBtR_vY_9AFghhGXw63wfZTo1ljfMKva5j-7Ghq1B6-girB3pGRPj-6lwiOSuUXUBNyCy2XUlPfL2G6qfdbnc4_hKjMqOfEUiGIsb1_pk4d5Rdmo/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction
>> <https://secure-web.cisco.com/1thfo9hWCJUK_nYfNM9axD5kjhrzv1nVC_cWmWT2aic2ttFqLtKhuhi9E6AA5fXRqlBpbp24-HV_sfbVQik2RJDyE7c9eALg8zbpl340Dwhl2aijQIJcCFqj9K_RZhk5xCVRHURT36bgdsm5C36VxQ3fQh7sVLpsmxKo0Ie0hB8HrgI8Rn7JySIK5iCJZWL9q1OqnFWJgdRUgMDrVlJVf356x-vM1sz0IWVGsGErBQNdxLAYcSvFCTWx0fb6tb1mCw7ljDzERXM7qU-fnbvpV-AKWSuj0eVKouZoNRp8SgTUOIA2mR_VbqAJw9K2PU4OKa4g3f30QsCJpd0U1hcNz7Q/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction>
>> as mentioned in this paper *MailScanner has detected a possible fraud
>> attempt from "secure-web.cisco.com" claiming to be*
>> https://secure-web.cisco.com/1xSgxlzAik8YTDjWAB7qFryOCtl3ASznPC5ZYb3rUdYk5SxbDkBbMuYef3EnJjxEssoeDeEjiupNTkDirzIc3qiJi4ux16RvcF7tycU_BdmfIXAoEAiv4bN66PV4pD0LPUXHgHd4kkDuOkjOclxBUA2sqnMGd6XtSMpEy5ZP_TRgTFMDSy3haj-XcLFe8QJ_22E_7GqKsuKPcUzl5y6DbF_hSzb1mCGWT-NsnqB5NeTpvg6cTrvbzryiAAVvHACLNLTVJsu1XICCxfJexxi0l14kmNvFJJQTnpHQ543zbasyUHlBwULVvn7eTSRJsJcVh6dyznGfyxe1R3nMjHptqrhr8TvyqLfKrmiNYzMknqxQ/https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS2215016120302144
>> <https://secure-web.cisco.com/1aMzZKpIcKTLwbYP_79ZqCUH8p9h0Xh4xqpm8fsmVREKN8hATdl6DHCSkFDKqidqmKqoAydr5eDqjVLAQDKN0zmR2k2Wckx-sv1P3JgKJVQWfpIVeyrh0tqwnGzqQm3nK9BQGA7rUSYwaCBBjmogAhlrnepeAo1_J0CQXj4rKMM-V_g9sXIIirV1h-sajPjULI9qcQw2orS-vs9tl65xAbfrEtmtZ35-IZO43Wk-1D2CsVkFyKCsuGxT5qcGTg9FV3VSUbHpeA-dKS1qkv8zYKtz4i-JeRm0y4E6YAs_B91ccue5fFs

Re: [Freesurfer] MRI image quality metrics

2023-02-09 Thread John Anderson
External Email - Use Caution

You might consider the command wm-anat-snr to compute SNR

On Thu, Feb 9, 2023 at 10:38 AM Kumar, Avnish 
wrote:

> You could also use these:
>
>1. For CNR you can use the mri_cnr tool:
>
> mri_cnr [options]  
>
> For example:
>
> mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz
>
>
>
>1. For SNR, you'll have to calculate them as:
>   1.
>
>   Run the recon-all pipeline to process your MRI data.
>   2.
>
>   Use the mri_binarize tool to create a binary mask of the ROI in the
>   image.
>   3.
>
>   Use the mri_segstats tool to calculate the mean and standard
>   deviation of the intensity values within the ROI.
>   4.
>
>   Then your SNR = mean_intensity/std_of_intensity.
>
>
> Best,
>
> Avnish
> --
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
> freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Huang, Yujing <
> yhuan...@mgh.harvard.edu>
> *Sent:* Tuesday, February 7, 2023 9:09 AM
> *To:* Freesurfer support list 
> *Subject:* Re: [Freesurfer] MRI image quality metrics
>
>
> Hi,
>
>
>
> The following is taken from
> https://secure-web.cisco.com/1thfo9hWCJUK_nYfNM9axD5kjhrzv1nVC_cWmWT2aic2ttFqLtKhuhi9E6AA5fXRqlBpbp24-HV_sfbVQik2RJDyE7c9eALg8zbpl340Dwhl2aijQIJcCFqj9K_RZhk5xCVRHURT36bgdsm5C36VxQ3fQh7sVLpsmxKo0Ie0hB8HrgI8Rn7JySIK5iCJZWL9q1OqnFWJgdRUgMDrVlJVf356x-vM1sz0IWVGsGErBQNdxLAYcSvFCTWx0fb6tb1mCw7ljDzERXM7qU-fnbvpV-AKWSuj0eVKouZoNRp8SgTUOIA2mR_VbqAJw9K2PU4OKa4g3f30QsCJpd0U1hcNz7Q/https%3A%2F%2Fgithub.com%2FComaRecoveryLab%2FLesion_Correction
>   as mentioned in
> this paper
> https://secure-web.cisco.com/1aMzZKpIcKTLwbYP_79ZqCUH8p9h0Xh4xqpm8fsmVREKN8hATdl6DHCSkFDKqidqmKqoAydr5eDqjVLAQDKN0zmR2k2Wckx-sv1P3JgKJVQWfpIVeyrh0tqwnGzqQm3nK9BQGA7rUSYwaCBBjmogAhlrnepeAo1_J0CQXj4rKMM-V_g9sXIIirV1h-sajPjULI9qcQw2orS-vs9tl65xAbfrEtmtZ35-IZO43Wk-1D2CsVkFyKCsuGxT5qcGTg9FV3VSUbHpeA-dKS1qkv8zYKtz4i-JeRm0y4E6YAs_B91ccue5fFsCAMyN4jKTPxkhNk7f7IRaIrbfA6GYyWFCX7A/https%3A%2F%2Fwww.sciencedirect.com%2Fscience%2Farticle%2Fpii%2FS2215016120302144
>
>
>
> “
>
> Qualitative and Quantitative Assessment of MRI Data
>
>
>
> SNR: We calculated SNR for each subject using the “wm-anat-snr” FreeSurfer
> tool available in FreeSurfer v6.0. Voxels from the subject’s normalized T1
> (norm.mgz) that containing white matter (WM) as defined by the subject’s
> aparc+aseg.mgz are used to calculate SNR with this tool.
>
>
>
> SNR = (mean WM)/(stdev WM)
>
>
>
> We ran the following command for each subject:
>
>
>
> wm-anat-snr –s
>
>
>
> CNR: We calculated CNR for each subject using the “mri_cnr” FreeSurfer
> tool available in FreeSurfer v6.0. This tool finds the average between two
> CNRs: the subject’s (1) WM and gray matter (GM) CNR and (2) gray matter and
> cerebrospinal fluid (CSF) CNR. The average CNR is then calculated and
> reported for each hemisphere. Finally, the CNR for both hemispheres are
> averaged to produce a full brain CNR.
>
>
>
> WM-GM CNR = (delta(WM,GM)^2)/(total variance) GM-CSF CNR =
> (delta(GM,CSF)^2)/(total variance) Hemisphere CNR = (WM-GM CNR + GM-CSF
> CNR) x 2 Full Brain CNR = (Left Hemisphere CNR + Right Hemisphere CNR) x 2
>
> “
>
>
>
>
>
> Best,
>
>
>
> Yujing
>
>
>
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
> freesurfer-boun...@nmr.mgh.harvard.edu> *On Behalf Of *MANSON ERIC NAAB
> *Sent:* Tuesday, February 7, 2023 5:26 AM
> *To:* Freesurfer support list 
> *Subject:* [Freesurfer] MRI image quality metrics
>
>
>
> *External Email - Use Caution*
>
> Dear FreeSurfer experts,
>
> Please, I need your assistance and guidance on calculating the
> contrast-to-noise ratio (CNR) and signal-to-noise-ratio (SNR) of White
> matter, Gray matter, and CSF of the brain after recon-all.
>
>
>
> Thank you
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1KDvbAKLrFBoPVGyqH2wpBHTCZi4G5JP4CoyRC23fpSgjgmUjIEIDk5ijfEjY7EcdqD7NMLPnurOJaIh0CESkCjdM-kajpNjDkBcmErgdRD0D7VHpAkbJK2Z0vtuzM98dlYvFfoA5RP_t9tAeeRdA-qZEqMyVFnCZytNMwGX7C6SXBJqlptH_9ue8D3YojwI-o03MasVSWHISnuBb-vLjFPQCtTLtRx7VahTcU3GnkMyiIRc3tk2mxwZDkdAvRHcODMGxX35AEUnYGnF7jDNZBlV8elaazdpSJr7VfItSdTLokLwsLxycodEFhQVZk1M8fBPC2gWDxUKYUo3Ku9AgQg/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

Re: [Freesurfer] MRI image quality metrics

2023-02-09 Thread Kumar, Avnish
You could also use these:

  1.  For CNR you can use the mri_cnr tool:

mri_cnr [options]  
 For example:
mri_cnr $SUBJECTS_DIR/bert/surf/ $SUBJECTS_DIR/bert/mri/norm.mgz


  1.  For SNR, you'll have to calculate them as:
 *   Run the recon-all pipeline to process your MRI data.

 *   Use the mri_binarize tool to create a binary mask of the ROI in the 
image.

 *   Use the mri_segstats tool to calculate the mean and standard deviation 
of the intensity values within the ROI.

 *   Then your SNR = mean_intensity/std_of_intensity.


Best,

Avnish


From: freesurfer-boun...@nmr.mgh.harvard.edu 
 on behalf of Huang, Yujing 

Sent: Tuesday, February 7, 2023 9:09 AM
To: Freesurfer support list 
Subject: Re: [Freesurfer] MRI image quality metrics


Hi,



The following is taken from 
https://github.com/ComaRecoveryLab/Lesion_Correction  as mentioned in this 
paper https://www.sciencedirect.com/science/article/pii/S2215016120302144



“

Qualitative and Quantitative Assessment of MRI Data



SNR: We calculated SNR for each subject using the “wm-anat-snr” FreeSurfer tool 
available in FreeSurfer v6.0. Voxels from the subject’s normalized T1 
(norm.mgz) that containing white matter (WM) as defined by the subject’s 
aparc+aseg.mgz are used to calculate SNR with this tool.



SNR = (mean WM)/(stdev WM)



We ran the following command for each subject:



wm-anat-snr –s



CNR: We calculated CNR for each subject using the “mri_cnr” FreeSurfer tool 
available in FreeSurfer v6.0. This tool finds the average between two CNRs: the 
subject’s (1) WM and gray matter (GM) CNR and (2) gray matter and cerebrospinal 
fluid (CSF) CNR. The average CNR is then calculated and reported for each 
hemisphere. Finally, the CNR for both hemispheres are averaged to produce a 
full brain CNR.



WM-GM CNR = (delta(WM,GM)^2)/(total variance) GM-CSF CNR = 
(delta(GM,CSF)^2)/(total variance) Hemisphere CNR = (WM-GM CNR + GM-CSF CNR) x 
2 Full Brain CNR = (Left Hemisphere CNR + Right Hemisphere CNR) x 2

“





Best,



Yujing



From: freesurfer-boun...@nmr.mgh.harvard.edu 
 On Behalf Of MANSON ERIC NAAB
Sent: Tuesday, February 7, 2023 5:26 AM
To: Freesurfer support list 
Subject: [Freesurfer] MRI image quality metrics



External Email - Use Caution

Dear FreeSurfer experts,

Please, I need your assistance and guidance on calculating the 
contrast-to-noise ratio (CNR) and signal-to-noise-ratio (SNR) of White matter, 
Gray matter, and CSF of the brain after recon-all.



Thank you
___
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] MRI image quality metrics

2023-02-07 Thread Huang, Yujing
Hi,

The following is taken from 
https://github.com/ComaRecoveryLab/Lesion_Correction  as mentioned in this 
paper https://www.sciencedirect.com/science/article/pii/S2215016120302144

“
Qualitative and Quantitative Assessment of MRI Data

SNR: We calculated SNR for each subject using the “wm-anat-snr” FreeSurfer tool 
available in FreeSurfer v6.0. Voxels from the subject’s normalized T1 
(norm.mgz) that containing white matter (WM) as defined by the subject’s 
aparc+aseg.mgz are used to calculate SNR with this tool.

SNR = (mean WM)/(stdev WM)

We ran the following command for each subject:

wm-anat-snr –s

CNR: We calculated CNR for each subject using the “mri_cnr” FreeSurfer tool 
available in FreeSurfer v6.0. This tool finds the average between two CNRs: the 
subject’s (1) WM and gray matter (GM) CNR and (2) gray matter and cerebrospinal 
fluid (CSF) CNR. The average CNR is then calculated and reported for each 
hemisphere. Finally, the CNR for both hemispheres are averaged to produce a 
full brain CNR.

WM-GM CNR = (delta(WM,GM)^2)/(total variance) GM-CSF CNR = 
(delta(GM,CSF)^2)/(total variance) Hemisphere CNR = (WM-GM CNR + GM-CSF CNR) x 
2 Full Brain CNR = (Left Hemisphere CNR + Right Hemisphere CNR) x 2
“


Best,

Yujing

From: freesurfer-boun...@nmr.mgh.harvard.edu 
 On Behalf Of MANSON ERIC NAAB
Sent: Tuesday, February 7, 2023 5:26 AM
To: Freesurfer support list 
Subject: [Freesurfer] MRI image quality metrics


External Email - Use Caution
Dear FreeSurfer experts,
Please, I need your assistance and guidance on calculating the 
contrast-to-noise ratio (CNR) and signal-to-noise-ratio (SNR) of White matter, 
Gray matter, and CSF of the brain after recon-all.

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