External Email - Use Caution        

Dear,

I would like to run the different available Freesurfer subsegmentations 
(brainstem, amygdala/hippocampus, thalamus, hypothalamus and ScLimbic) on a 
large sample of 150 subjects (code below). I want to run multiple subjects in 
parallel using the sbatch command on the linux server I am working on. Because 
of previous recon-all processing in 7.3.2 I would like to also perform the 
subsegmentations in this version and ScLimbic in 7.4.0. The problem is that the 
"segmentBS.sh", "segmentThalamicNuclei.sh" and "segmentHA_T1.sh" halfway 
prompts for user input: "mv: replace 'imageDump.mgz', overriding mode 0444 
(r--r--r--)?". The imageDump.mgz file is made within this same subsegmentation 
script and I have no problem with replacing this file. When I run the code 
interactively I just reply with "y" and the subsegmentation finishes without 
any errors. When I want to submit my script as a job and in batch, I am unable 
to provide this user input and the subsegmentation gets stuck at the prompt. I 
have tried to change my code of the subsegmentations with yes and echo (such as 
"yes | segmentBS.sh ${subj}_ses-EEGfMRI1 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/" or 
"echo "y" | segmentBS.sh ${subj}_ses-EEGfMRI1 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/") but 
the script still gets stuck on the prompt. Do you know how I can fix this? We 
would also like to perform these subsegmentations in a large consortium and 
hope to be able to automate this problem so sites will not have to manually 
provide the user input every time.

Thank you in advance for your help, it is much appreciated.

Kind regards,
Jari Gool  |  MD-PhD candidate
Department of Anatomy & Neurosciences, Amsterdam UMC Location VUmc


#!/bin/bash

#SBATCH --job-name=subsegmentations_ams
#SBATCH --mem=16G
#SBATCH --partition=luna-cpu-long
#SBATCH --qos=anw-cpu
#SBATCH --cpus-per-task=1
#SBATCH --time=03-00:00:00
#SBATCH --nice=2000
#SBATCH --array=1-37%3
#SBATCH --output=slurm-%A.%a.out

module load FreeSurfer/7.3.2-centos8_x86_64

#make list of subjects
SUBJECTS_DIR=/scratch/anw/jkgool/freesurfer_rick/input/
cd ${SUBJECTS_DIR}
ls -d sub-* > subjects.txt
subj=$(sed "${SLURM_ARRAY_TASK_ID}q;d" subjects.txt)

#1 hypothalamus (doc: 
https://secure-web.cisco.com/1onztiawxb5qsVvLHN8f5XCv2KtGSQGWg_dK2SaFV6PqzOa7FtaEo0Lc7pyB4fN4BVUmflEDrawp1ScOaKW2qqZeQaMEosmY25x0XttnBn6-ObIsaE4yIcTBdremVp0kLGWr0CnXNxnR_zJ3fXKKh3zsbKUA29BekQkx1rnLUiZlvGKdlg9LX8d3JQz6-lHxH7aSl6tD8Dk7aIUTxcp30YkbbNx_IQB3TGUIQVHtesJmH0Y9Ci1QjFeOBfeRprtwQaafzzeeapsCd2akAPy7091-K2Sq4u7uN-H0Yvx_fdIjFatkk9igQeaYJT6FcjrKjqL9x9mB3kRsQseLZuB15sA/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FHypothalamicSubunits)
echo "running hypothalamus segmentation..."
mri_segment_hypothalamic_subunits --s ${subj}_ses-EEGfMRI1 --sd 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/ 
--write_posteriors

#2 brainstem (doc: 
https://secure-web.cisco.com/1yA5iB2C_fQBajVg9CMfEqeSaXWvxL5h6YNRFRhGqg70rvc5MErDAuJJxnn2td6RhHFKGQ4VUKDoS4fc630u0f9wcRtKTMO2bVc4WYH5FLumuZtGAYzP89kbVq41TyG8Rz6_uPmJdENwwQ8VKrobu8Q7HQq-WT_uJeFQGcruoC7P8UGWYJPGDrDRPMk3_WW-B4yXKotGyzNge_BZKWqTJr_EotRDhNPAYbYRnU-YXSgECjpqldR-NFk_RRB-H9dNPNmOKjNrtW9urfyotVC0UEWOgu8hXO-_nTUmQUdi8GPrNx7zjlBKmzWNyzrEXVeQFKWjh5es_eFeaz4i-mwE2Yg/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FBrainstemSubstructures)
echo "running brainstem segmentation..."
segmentBS.sh ${subj}_ses-EEGfMRI1 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/

#3 thalamus (doc: 
https://secure-web.cisco.com/12Cjw5kv1gZcMaSw-FGtq5Rj_H-W8Ti_S-0G1z5Q3RcGYAi7BY22IHc-UqS1tmRL91YsBvliPVKfIGmW_nhd1-kkDa_D7pywTjGfm8_xOYO_uwNdvNmydlJ1iDf5E57UkmLuQdOAxhePKXbM9H6mzLLQvW1bk6UWo41hgjWT_IcX0jmmtLcwpYJ1eEoL1wLab1ljTMo02LyqYFW_oX7fa083cgfAzgHVIhIZt0ClGOHJ-4VRR3M_U1XPYazbNhuS-euZUnjq-Wa6mqNGgednaxXTB9r0kSGj6BJ92CbU4KMP-_Ae3J4wpmApUINGgHPaGvC93IcoTWm6PPiC04-qCCg/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FThalamicNuclei)
echo "running thalamic nuclei segmentation..."
segmentThalamicNuclei.sh ${subj}_ses-EEGfMRI1 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/

#4 hippocampal subfields and amygdala (doc: 
https://secure-web.cisco.com/1msow8_UAwH0qjnlyynpNAamisXbwaGhA9aKGjqT8cxwFYJdC9OQ6CFDIuVp1O_fg2v53HoAoX_4UBNjr_PXWysTvlzJ84h3-FoMUcjdDp56KGeODiAnUS9hAsZOEiPHRIgOnAwI-edWK17JRuu5h23HA1xIgT_eyAwdhJWG0IubV2pH-JTRPehsnr1drX7JkWUyveDgCOrITwfTV5mfhchF6EvjafND0gikTcLpEJLzyhH2BgGKt27-Z3WfuDVsqZD99LQHH0wbiAlOSR2LFmS0xpvleDtWHBJW7OPQJrs0a2LbzTr1aWp1bGSEUwv3xXBKFx-0zA7DLURxcWGwtPQ/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FHippocampalSubfieldsAndNucleiOfAmygdala)
echo "running hippocampal subfields and amygdala segmentation..."
segmentHA_T1.sh ${subj}_ses-EEGfMRI1 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/

module load FreeSurfer/7.4.0-centos8_x86_64

#5 subcortical limbic structures (doc: 
https://secure-web.cisco.com/1BzoZbanMMDeo_3lpTpcyI0wfALp7CjhwdsuIj1cE8JFgbt3BsIfRwUJ6zQnJb2ensv7RcK5tC4o6LOsSaV-yIVpwNnO7FN2d4QU6LoL6xLhdJPgf5lUVpNPnrqUaa43m4JVXOyVJemSIqHoCv3zEUHw4azXk_sMhPeMyHP1WNJSrQn-Jf_L7YKmLQrc58NvPrEeJ_Tq5th4UiesHwPbG9VlhDxnbRrjchDbDWKZP3r_iUN9xf28SonCwh_u9K_Srxdnmpk548PMU2gaXLyu-5nxhzoAIf5G8SUCpLJRARkf7iwi_8MwCVSq0wJRYrnW2UhemK4B0D9_VpfYvah64vA/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FScLimbic)
echo "running limbic structures segmentation..."
mri_sclimbic_seg --i 
/home/anw/jkgool/my-scratch/freesurfer_rick/input/${subj}/ses-EEGfMRI1/anat/ 
--o 
/home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/${subj}_ses-EEGfMRI1/output_sclim
 --write_volumes --write_qa_stats

______________________________________________________
AmsterdamUMC disclaimer : 
http://secure-web.cisco.com/1td9AygoAleVUgM8ZzmybSU3puYBZUmWaYHhLwS0mlie9NacTgMrroQZa7S-deF1QB1HDB1nsX9qrE2b1DQMViZBUQkMoPqwQyv92yV0ZVvvbPvhAUuF08h7Zjj-grbfAgwGoWRC7iyEl-U8KiQ623vvVE7lW-Sm3MJ4GpWCdAysqYaBfzT1Dyvsm1i6ghfTVuk1i2R3wsR_FpYvOP7-PMIj8N3IwLn4TnFJOiI0SNeWLuQGhQUOTlEGTMLFMTyx2vzj_47QLzWSZTkQykaSmWNvx-e_34w9ashCzYvh-cmfUb9jxlxkJDRRgD_XbinggwF8iOa4pzTPoejvKirChNg/http%3A%2F%2Fwww.amsterdamumc.org%2Fdisclaimers
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
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. 

Reply via email to