External Email - Use Caution
Dear Yujing,
These are the rights I get when I cp a file within the proposed output directory: -rw-rw-r--.
Kind regards,
Jari Gool | MD-PhD candidate
Department of Anatomy & Neurosciences, Amsterdam UMC Location VUmc
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu>
On Behalf Of Huang, Yujing
Sent: vrijdag 24 november 2023 16:33
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] Automatic prompt reply for freesurfer subsegmentations
In your terminal, after you copy a file, what are the permissions of the new file?
From:
freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu>
On Behalf Of Gool, J.K. (Jari)
Sent: Friday, November 24, 2023 9:18 AM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: Re: [Freesurfer] Automatic prompt reply for freesurfer subsegmentations
External Email - Use Caution
Dear Yujing,
Thank you for the quick reply. When I enter umask in my terminal I already get 0002 as output so I think this is not the issue. Is there anything else I could do?
Kind regards,
Jari Gool | MD-PhD candidate
Department of Anatomy & Neurosciences, Amsterdam UMC Location VUmc
Van:
freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> namens Huang, Yujing <YHUANG43@MGH.HARVARD.EDU>
Verzonden: vrijdag 24 november 2023 13:59
Aan: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Onderwerp: Re: [Freesurfer] Automatic prompt reply for freesurfer subsegmentations
It looks like “imageDump.mgz” is copied to the directory during segmentation.
Can you check your ‘umask’?
>umask
I think “mode 0444 (r--r--r--)” is caused by the umask setting to 0222. Try to change your umask to 0002 in .bashrc or .profile – add a line ‘umask 0002’.
Best,
Yujing
From:
freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu>
On Behalf Of Gool, J.K. (Jari)
Sent: Thursday, November 23, 2023 6:33 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] Automatic prompt reply for freesurfer subsegmentations
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:
MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
https://surfer.nmr.mgh.harvard.edu/fswiki/HypothalamicSubunits)
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:
MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
https://surfer.nmr.mgh.harvard.edu/fswiki/BrainstemSubstructures)
echo "running brainstem segmentation..."
segmentBS.sh ${subj}_ses-EEGfMRI1 /home/anw/jkgool/my-scratch/freesurfer_rick/output/test_nov23/freesurfer/
#3 thalamus (doc:
MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
https://surfer.nmr.mgh.harvard.edu/fswiki/ThalamicNuclei)
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:
MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
https://surfer.nmr.mgh.harvard.edu/fswiki/HippocampalSubfieldsAndNucleiOfAmygdala)
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:
MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
https://surfer.nmr.mgh.harvard.edu/fswiki/ScLimbic)
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 : MailScanner
has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be
www.amsterdamumc.org/disclaimers