External Email - Use Caution
Dear all,
For the past few days I have been trying to use the output from the Samseg tool to generate more volume metrics, such as gray matter volume. Unfortunately, I am not getting any output other than what I already get from Samseg. I tried running mri_segstats, but that also gave me the same volumes I already had. I was wondering if there is another tool within freesurfer to calculate these volumes for which I do not need to run the recon-all tool due to time constraints.
Thank you in advance.
Best regards, Maaike Romme
External Email - Use Caution
Hi Maaike
I think the easiest way is to use the fspython interpreter included in FreeSurfer. If you put the lines below in a text file called "sum_volumes.py" and do "fspython sum_volumes.py" in the samseg results directory (the directory where the file "samseg.stats" is located), you'll get the sum of the structures you specify in the beginning of the file.
Hope this helps,
Koen
structures = [ '5th-Ventricle', 'Left-Caudate', 'Left-Putamen' ] total_volume = 0.0 with open('samseg.stats', 'r') as f: for l in f.readlines(): s = l.split(",") if s[0].replace('# Measure ','') in structures: print( l ) total_volume += float(s[1]) print(f"total_volume:{total_volume}")
On Thu, Aug 8, 2024 at 8:11 AM Maaike Romme msnmaaike@hotmail.com wrote:
External Email - Use CautionDear all,
For the past few days I have been trying to use the output from the Samseg tool to generate more volume metrics, such as gray matter volume. Unfortunately, I am not getting any output other than what I already get from Samseg. I tried running mri_segstats, but that also gave me the same volumes I already had. I was wondering if there is another tool within freesurfer to calculate these volumes for which I do not need to run the recon-all tool due to time constraints.
Thank you in advance.
Best regards, Maaike Romme _______________________________________________ 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%3E .
freesurfer@nmr.mgh.harvard.edu