Siemens Fieldmap Failure during Prefreesurfer

Hi there! I am running into an issue during prefreesurfer, and I think it is because I am doing something wrong with my Siemens fieldmaps. Structural processing runs totally OK when I set hcp_avgrdcmethod=‘NONE’ otherwise it fails. The scans were collected on siemens magnetom 7T.

The code finds the fieldmap OK, but it breaks during “fsl_prepare_fieldmap” I think (see below). I’ve tried using BET to skull-strip the magnitute image, but that didn’t fix the issue. Both fieldmaps look OK when I look at the nii images. I’d appreciate any help in figuring out this error. Thank you a lot! See below for my command, hcp mapping, and the full error message from comlogs.

Here is my command:

qunex_container hcp_pre_freesurfer \
    --container="gitlab.qunex.yale.edu:5002/qunex/qunexcontainer:0.96.2a" \
    --batchfile="/Users/kolobarica/Desktop/pals/processing/batch.txt" \
    --sessionsfolder="/Users/kolobarica/Desktop/pals/sessions" \
    --sessions="PALS_011" \
    --overwrite=yes \
    --parsessions=2 \
    --hcp_avgrdcmethod='SiemensFieldMap'

Here is the session_hcp file:

id: PALS_011
subject: PALS
dicom: /Users/kolobarica/Desktop/pals/sessions/PALS_011/dicom
raw_data: /Users/kolobarica/Desktop/pals/sessions/PALS_011/nii
data: /Users/kolobarica/Desktop/pals/sessions/PALS_011/4dfp
hcp: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp

hcpready: true

11:                   : localizer [1/3] cR14_i00002 
12:                   : localizer [2/3] cR16_i00001 
13:                   : localizer [3/3] cR20_i00003 
21:                   : localizer [1/3] i00001    
22:                   : localizer [2/3] i00002    
23:                   : localizer [3/3] i00003    
31: T1w               : T1 MPRAGE        : fm(99)  
41: T1w               : T1 MPRAGE         : fm(99)      
51:                   : sagT1 [1/4]               
52:                   : sagT1 [2/4] ROI1          
53:                   : sagT1 [3/4]               
54:                   : sagT1 [4/4] ROI1          
61:                   : corT1 [1/4]               
62:                   : corT1 [2/4] ROI1          
63:                   : corT1 [3/4]               
64:                   : corT1 [4/4] ROI1          
71: T2w               : T2 TSE Coronal_ND       : fm(99)  
81: T2w               : T2 TSE Coronal           : fm(99) 
91: T2w               : T2 TSE Coronal          : fm(99) 
181:                   : TOF 7slabs                
191:                   : TOF 7slabs_MIP_SAG        
201:                   : TOF 7slabs_MIP_COR        
211:                   : TOF 7slabs_MIP_TRA        
221:                   : TOF 7slabs                
231: FM-Magnitude      : Mag_Images [1/2] e1   : fm(99)    
232: FM-Magnitude      : Mag_Images [2/2] e2    : fm(99)   
241: FM-Phase          : Pha_Images [1/2] e1_ph  : fm(99)  
242: FM-Phase          : Pha_Images [2/2] e2_ph   : fm(99) 
251:                   : mIP_Images(SW) [1/2] e1   
252:                   : mIP_Images(SW) [2/2] e2   
261:                   : SWI_Images [1/2] e1       
262:                   : SWI_Images [2/2] e2       

Here is the error I get:

# Generated by QuNex 0.96.2 on 2023-01-23_16.05.10.469966
#
------------------------------------------------------------
Running external command via QuNex:

/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh --path="/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp" --subject="PALS_011" --t1="/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR2.nii.gz" --t2="/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC2.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC3.nii.gz" --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" --fmapmag="/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz" --fmapphase="/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz" --gdcoeffs="NONE" --avgrdcmethod="SiemensFieldMap" --processing-mode="HCPStyleData"

Test file: 
/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/MNINonLinear/T1w_restore_brain.nii.gz
------------------------------------------------------------

========================================
  DIRECTORY: /opt/HCP/HCPpipelines
    PRODUCT: HCP Pipeline Scripts
    VERSION: v4.7.0
     COMMIT: f8cac6892f88bdf889d644711ff038198eb81533
   MODIFIED: no
========================================
Mon Jan 23 16:05:11 EST 2023:PreFreeSurferPipeline.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:05:11 EST 2023:PreFreeSurferPipeline.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:05:11 EST 2023:PreFreeSurferPipeline.sh: HCPPIPEDIR_Global: /opt/HCP/HCPpipelines/global/scripts
Mon Jan 23 16:05:11 EST 2023:PreFreeSurferPipeline.sh: Platform Information Follows: 
Linux 7ce105f07731 5.15.49-linuxkit #1 SMP Tue Sep 13 07:51:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Mon Jan 23 16:05:11 EST 2023:PreFreeSurferPipeline.sh: Parsing Command Line Options
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: Finished Parsing Command Line Options
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: StudyFolder: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: Subject: PALS_011
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wInputImages: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR2.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wInputImages: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC2.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC3.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wTemplate: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wTemplateBrain: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm_brain.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wTemplate2mm: /opt/HCP/HCPpipelines/global/templates/MNI152_T2_2mm.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: TemplateMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm_brain_mask.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: Template2mmMask: /opt/HCP/HCPpipelines/global/templates/MNI152_T1_2mm_brain_mask_dil.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: BrainSize: 150
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: FNIRTConfig: /opt/HCP/HCPpipelines/global/config/T1_2_MNI152_2mm.cnf
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: MagnitudeInputName: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: PhaseInputName: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: GEB0InputName: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: TE: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodeNegative: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: SpinEchoPhaseEncodePositive: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: SEEchoSpacing: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: SEUnwarpDir: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wSampleSpacing: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wSampleSpacing: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: UnwarpDir: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: GradientDistortionCoeffs: NONE
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: AvgrdcSTRING: SiemensFieldMap
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: TopupConfig: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: BiasFieldSmoothingSigma: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: UseJacobian: true
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wBiasCorrect: 
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: CustomBrain: NONE
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: ProcessingMode: HCPStyleData
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T1wFolder: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: T2wFolder: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: AtlasSpaceFolder: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/MNINonLinear
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: POSIXLY_CORRECT=
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: Processing Modality: T1w
Mon Jan 23 16:05:12 EST 2023:PreFreeSurferPipeline.sh: NOT PERFORMING GRADIENT DISTORTION CORRECTION
Mon Jan 23 16:05:14 EST 2023:PreFreeSurferPipeline.sh: Averaging T1w Images
Mon Jan 23 16:05:14 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/AverageT1wImages
Mon Jan 23 16:05:14 EST 2023:PreFreeSurferPipeline.sh: PERFORMING SIMPLE AVERAGING
Mon Jan 23 16:05:14 EST 2023:AnatomicalAverage.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:05:14 EST 2023:AnatomicalAverage.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:05:14 EST 2023:AnatomicalAverage.sh: Images:  /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w1_gdc /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w2_gdc  Output: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w
Final FOV is: 
0.000000 230.000000 0.000000 320.000000 36.000000 200.000000 

Final FOV is: 
0.000000 230.000000 0.000000 320.000000 37.000000 200.000000 

1.000956 0.000439 0.000345 -0.155667 
-0.000000 1.000775 0.000218 -0.102699 
-0.000000 -0.000000 1.000000 -0.374984 
0.000000 0.000000 0.000000 1.000000 

Mon Jan 23 16:10:17 EST 2023:PreFreeSurferPipeline.sh: Aligning T1w image to /opt/HCP/HCPpipelines/global/templates/MNI152_T1_0.7mm.nii.gz to create native volume space
Mon Jan 23 16:10:17 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/ACPCAlignment
Mon Jan 23 16:10:17 EST 2023:ACPCAlignment.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:10:17 EST 2023:ACPCAlignment.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:10:17 EST 2023:ACPCAlignment.sh: START
Final FOV is: 
0.000000 230.000000 0.000000 320.000000 36.000000 200.000000 

Mon Jan 23 16:11:55 EST 2023:ACPCAlignment.sh: END
Mon Jan 23 16:11:55 EST 2023:PreFreeSurferPipeline.sh: Performing Brain Extraction using FNIRT-based Masking
Mon Jan 23 16:11:55 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/BrainExtraction_FNIRTbased
Mon Jan 23 16:11:55 EST 2023:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:11:55 EST 2023:BrainExtraction_FNIRTbased.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:11:55 EST 2023:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR_Templates: /opt/HCP/HCPpipelines/global/templates
Mon Jan 23 16:11:55 EST 2023:BrainExtraction_FNIRTbased.sh: START: BrainExtraction_FNIRT
Mon Jan 23 16:24:34 EST 2023:BrainExtraction_FNIRTbased.sh: END: BrainExtraction_FNIRT
Mon Jan 23 16:24:34 EST 2023:PreFreeSurferPipeline.sh: Processing Modality: T2w
Mon Jan 23 16:24:34 EST 2023:PreFreeSurferPipeline.sh: NOT PERFORMING GRADIENT DISTORTION CORRECTION
Mon Jan 23 16:24:39 EST 2023:PreFreeSurferPipeline.sh: Averaging T2w Images
Mon Jan 23 16:24:39 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/AverageT2wImages
Mon Jan 23 16:24:39 EST 2023:PreFreeSurferPipeline.sh: PERFORMING SIMPLE AVERAGING
Mon Jan 23 16:24:39 EST 2023:AnatomicalAverage.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:24:39 EST 2023:AnatomicalAverage.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:24:39 EST 2023:AnatomicalAverage.sh: Images:  /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w1_gdc /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w2_gdc /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w3_gdc  Output: /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w
Final FOV is: 
0.000000 456.000000 0.000000 36.000000 102.000000 400.000000 

Final FOV is: 
0.000000 456.000000 0.000000 36.000000 102.000000 400.000000 

Final FOV is: 
0.000000 456.000000 0.000000 36.000000 102.000000 400.000000 

1.000559 0.000046 0.000001 -0.048667 
0.000001 0.999672 0.000021 0.008574 
0.000001 -0.000208 0.999747 0.021290 
0.000000 0.000000 0.000000 1.000000 

Mon Jan 23 16:33:13 EST 2023:PreFreeSurferPipeline.sh: Aligning T2w image to /opt/HCP/HCPpipelines/global/templates/MNI152_T2_0.7mm.nii.gz to create native volume space
Mon Jan 23 16:33:13 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/ACPCAlignment
Mon Jan 23 16:33:13 EST 2023:ACPCAlignment.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:33:13 EST 2023:ACPCAlignment.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:33:13 EST 2023:ACPCAlignment.sh: START
Final FOV is: 
0.000000 456.000000 0.000000 36.000000 101.000000 400.000000 

Mon Jan 23 16:34:04 EST 2023:ACPCAlignment.sh: END
Mon Jan 23 16:34:04 EST 2023:PreFreeSurferPipeline.sh: Performing Brain Extraction using FNIRT-based Masking
Mon Jan 23 16:34:04 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/BrainExtraction_FNIRTbased
Mon Jan 23 16:34:04 EST 2023:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 16:34:04 EST 2023:BrainExtraction_FNIRTbased.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 16:34:04 EST 2023:BrainExtraction_FNIRTbased.sh: HCPPIPEDIR_Templates: /opt/HCP/HCPpipelines/global/templates
Mon Jan 23 16:34:04 EST 2023:BrainExtraction_FNIRTbased.sh: START: BrainExtraction_FNIRT
WARNING::in calculating COG, total = 0.0
WARNING::in calculating COG, total = 0.0
WARNING::in calculating COG, total = 0.0
WARNING::in calculating COG, total = 0.0
WARNING::in calculating COG, total = 0.0
WARNING::in calculating COG, total = 0.0
Mon Jan 23 17:32:34 EST 2023:BrainExtraction_FNIRTbased.sh: END: BrainExtraction_FNIRT
Mon Jan 23 17:32:34 EST 2023:PreFreeSurferPipeline.sh: Performing SiemensFieldMap Readout Distortion Correction
Mon Jan 23 17:32:34 EST 2023:PreFreeSurferPipeline.sh: mkdir -p /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg
Mon Jan 23 17:32:34 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
Mon Jan 23 17:32:34 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: FSLDIR: /opt/fsl/fsl
Mon Jan 23 17:32:34 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: HCPPIPEDIR_Global: /opt/HCP/HCPpipelines/global/scripts
Mon Jan 23 17:32:35 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: START
 
 
 
FieldMapPreprocessingAll.sh: HCPPIPEDIR: /opt/HCP/HCPpipelines
FieldMapPreprocessingAll.sh: FSLDIR: /opt/fsl/fsl
FieldMapPreprocessingAll.sh: HCPPIPEDIR_Global: /opt/HCP/HCPpipelines/global/scripts
Mon Jan 23 17:32:35 EST 2023:FieldMapPreprocessingAll.sh: Field Map Preprocessing and Gradient Unwarping
Mon Jan 23 17:32:35 EST 2023:FieldMapPreprocessingAll.sh: START
Usage: fsl_prepare_fieldmap <scanner> <phase_image> <magnitude_image> <out_image> <deltaTE (in ms)> [--nocheck]
 
  Prepares a fieldmap suitable for FEAT from SIEMENS data - saves output in rad/s format
  <scanner> must be SIEMENS
  <magnitude image> should be Brain Extracted (with BET or otherwise)
  <deltaTE> is the echo time difference of the fieldmap sequence - find this out form the operator (defaults are *usually* 2.46ms on SIEMENS)
  --nocheck supresses automatic sanity checking of image size/range/dimensions
 
   e.g. fsl_prepare_fieldmap SIEMENS images_3_gre_field_mapping images_4_gre_field_mapping fmap_rads 2.65
Mon Jan 23 17:33:14 EST 2023:FieldMapPreprocessingAll.sh: While running '/opt/HCP/HCPpipelines/global/scripts/FieldMapPreprocessingAll.sh --workingdir=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap --method=SiemensFieldMap --fmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz --fmapphase=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz --echodiff= --ofmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/Magnitude --ofmapmagbrain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/Magnitude_brain --ofmap=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap --gdcoeffs=NONE':
Mon Jan 23 17:33:14 EST 2023:FieldMapPreprocessingAll.sh: ERROR: '/opt/fsl/fsl/bin/fsl_prepare_fieldmap' command failed with return code: 1
Mon Jan 23 17:33:14 EST 2023:FieldMapPreprocessingAll.sh: ERROR: '/opt/fsl/fsl/bin/fsl_prepare_fieldmap' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: FieldMapPreprocessingAll.sh
stopped at line: 170
           call: ${FSLDIR}/bin/fsl_prepare_fieldmap SIEMENS ${WD}/Phase ${WD}/Magnitude_brain ${WD}/FieldMap ${DeltaTE}
  expanded call: /opt/fsl/fsl/bin/fsl_prepare_fieldmap SIEMENS /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap/Phase /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap/Magnitude_brain /Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap/FieldMap
       hostname: 7ce105f07731
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Mon Jan 23 17:33:14 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/T2wToT1wDistortionCorrectAndReg.sh --workingdir=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg --t1=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc --t1brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_brain --t2=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w_acpc --t2brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w_acpc_brain --fmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz --fmapphase=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz --fmapgeneralelectric= --echodiff= --SEPhaseNeg= --SEPhasePos= --seechospacing= --seunwarpdir= --t1sampspacing= --t2sampspacing= --unwarpdir= --ot1=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_dc --ot1brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_dc_brain --ot1warp=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/xfms/T1w_dc --ot2=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T2w_acpc_dc --ot2warp=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/xfms/T2w_reg_dc --method=SiemensFieldMap --topupconfig= --gdcoeffs=NONE --usejacobian=true':
Mon Jan 23 17:33:14 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: ERROR: '/opt/HCP/HCPpipelines/global/scripts/FieldMapPreprocessingAll.sh' command failed with return code: 1
Mon Jan 23 17:33:14 EST 2023:T2wToT1wDistortionCorrectAndReg.sh: ERROR: '/opt/HCP/HCPpipelines/global/scripts/FieldMapPreprocessingAll.sh' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: T2wToT1wDistortionCorrectAndReg.sh
stopped at line: 245
           call: ${HCPPIPEDIR_Global}/FieldMapPreprocessingAll.sh --workingdir=${WD}/FieldMap --method="SiemensFieldMap" --fmapmag=${MagnitudeInputName} --fmapphase=${PhaseInputName} --echodiff=${TE} --ofmapmag=${WD}/Magnitude --ofmapmagbrain=${WD}/Magnitude_brain --ofmap=${WD}/FieldMap --gdcoeffs=${GradientDistortionCoeffs}
  expanded call: /opt/HCP/HCPpipelines/global/scripts/FieldMapPreprocessingAll.sh --workingdir=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap --method=SiemensFieldMap --fmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz --fmapphase=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz --echodiff= --ofmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/Magnitude --ofmapmagbrain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/Magnitude_brain --ofmap=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg/FieldMap --gdcoeffs=NONE
       hostname: 7ce105f07731
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Mon Jan 23 17:33:14 EST 2023:PreFreeSurferPipeline.sh: While running '/opt/HCP/HCPpipelines/PreFreeSurfer/PreFreeSurferPipeline.sh --path=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp --subject=PALS_011 --t1=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T1w/PALS_011_T1w_MPR2.nii.gz --t2=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC1.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC2.nii.gz@/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/T2w/PALS_011_T2w_SPC3.nii.gz --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 --fmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz --fmapphase=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz --gdcoeffs=NONE --avgrdcmethod=SiemensFieldMap --processing-mode=HCPStyleData':
Mon Jan 23 17:33:14 EST 2023:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/T2wToT1wDistortionCorrectAndReg.sh' command failed with return code: 1
Mon Jan 23 17:33:14 EST 2023:PreFreeSurferPipeline.sh: ERROR: '/opt/HCP/HCPpipelines/PreFreeSurfer/scripts/T2wToT1wDistortionCorrectAndReg.sh' command failed with return code: 1

===> ERROR: Command returned with nonzero exit code
---------------------------------------------------
         script: PreFreeSurferPipeline.sh
stopped at line: 629
           call: ${RUN} ${HCPPIPEDIR_PreFS}/T2wToT1wDistortionCorrectAndReg.sh --workingdir=${wdir} --t1=${T1wFolder}/${T1wImage}_acpc --t1brain=${T1wFolder}/${T1wImage}_acpc_brain --t2=${T2wFolder_T2wImageWithPath_acpc} --t2brain=${T2wFolder_T2wImageWithPath_acpc_brain} --fmapmag=${MagnitudeInputName} --fmapphase=${PhaseInputName} --fmapgeneralelectric=${GEB0InputName} --echodiff=${TE} --SEPhaseNeg=${SpinEchoPhaseEncodeNegative} --SEPhasePos=${SpinEchoPhaseEncodePositive} --seechospacing=${SEEchoSpacing} --seunwarpdir=${SEUnwarpDir} --t1sampspacing=${T1wSampleSpacing} --t2sampspacing=${T2wSampleSpacing} --unwarpdir=${UnwarpDir} --ot1=${T1wFolder}/${T1wImage}_acpc_dc --ot1brain=${T1wFolder}/${T1wImage}_acpc_dc_brain --ot1warp=${T1wFolder}/xfms/${T1wImage}_dc --ot2=${T1wFolder}/${T2wImage}_acpc_dc --ot2warp=${T1wFolder}/xfms/${T2wImage}_reg_dc --method=${AvgrdcSTRING} --topupconfig=${TopupConfig} --gdcoeffs=${GradientDistortionCoeffs} --usejacobian=${UseJacobian}
  expanded call: /opt/HCP/HCPpipelines/PreFreeSurfer/scripts/T2wToT1wDistortionCorrectAndReg.sh --workingdir=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2wToT1wDistortionCorrectAndReg --t1=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc --t1brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_brain --t2=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w_acpc --t2brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T2w/T2w_acpc_brain --fmapmag=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Magnitude.nii.gz --fmapphase=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/unprocessed/FieldMap99/PALS_011_FieldMap_Phase.nii.gz --fmapgeneralelectric= --echodiff= --SEPhaseNeg= --SEPhasePos= --seechospacing= --seunwarpdir= --t1sampspacing= --t2sampspacing= --unwarpdir= --ot1=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_dc --ot1brain=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T1w_acpc_dc_brain --ot1warp=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/xfms/T1w_dc --ot2=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/T2w_acpc_dc --ot2warp=/Users/kolobarica/Desktop/pals/sessions/PALS_011/hcp/PALS_011/T1w/xfms/T2w_reg_dc --method=SiemensFieldMap --topupconfig= --gdcoeffs=NONE --usejacobian=true
       hostname: 7ce105f07731
      exit code: 1
---------------------------------------------------

===> Aborting execution!

Hi,

It appears that you are missing the qunex parameter hcp_echodiff

The delta in TE times for the hi-res fieldmap image

or, as defined in the hcp pipeline

echo time difference for fieldmap images (in milliseconds)

You can add this parameter either to your batch file or directly to the command.

Another potential problem is that qunex currently can only handle one phase and one magnitude image for each fieldmap pair (i.e., phase and magnitude images have the same number). The single phase image should be the difference in phase between the two images. In this case, qunex will only pass image 232 and 242 to the HCP pipeline.

Lining