External Email - Use Caution
Dear Douglas,
Thank you for your reply.
I do not see 77, and neither does a label named "Lesions". How else can I know the lesions mask is correct? I see the lesion volume after adjusting the threshold has been decreased, but I would like to know how accurately the lesions.mgz detects the lesions on FLAIR T2 image.
Did I miss something when I execute run_samseg? I have atteched the data file generated by executing mri_segstats and the samseg processes I have made to this email for your reference.
The software and OS that I am using are listed below as well:
FreeSurfer: version 7.3.2
Linux: Ubuntu 23.04
Thank you again for your attention. Your help is highly appreciated.
Best regards,Krystal
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Douglas N. Greve <dgreve@MGH.HARVARD.EDU>
Sent: 30 March 2024 4:57
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsJust load the seg.mgz and click on a voxel in the lesion, then look at the value in the panel. There is a slight chance it could be 77 instead of 99.
On 3/26/2024 4:29 AM, Krystal Xiwing Yau wrote:
External Email - Use Caution
Dear Koen,
Thank you so much for your clarification. The volume changed after running the suggested commands.
It's weird that the label 99 does not exist in my seg.mgz, but I still see my lesions.mgz in posteriors folder.
As I am inspecting whether the lesions are segmented accurately, the lesions mask (with default threshold) is rather be oversensitive. I tried to view the binarized image, which is in NifTi format, but I can't view it on Freeview. How I can know if adjusting the threshold with mri_binarize would make my lesions accurately estimated afterwards?
Thank you for your kind attention.
Best regards,
Krystal
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Koen Van Leemput <leempko@gmail.com>
Sent: 25 March 2024 18:11:42
To: Freesurfer support list
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsExternal Email - Use Caution
Hi Krystal,
Sorry I should have been more specific. When you do
mri_segstats --seg seg.mgz --o tmp.txt
the label 99 will be indicated in the second column. E.g., "39 99 9157 10384.1 Seg0099" means that there are 9157 voxels labeled as lesion, with a volume of 10384.1 mm^3.
To do the thresholding on the posteriors, you can do (for example):
mri_binarize --i Lesions.mgz --min 0.9 --o thresholded_0pt9.mgz
Subsequently the lesion volume can be counted by doing
mri_segstats --seg thresholded_0pt9.mgz --o tmp_0pt9.txt
which will create a line of the form
2 1 6301 7145.4 Seg0001
which indicates 6301 voxels with volume 7145.4mm^3 with label 1 (all the other voxels in the image being labeled 0 after the mri_binarize command).
I hope this clarifies things for you,
Koen
On Tue, Mar 19, 2024 at 3:50 AM Krystal Xiwing Yau <krystaly@hku.hk> wrote:
_______________________________________________External Email - Use Caution
Dear Koen,
Apologies for any confusion caused. I'm pretty new to the program and self-learning here.
I tried to use mri_binarize and mri_segstats for calculating the lesions, and found it confusing with respect of the usage of mri_segstats. There's an option --seg and I input seg.mgz for that, but there's no label 99 in the file. As a result, I still have no new volume of lesions generated.
Moreover, as I want to make sure that I will get the correct count of voxels after adjusting the threshold, I view it with freeview but only a white block shown. I am not sure whether I have it fixed correctly.
mri_binarize --i samsegoutput/posteriors/Lesions.mgz --o binarized_lesions_threshold0.7.mgz --min 0.7
mri_binarize --i binarized_lesions_threshold0.7.mgz --o lesions_label_0.7.mgz --match 99
mri_segstats --i binarized_lesions_threshold0.7.mgz --seg yourSeg/seg.mgz --sum lesion_stats_threshold0.7.txt
Did I miss anything here? Please advise.
Thanks.
Best regards,
Krystal
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Koen Van Leemput <leempko@gmail.com>
Sent: 19 March 2024 02:07:44
To: Freesurfer support list
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsExternal Email - Use Caution
Hi Krystal,
I'm afraid I don't quite understand what you're asking. In your original email, you used two different thresholds and the results you showed indicated that the method worked as expected. One issue was that the lesion volume reported in .stats file is independent of the threshold used (obviously not ideal, will be changed in future versions), so that you'd need to count voxels labeled as lesion (value 99) yourself (e.g., using "mri_segstats --seg seg.mgz--o tmp.txt"). Can you please clarify what the problem is?
Thanks,
Koen
On Sun, Mar 17, 2024 at 11:59 PM Krystal Xiwing Yau <krystaly@hku.hk> wrote:
_______________________________________________External Email - Use Caution
Dear FreeSurfer experts,
May I know if anyone can help with this matter? I am still exploring my way to fix the lesions volume. I have inspected the raw images (FLAIR T2 images) which did not show any missing brain structures. However, the contrast of FLAIR images may be too high thus the lesions masks appear to be very false positive. In hopes of reducing the probability of false positive, I tweeked up the threshold in samseg command. Unfortunately, the lesions masks did not improve.
Please kindly advise.
Sincerely,
Krystal
From: Krystal Xiwing Yau
Sent: 11 March 2024 13:39
To: Freesurfer support list
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsDear Koen,
Sorry for the late reply. I've been busy with other project.
Yes, I meant whether changing the threshold of samseg that labels lesions would change the voxel count. I have rerun the command with different thresholds, and compared with each other. The lesions volume does not change. The thresholds that I tried out were 0.3 (default), 0.7, and 0.9. The original lesion mask found to be more false positive, so I tweeked it up.
Could you please advise?
Thank you.
Best regards,
Krystal
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Koen Van Leemput <leempko@gmail.com>
Sent: 29 January 2024 23:00:08
To: Freesurfer support list
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsExternal Email - Use Caution
Hi Krystal,
I'm not sure I understand -- changing the threshold should change the number of voxels labeled as lesion in seg.mgz. Can you confirm that we're talking about the same thing?
Thanks,
Koen
On Sun, Jan 21, 2024 at 8:56 PM Krystal Xiwing Yau <krystaly@hku.hk> wrote:
_______________________________________________External Email - Use Caution
Dear Koen,
Thank you for your reply and wish you the best of luck on your grant application.
As some of the lesion masks are found to be weird, which shows false positive lesions on the brain, I increased the threshold to lower false positive results. The number of lesion volume and the lesion mask did not show the difference between two different thresholded images, though. Is it normal to have lesion volume the same even with a different threshold?
I look forward to hearing from you. Thank you so much for your time and patience.
Best regards,
Krystal
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Koen Van Leemput <leempko@gmail.com>
Sent: 17 January 2024 16:56:34
To: Freesurfer support list
Subject: Re: [Freesurfer] [FreeSurfer] Lesion detection at different thresholdsExternal Email - Use Caution
Hi Krystal,
Apologies for the delay in replying (grant deadline).
The lesion class in samseg is a bit special, as the internal lesion probabilities are thresholded (using the value passed on via the --threshold flag, or a default value 0.3 if you don't use that flag) to obtain the voxels labeled as 99 in the segmentation output. In contrast, the value in the .stats file is simply the sum (over all voxels) of those internal lesion probabilities.
If you want to inspect the impact of the exact threshold value on the number of voxels with label 99, you could run (as you did) samseg with the --save-posteriors flag to save the internal lesion probabilities (in yourSeg/posteriors/Lesions.mgz). Then you can play with mri_binarize and mri_segstats to obtain lesion volumes for different thresholds without having to re-run sameg anew.
Hope this helps,
Koen
On Sun, Jan 7, 2024 at 11:05 PM Krystal Xiwing Yau <krystaly@hku.hk> wrote:
_______________________________________________External Email - Use Caution
Dear FS experts,
I am testing out which threshold works the best for the image. As I tested 0.3 and 0.9, the lesion masks do show the difference but the measurement is the same. Please see below for your information:
Fig 1. Lesion.mgz with a threshold of 0.3 applied to FLAIR image
Fig 2. Lesions.mgz with a threshold of 0.7 applied to FLAIR image
Do the volume of lesions supposedly different with threshold adjustments?
The following code is what I used for running samseg:
run_samseg --input $FREESURFER_HOME/${i}.nii $FREESURFER_HOME/${i}_flair_reg.nii --pallidum-separate --lesion --lesion-mask-pattern 0 1 --threshold 0.7 --output $SUBJECTS_DIR/${i}_samsegOutput_thold0.7/ --save-posteriors --threads 8Thank you for your attention.
Regards,Krystal
Tel.: +852 2255 5024Fax: +852 2872 5828Address: Room 304, 3/F, New Clinical Building, 102 Pokfulam Road, Hong Kong.
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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 MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline> .
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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 MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline> .
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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