[RESOLVED] Potential bug in overwrite function

Description:

Hello! We are trying to rerun hcp1-hcp3 on subjects who began the HCP pipeline in 2019 but were not completed. However, due to backwards compatibility issues within the HCP pipeline, we have realized that we will have to start over from hcp1 for all these subjects, regardless of the fact that some have already completed hcp1. But when we tried to test it with 2 different test subjects, we are getting an “Operation not permitted” error when running prefreesurfer. We have already checked within the folder, and it appears that I do have all of the required permissions, so we think that it may be an issue with the overwrite=yes option.

Let me know if you need any more information, and thanks in advance!

Call:

qunex_container hcp_pre_freesurfer \
    --sessionids="A00029219_V2" \
    --sessionsfolder="/gpfs/project/fas/n3/Studies/ThalDev/subjects" \
    --sessions="/gpfs/project/fas/n3/Studies/ThalDev/processing/subjects_rockland_final_updatedqunex.txt" \
    --overwrite="yes" \
    --container="/gpfs/project/fas/n3/software/Singularity/qunex_suite-0.92.2.sif" \
    --scheduler="SLURM,time=1-00:00:00,ntasks=1,cpus-per-task=1,mem-per-cpu=20000,partition=pi_anticevic"

Logs:

/gpfs/project/fas/n3/Studies/ThalDev/processing/logs/comlogs/error_hcp_pre_freesurfer_A00029219_V2_2022-02-09_15.41.32.830601.log

# Generated by QuNex 0.92.2 on 2022-02-09_15.41.32.830601
#
------------------------------------------------------------
Running external command via QuNex:
/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh \ 
    --path="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp" \ 
    --subject="A00029219_V2" \ 
    --t1="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/A00029219_V2_strc_T1w_MPR1.nii.gz" \ 
    --t2="NONE" \ 
    --t1template="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz" \ 
    --t1templatebrain="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz" \ 
    --t1template2mm="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz" \ 
    --t2template="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz" \ 
    --t2templatebrain="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz" \ 
    --t2template2mm="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz" \ 
    --templatemask="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz" \ 
    --template2mmmask="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz" \ 
    --brainsize="150" \ 
    --fnirtconfig="/opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf" \ 
    --seechospacing="NONE" \ 
    --seunwarpdir="NONE" \ 
    --t1samplespacing="NONE" \ 
    --t2samplespacing="NONE" \ 
    --unwarpdir="NONE" \ 
    --gdcoeffs="NONE" \ 
    --avgrdcmethod="NONE" \ 
    --processing-mode="LegacyStyleData"

Test file: 
/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/MNINonLinear/T1w_restore_brain.nii.gz
------------------------------------------------------------

========================================
  DIRECTORY: /opt/HCP/HCPpipelines
    PRODUCT: HCP Pipeline Scripts
    VERSION: v4.3.0
========================================
Wed Feb  9 15:41:32 EST 2022:PreFreeSurferPipeline.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Wed Feb  9 15:41:32 EST 2022:PreFreeSurferPipeline.sh: FSLDIR: /opt/fsl/fsl
Wed Feb  9 15:41:32 EST 2022:PreFreeSurferPipeline.sh: HCPPIPEDIR_Global: /opt/HCP/HCPpipelines/global/scripts
Wed Feb  9 15:41:32 EST 2022:PreFreeSurferPipeline.sh: Platform Information Follows: 
Linux c19n03.grace.hpc.yale.internal 3.10.0-1160.53.1.el7.x86_64 #1 SMP Thu Dec 16 10:19:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Wed Feb  9 15:41:32 EST 2022:PreFreeSurferPipeline.sh: Parsing Command Line Options
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: LegacyStyleData mode requested.
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: NOTICE: You are using a mode that enables processing of acquisitions that do not
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         conform to the HCP specification as described in Glasser et al. (2013)!
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         Be aware that if the HCP requirements are not met, the level of data quality
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         can not be guaranteed and the Glasser et al. (2013) paper should not be used
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         in support of this workflow. A manuscript with comprehensive evaluation for
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         the LegacyStyleData processing mode is in active preparation and should be
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         appropriately cited when published.
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh:         
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: The following LegacyStyleData settings were requested: --t2=NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: Finished Parsing Command Line Options
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: StudyFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: Subject: A00029219_V2
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wInputImages: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/A00029219_V2_strc_T1w_MPR1.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wInputImages: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: TemplateMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: Template2mmMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: BrainSize: 150
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: FNIRTConfig: /opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: MagnitudeInputName: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: PhaseInputName: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: GEB0InputName: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: TE: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodeNegative: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodePositive: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: SEEchoSpacing: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: SEUnwarpDir: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wSampleSpacing: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wSampleSpacing: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: UnwarpDir: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: GradientDistortionCoeffs: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: AvgrdcSTRING: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: TopupConfig: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: BiasFieldSmoothingSigma: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: UseJacobian: true
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wBiasCorrect: 
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: CustomBrain: NONE
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: ProcessingMode: LegacyStyleData
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T1wFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: T2wFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T2w
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: AtlasSpaceFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/MNINonLinear
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: POSIXLY_CORRECT=
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: Processing Modality: T1w
Wed Feb  9 15:41:34 EST 2022:PreFreeSurferPipeline.sh: NOT PERFORMING GRADIENT DISTORTION CORRECTION
Wed Feb  9 15:41:36 EST 2022:PreFreeSurferPipeline.sh: Not Averaging T1w Images
Wed Feb  9 15:41:36 EST 2022:PreFreeSurferPipeline.sh: ONLY ONE IMAGE FOUND: COPYING
Wed Feb  9 15:41:36 EST 2022:PreFreeSurferPipeline.sh: Aligning T1w image to /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz to create native volume space
Wed Feb  9 15:41:36 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/ACPCAlignment
Wed Feb  9 15:41:36 EST 2022:ACPCAlignment.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Wed Feb  9 15:41:36 EST 2022:ACPCAlignment.sh: FSLDIR: /opt/fsl/fsl
Wed Feb  9 15:41:36 EST 2022:ACPCAlignment.sh: START
Final FOV is: 
0.000000 176.000000 0.000000 256.000000 88.000000 154.000000 

Wed Feb  9 15:42:56 EST 2022:ACPCAlignment.sh: END
Wed Feb  9 15:42:56 EST 2022:PreFreeSurferPipeline.sh: Performing Brain Extraction using FNIRT-based Masking
Wed Feb  9 15:42:56 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BrainExtraction_FNIRTbased
Wed Feb  9 15:42:56 EST 2022:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Wed Feb  9 15:42:56 EST 2022:BrainExtraction_FNIRTbased.sh: FSLDIR: /opt/fsl/fsl
Wed Feb  9 15:42:56 EST 2022:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR_Templates: /opt/HCP/HCPpipelines/global/templates
Wed Feb  9 15:42:56 EST 2022:BrainExtraction_FNIRTbased.sh: START: BrainExtraction_FNIRT
Wed Feb  9 15:55:36 EST 2022:BrainExtraction_FNIRTbased.sh: END: BrainExtraction_FNIRT
Wed Feb  9 15:55:36 EST 2022:PreFreeSurferPipeline.sh: Skipping Modality: T2w - image not specified.
Wed Feb  9 15:55:36 EST 2022:PreFreeSurferPipeline.sh: NOT PERFORMING READOUT DISTORTION CORRECTION
Wed Feb  9 15:55:36 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T2w/T2wToT1wReg
Wed Feb  9 15:55:36 EST 2022:T2wToT1wReg.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Wed Feb  9 15:55:36 EST 2022:T2wToT1wReg.sh: FSLDIR: /opt/fsl/fsl
Wed Feb  9 15:55:36 EST 2022:T2wToT1wReg.sh: START: T2w2T1Reg
Wed Feb  9 15:55:36 EST 2022:T2wToT1wReg.sh: Skipping T2w to T1w registration --- no T2w image.
Wed Feb  9 15:55:43 EST 2022:T2wToT1wReg.sh: END: T2w2T1Reg
Wed Feb  9 15:55:43 EST 2022:PreFreeSurferPipeline.sh: Performing Bias Field Correction using T1w image only
Wed Feb  9 15:55:43 EST 2022:BiasFieldCorrection_T1wOnly.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Wed Feb  9 15:55:43 EST 2022:BiasFieldCorrection_T1wOnly.sh: FSLDIR: /opt/fsl/fsl
Wed Feb  9 15:55:43 EST 2022:BiasFieldCorrection_T1wOnly.sh:  START: T1wBiasFieldCorrection
Starting Single Image Segmentation
T1-weighted image
Imagesize : 260 x 311 x 260
Pixelsize : 0.7 x 0.7 x 0.7

1 5.81114
2 6.00881
3 6.12687
KMeans Iteration 0
KMeans Iteration 1
KMeans Iteration 2
KMeans Iteration 3
KMeans Iteration 4
KMeans Iteration 5
KMeans Iteration 6
KMeans Iteration 7
KMeans Iteration 8
KMeans Iteration 9
KMeans Iteration 10
KMeans Iteration 11
KMeans Iteration 12
KMeans Iteration 13
KMeans Iteration 14
Tanaka Iteration 0 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.93121e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.01446e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.01902e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.01933e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.01935e+07 beta=0.02
 CLASS 1 MEAN 302.186 STDDEV 48.3106 CLASS 2 MEAN 417.41 STDDEV 40.8215 CLASS 3 MEAN 461.583 STDDEV 49.9295
Tanaka Iteration 1 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.01194e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.08997e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.0943e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.0946e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.09462e+07 beta=0.02
 CLASS 1 MEAN 304.292 STDDEV 46.8103 CLASS 2 MEAN 418.427 STDDEV 36.1659 CLASS 3 MEAN 452.836 STDDEV 42.1434
Tanaka Iteration 2 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.06284e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.14007e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.14436e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.14465e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.14467e+07 beta=0.02
 CLASS 1 MEAN 304.615 STDDEV 46.2834 CLASS 2 MEAN 419.325 STDDEV 34.1926 CLASS 3 MEAN 452.045 STDDEV 40.4618
Tanaka Iteration 3 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.0974e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.1749e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.17918e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.17946e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.17948e+07 beta=0.02
 CLASS 1 MEAN 304.876 STDDEV 46.2038 CLASS 2 MEAN 419.937 STDDEV 33.1292 CLASS 3 MEAN 452.34 STDDEV 40.0305
Tanaka Iteration 4 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.12089e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.19882e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.2031e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.20338e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.2034e+07 beta=0.02
 CLASS 1 MEAN 305.208 STDDEV 46.3018 CLASS 2 MEAN 420.352 STDDEV 32.4277 CLASS 3 MEAN 452.725 STDDEV 39.9572
Tanaka Iteration 5 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.13601e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.21433e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.2186e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.21888e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.2189e+07 beta=0.02
 CLASS 1 MEAN 305.549 STDDEV 46.4553 CLASS 2 MEAN 420.67 STDDEV 31.9209 CLASS 3 MEAN 453.032 STDDEV 40.0167
Tanaka Iteration 6 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.14496e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.2234e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.22765e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.22793e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.22795e+07 beta=0.02
 CLASS 1 MEAN 305.858 STDDEV 46.6171 CLASS 2 MEAN 420.944 STDDEV 31.5309 CLASS 3 MEAN 453.24 STDDEV 40.1439
Tanaka Iteration 7 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.14952e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.22784e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.23206e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.23234e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.23236e+07 beta=0.02
 CLASS 1 MEAN 306.127 STDDEV 46.7546 CLASS 2 MEAN 421.206 STDDEV 31.2198 CLASS 3 MEAN 453.353 STDDEV 40.2922
Tanaka Iteration 8 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.14987e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.2279e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.23209e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.23237e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.23239e+07 beta=0.02
 CLASS 1 MEAN 306.354 STDDEV 46.8732 CLASS 2 MEAN 421.466 STDDEV 30.9712 CLASS 3 MEAN 453.39 STDDEV 40.4843
Tanaka Iteration 9 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.14695e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.22434e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.22849e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.22876e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.22878e+07 beta=0.02
 CLASS 1 MEAN 306.542 STDDEV 46.9658 CLASS 2 MEAN 421.735 STDDEV 30.7678 CLASS 3 MEAN 453.352 STDDEV 40.706

 tissue 1 673993
 tissue 2 650472
 tissue 3 640846
 total tissue 1.96531e+06
Wed Feb  9 16:17:07 EST 2022
Extrapolating bias field from central region
Cost is 5.07638e-06
Cost is 3.10958e-07
Wed Feb  9 16:19:16 EST 2022
Performing brain extraction (using BET)
[Errno 1] Operation not permitted: '/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore.nii.gz'
Wed Feb  9 16:19:24 EST 2022:BiasFieldCorrection_T1wOnly.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh --workingdir=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasFieldCorrection_T1wOnly --T1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc --T1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_brain --obias=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasField_acpc_dc --oT1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore --oT1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore_brain':
Wed Feb  9 16:19:24 EST 2022:BiasFieldCorrection_T1wOnly.sh: ERROR: '/opt/fsl/fsl/bin/imcp' command failed with return code: 1
Wed Feb  9 16:19:24 EST 2022:BiasFieldCorrection_T1wOnly.sh: ERROR: '/opt/fsl/fsl/bin/imcp' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: BiasFieldCorrection_T1wOnly.sh
stopped at line: 126
           call: ${FSLDIR}/bin/imcp ${WDir}/T1_biascorr ${oT1wImage}
  expanded call: /opt/fsl/fsl/bin/imcp /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasFieldCorrection_T1wOnly.anat/T1_biascorr /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Wed Feb  9 16:19:24 EST 2022:PreFreeSurferPipeline.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh --path=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp --subject=A00029219_V2 --t1=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/A00029219_V2_strc_T1w_MPR1.nii.gz --t2=NONE --t1template=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz --t1templatebrain=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz --t1template2mm=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz --t2template=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz --t2templatebrain=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz --t2template2mm=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz --templatemask=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz --template2mmmask=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz --brainsize=150 --fnirtconfig=/opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf --seechospacing=NONE --seunwarpdir=NONE --t1samplespacing=NONE --t2samplespacing=NONE --unwarpdir=NONE --gdcoeffs=NONE --avgrdcmethod=NONE --processing-mode=LegacyStyleData':
Wed Feb  9 16:19:24 EST 2022:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh' command failed with return code: 1
Wed Feb  9 16:19:24 EST 2022:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: PreFreeSurferPipeline.sh
stopped at line: 714
           call: ${RUN} ${HCPPIPEDIR_PreFS}/BiasFieldCorrection_T1wOnly.sh --workingdir=${T1wFolder}/BiasFieldCorrection_T1wOnly --T1im=${T1wFolder}/${T1wImage}_acpc_dc --T1brain=${T1wFolder}/${T1wImage}_acpc_dc_brain --obias=${T1wFolder}/BiasField_acpc_dc --oT1im=${T1wFolder}/${T1wImage}_acpc_dc_restore --oT1brain=${T1wFolder}/${T1wImage}_acpc_dc_restore_brain ${BiasFieldSmoothingSigma}
  expanded call: /opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh --workingdir=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasFieldCorrection_T1wOnly --T1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc --T1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_brain --obias=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasField_acpc_dc --oT1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore --oT1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore_brain
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Hi,

if there was an issue with overwrite on our end then the HCP’s FreeSurfer command would not start running, QuNex would just report that this was alreardy ran. The error occurs when already inside the HCP pipeline. I am investigating what is going on, at a glance I would say there are some permission issues as it seems that the command fails when executing imcp. imcp simply creates a copy of an image so not much that can go wrong there. I will let you know if I find any issues QuNex side.

1 Like

It is indeed a permissions issue. The call below is the part of PreFreeSurfer where everything crashed and was unable to overwrite the existing file:

WDir="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasFieldCorrection_T1wOnly.anat"
oT1wImage="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore"

imcp ${WDir}/T1_biascorr ${oT1wImage}

Once I gave my users full permissions over the file (or if I deleted the target file) everything worked. So it seems like imcp was unable to replace the existing file which suggests that something is off with permissions for this study.

1 Like

Hi Jure,

Thanks for looking into this! Zailyn/Clara/I have been looking into the issue more, but we were unclear about what exactly you did during your testing; did you reset the permissions or did you delete the target file? And if you reset the permissions, which file did you change permissions for, and which command did you use to do it?

We are still having problems, as I believe I have full permissions over the file, yet am still getting errors.

Thanks in advance!
Ally

If I remember correctly, I first removed the three problematic files:

/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasField_acpc_dc.nii.gz
/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore.nii.gz
/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore_brain.nii.gz

After that I reran the step inside PreFreeSurfer that crashes:

${HCPPIPEDIR}/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh --workingdir=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasFieldCorrection_T1wOnly --T1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc --T1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_brain --obias=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/BiasField_acpc_dc --oT1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore --oT1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00029219_V2/hcp/A00029219_V2/T1w/T1w_acpc_dc_restore_brain

Since this worked I ran chmod 777 on the problematic files. And rerunning the above step again worked.

Hi,

Okay thank you. We tried to replicate what you did by first choosing another session similar to the one that you tested (A00040798_V2), running chmod 770 on all the files in this subject’s folder, and then trying to run prefreesurfer again, but still got the same error. Here is what I ran and the log:

chmod -R 770 /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/
qunex_container hcp_pre_freesurfer \
>     --sessionids="A00040798_V2" \
>     --sessionsfolder="/gpfs/project/fas/n3/Studies/ThalDev/subjects" \
>     --sessions="/gpfs/project/fas/n3/Studies/ThalDev/processing/subjects_rockland_final_updatedqunex.txt" \
>     --overwrite="yes" \
>     --container="/gpfs/project/fas/n3/software/Singularity/qunex_suite-0.92.2.sif" \
>     --scheduler="SLURM,time=1-00:00:00,ntasks=1,cpus-per-task=1,mem-per-cpu=20000,partition=pi_anticevic"
# Generated by QuNex 0.92.2 on 2022-02-10_14.15.40.298890
#
------------------------------------------------------------
Running external command via QuNex:
/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh \ 
    --path="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp" \ 
    --subject="A00040798_V2" \ 
    --t1="/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/A00040798_V2_strc_T1w_MPR1.nii.gz" \ 
    --t2="NONE" \ 
    --t1template="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz" \ 
    --t1templatebrain="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz" \ 
    --t1template2mm="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz" \ 
    --t2template="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz" \ 
    --t2templatebrain="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz" \ 
    --t2template2mm="/opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz" \ 
    --templatemask="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz" \ 
    --template2mmmask="/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz" \ 
    --brainsize="150" \ 
    --fnirtconfig="/opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf" \ 
    --seechospacing="NONE" \ 
    --seunwarpdir="NONE" \ 
    --t1samplespacing="NONE" \ 
    --t2samplespacing="NONE" \ 
    --unwarpdir="NONE" \ 
    --gdcoeffs="NONE" \ 
    --avgrdcmethod="NONE" \ 
    --processing-mode="LegacyStyleData"

Test file: 
/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/MNINonLinear/T1w_restore_brain.nii.gz
------------------------------------------------------------

========================================
  DIRECTORY: /opt/HCP/HCPpipelines
    PRODUCT: HCP Pipeline Scripts
    VERSION: v4.3.0
========================================
Thu Feb 10 14:15:40 EST 2022:PreFreeSurferPipeline.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Thu Feb 10 14:15:40 EST 2022:PreFreeSurferPipeline.sh: FSLDIR: /opt/fsl/fsl
Thu Feb 10 14:15:40 EST 2022:PreFreeSurferPipeline.sh: HCPPIPEDIR_Global: /opt/HCP/HCPpipelines/global/scripts
Thu Feb 10 14:15:40 EST 2022:PreFreeSurferPipeline.sh: Platform Information Follows: 
Linux c21n08.grace.hpc.yale.internal 3.10.0-1160.53.1.el7.x86_64 #1 SMP Thu Dec 16 10:19:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Thu Feb 10 14:15:40 EST 2022:PreFreeSurferPipeline.sh: Parsing Command Line Options
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh: LegacyStyleData mode requested.
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh: NOTICE: You are using a mode that enables processing of acquisitions that do not
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         conform to the HCP specification as described in Glasser et al. (2013)!
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         Be aware that if the HCP requirements are not met, the level of data quality
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         can not be guaranteed and the Glasser et al. (2013) paper should not be used
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         in support of this workflow. A manuscript with comprehensive evaluation for
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         the LegacyStyleData processing mode is in active preparation and should be
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         appropriately cited when published.
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh:         
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh: The following LegacyStyleData settings were requested: --t2=NONE
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh: Finished Parsing Command Line Options
Thu Feb 10 14:15:41 EST 2022:PreFreeSurferPipeline.sh: StudyFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: Subject: A00040798_V2
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wInputImages: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/A00040798_V2_strc_T1w_MPR1.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wInputImages: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: TemplateMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: Template2mmMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: BrainSize: 150
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: FNIRTConfig: /opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: MagnitudeInputName: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: PhaseInputName: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: GEB0InputName: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: TE: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodeNegative: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodePositive: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: SEEchoSpacing: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: SEUnwarpDir: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wSampleSpacing: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wSampleSpacing: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: UnwarpDir: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: GradientDistortionCoeffs: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: AvgrdcSTRING: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: TopupConfig: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: BiasFieldSmoothingSigma: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: UseJacobian: true
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wBiasCorrect: 
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: CustomBrain: NONE
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: ProcessingMode: LegacyStyleData
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T1wFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: T2wFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T2w
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: AtlasSpaceFolder: /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/MNINonLinear
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: POSIXLY_CORRECT=
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: Processing Modality: T1w
Thu Feb 10 14:15:42 EST 2022:PreFreeSurferPipeline.sh: NOT PERFORMING GRADIENT DISTORTION CORRECTION
Thu Feb 10 14:15:43 EST 2022:PreFreeSurferPipeline.sh: Not Averaging T1w Images
Thu Feb 10 14:15:43 EST 2022:PreFreeSurferPipeline.sh: ONLY ONE IMAGE FOUND: COPYING
Thu Feb 10 14:15:43 EST 2022:PreFreeSurferPipeline.sh: Aligning T1w image to /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz to create native volume space
Thu Feb 10 14:15:43 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/ACPCAlignment
Thu Feb 10 14:15:43 EST 2022:ACPCAlignment.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Thu Feb 10 14:15:43 EST 2022:ACPCAlignment.sh: FSLDIR: /opt/fsl/fsl
Thu Feb 10 14:15:44 EST 2022:ACPCAlignment.sh: START
Final FOV is: 
0.000000 176.000000 0.000000 256.000000 87.000000 154.000000 

Thu Feb 10 14:17:05 EST 2022:ACPCAlignment.sh: END
Thu Feb 10 14:17:05 EST 2022:PreFreeSurferPipeline.sh: Performing Brain Extraction using FNIRT-based Masking
Thu Feb 10 14:17:05 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BrainExtraction_FNIRTbased
Thu Feb 10 14:17:05 EST 2022:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Thu Feb 10 14:17:05 EST 2022:BrainExtraction_FNIRTbased.sh: FSLDIR: /opt/fsl/fsl
Thu Feb 10 14:17:05 EST 2022:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR_Templates: /opt/HCP/HCPpipelines/global/templates
Thu Feb 10 14:17:05 EST 2022:BrainExtraction_FNIRTbased.sh: START: BrainExtraction_FNIRT
Thu Feb 10 14:30:31 EST 2022:BrainExtraction_FNIRTbased.sh: END: BrainExtraction_FNIRT
Thu Feb 10 14:30:32 EST 2022:PreFreeSurferPipeline.sh: Skipping Modality: T2w - image not specified.
Thu Feb 10 14:30:32 EST 2022:PreFreeSurferPipeline.sh: NOT PERFORMING READOUT DISTORTION CORRECTION
Thu Feb 10 14:30:32 EST 2022:PreFreeSurferPipeline.sh: mkdir -p /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T2w/T2wToT1wReg
Thu Feb 10 14:30:32 EST 2022:T2wToT1wReg.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Thu Feb 10 14:30:32 EST 2022:T2wToT1wReg.sh: FSLDIR: /opt/fsl/fsl
Thu Feb 10 14:30:32 EST 2022:T2wToT1wReg.sh: START: T2w2T1Reg
Thu Feb 10 14:30:32 EST 2022:T2wToT1wReg.sh: Skipping T2w to T1w registration --- no T2w image.
Thu Feb 10 14:30:39 EST 2022:T2wToT1wReg.sh: END: T2w2T1Reg
Thu Feb 10 14:30:39 EST 2022:PreFreeSurferPipeline.sh: Performing Bias Field Correction using T1w image only
Thu Feb 10 14:30:39 EST 2022:BiasFieldCorrection_T1wOnly.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Thu Feb 10 14:30:39 EST 2022:BiasFieldCorrection_T1wOnly.sh: FSLDIR: /opt/fsl/fsl
Thu Feb 10 14:30:39 EST 2022:BiasFieldCorrection_T1wOnly.sh:  START: T1wBiasFieldCorrection
Starting Single Image Segmentation
T1-weighted image
Imagesize : 260 x 311 x 260
Pixelsize : 0.7 x 0.7 x 0.7

1 6.09131
2 6.20456
3 6.32257
KMeans Iteration 0
KMeans Iteration 1
KMeans Iteration 2
KMeans Iteration 3
KMeans Iteration 4
KMeans Iteration 5
KMeans Iteration 6
KMeans Iteration 7
KMeans Iteration 8
KMeans Iteration 9
KMeans Iteration 10
KMeans Iteration 11
KMeans Iteration 12
KMeans Iteration 13
KMeans Iteration 14
Tanaka Iteration 0 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.44384e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=6.60137e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=6.60805e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=6.60836e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=6.60837e+07 beta=0.02
 CLASS 1 MEAN 398.102 STDDEV 109.546 CLASS 2 MEAN 477.814 STDDEV 33.2679 CLASS 3 MEAN 574.121 STDDEV 42.609
Tanaka Iteration 1 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.69632e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=6.84603e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=6.8518e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=6.85205e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=6.85206e+07 beta=0.02
 CLASS 1 MEAN 394.401 STDDEV 104.609 CLASS 2 MEAN 478.88 STDDEV 29.4782 CLASS 3 MEAN 565.127 STDDEV 34.2073
Tanaka Iteration 2 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.85837e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=6.99995e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.00509e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.00529e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.0053e+07 beta=0.02
 CLASS 1 MEAN 393.117 STDDEV 104.137 CLASS 2 MEAN 478.787 STDDEV 26.5198 CLASS 3 MEAN 564.284 STDDEV 30.4387
Tanaka Iteration 3 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.94619e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.08193e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.0867e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.08689e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.0869e+07 beta=0.02
 CLASS 1 MEAN 392.948 STDDEV 104.132 CLASS 2 MEAN 478.74 STDDEV 24.801 CLASS 3 MEAN 564.95 STDDEV 28.261
Tanaka Iteration 4 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=6.98832e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.12056e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.12515e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.12533e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.12534e+07 beta=0.02
 CLASS 1 MEAN 393.362 STDDEV 104.151 CLASS 2 MEAN 478.907 STDDEV 23.9131 CLASS 3 MEAN 565.766 STDDEV 26.9632
Tanaka Iteration 5 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.00656e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.13697e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.14149e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.14166e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.14167e+07 beta=0.02
 CLASS 1 MEAN 393.945 STDDEV 104.159 CLASS 2 MEAN 479.16 STDDEV 23.5362 CLASS 3 MEAN 566.437 STDDEV 26.2018
Tanaka Iteration 6 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.01581e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.14509e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.14957e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.14975e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.14975e+07 beta=0.02
 CLASS 1 MEAN 394.445 STDDEV 104.165 CLASS 2 MEAN 479.4 STDDEV 23.3694 CLASS 3 MEAN 566.93 STDDEV 25.6658
Tanaka Iteration 7 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.02022e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.14874e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.1532e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.15338e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.15339e+07 beta=0.02
 CLASS 1 MEAN 394.84 STDDEV 104.178 CLASS 2 MEAN 479.601 STDDEV 23.3334 CLASS 3 MEAN 567.295 STDDEV 25.2903
Tanaka Iteration 8 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.02176e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.15006e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.15453e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.15471e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.15472e+07 beta=0.02
 CLASS 1 MEAN 395.128 STDDEV 104.19 CLASS 2 MEAN 479.757 STDDEV 23.388 CLASS 3 MEAN 567.565 STDDEV 24.9829
Tanaka Iteration 9 bias field 10
Tanaka-inner-loop-iteration=0 MRFWeightsTotal=7.02278e+07 beta=0.02
Tanaka-inner-loop-iteration=1 MRFWeightsTotal=7.15079e+07 beta=0.02
Tanaka-inner-loop-iteration=2 MRFWeightsTotal=7.15526e+07 beta=0.02
Tanaka-inner-loop-iteration=3 MRFWeightsTotal=7.15544e+07 beta=0.02
Tanaka-inner-loop-iteration=4 MRFWeightsTotal=7.15544e+07 beta=0.02
 CLASS 1 MEAN 395.341 STDDEV 104.221 CLASS 2 MEAN 479.877 STDDEV 23.4401 CLASS 3 MEAN 567.78 STDDEV 24.7415

 tissue 1 486096
 tissue 2 656048
 tissue 3 543766
 total tissue 1.68591e+06
Thu Feb 10 14:50:24 EST 2022
Extrapolating bias field from central region
Cost is 9.7713e-07
Cost is 5.92353e-08
Thu Feb 10 14:52:34 EST 2022
Performing brain extraction (using BET)
[Errno 1] Operation not permitted: '/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore.nii.gz'
Thu Feb 10 14:52:41 EST 2022:BiasFieldCorrection_T1wOnly.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh --workingdir=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BiasFieldCorrection_T1wOnly --T1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc --T1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_brain --obias=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BiasField_acpc_dc --oT1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore --oT1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore_brain':
Thu Feb 10 14:52:41 EST 2022:BiasFieldCorrection_T1wOnly.sh: ERROR: '/opt/fsl/fsl/bin/imcp' command failed with return code: 1
Thu Feb 10 14:52:41 EST 2022:BiasFieldCorrection_T1wOnly.sh: ERROR: '/opt/fsl/fsl/bin/imcp' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: BiasFieldCorrection_T1wOnly.sh
stopped at line: 126
           call: ${FSLDIR}/bin/imcp ${WDir}/T1_biascorr ${oT1wImage}
  expanded call: /opt/fsl/fsl/bin/imcp /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BiasFieldCorrection_T1wOnly.anat/T1_biascorr /gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Thu Feb 10 14:52:41 EST 2022:PreFreeSurferPipeline.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh --path=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp --subject=A00040798_V2 --t1=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/A00040798_V2_strc_T1w_MPR1.nii.gz --t2=NONE --t1template=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz --t1templatebrain=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz --t1template2mm=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz --t2template=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz --t2templatebrain=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz --t2template2mm=/opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz --templatemask=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz --template2mmmask=/opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz --brainsize=150 --fnirtconfig=/opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf --seechospacing=NONE --seunwarpdir=NONE --t1samplespacing=NONE --t2samplespacing=NONE --unwarpdir=NONE --gdcoeffs=NONE --avgrdcmethod=NONE --processing-mode=LegacyStyleData':
Thu Feb 10 14:52:41 EST 2022:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh' command failed with return code: 1
Thu Feb 10 14:52:41 EST 2022:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: PreFreeSurferPipeline.sh
stopped at line: 714
           call: ${RUN} ${HCPPIPEDIR_PreFS}/BiasFieldCorrection_T1wOnly.sh --workingdir=${T1wFolder}/BiasFieldCorrection_T1wOnly --T1im=${T1wFolder}/${T1wImage}_acpc_dc --T1brain=${T1wFolder}/${T1wImage}_acpc_dc_brain --obias=${T1wFolder}/BiasField_acpc_dc --oT1im=${T1wFolder}/${T1wImage}_acpc_dc_restore --oT1brain=${T1wFolder}/${T1wImage}_acpc_dc_restore_brain ${BiasFieldSmoothingSigma}
  expanded call: /opt/HCP/HCPpipelines/PreFreeSurfer/scripts/BiasFieldCorrection_T1wOnly.sh --workingdir=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BiasFieldCorrection_T1wOnly --T1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc --T1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_brain --obias=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/BiasField_acpc_dc --oT1im=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore --oT1brain=/gpfs/project/fas/n3/Studies/ThalDev/subjects/A00040798_V2/hcp/A00040798_V2/T1w/T1w_acpc_dc_restore_brain
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Let us know if you have any other suggestions or if there is any other information that you need.

Thanks!

I prepared a patch for this and am running hcp_pre_freesurfer on the above session as a test right now. The patch is already available in the develop version. If all is well I will be releasing a new version of QuNex early next week.

1 Like