[RESOLVED] Hcp_pre_freesurfer errors when using Siemens fieldmap

Continuing the discussion from [RESOLVED] Hcp_fmri_volume errors when using Siemens fieldmap:

Description:

Dear Qunex experts, I am getting the same error in hcp_pre_freesurfer pipeline. Both phase and magnitude fieldmaps are present: /unprocessed/FieldMap/1002_FieldMap_Magnitude.nii.gz /unprocessed/FieldMap/1002_FieldMap_Phase.nii.gz and the fieldmaps have fm(1) specified in the batch file (attached). However, I am getting the following error:

Logs:

# Generated by QuNex 0.93.6 on 2022-08-22_20.06.41.541732
#
=================================================================
gmri hcp_pre_freesurfer \
  --sessionsfolder="/storage/brno2/home/pe_so/qunex/ocd/sessions" \
  --sessions="/storage/brno2/home/pe_so/qunex/ocd/processing/batch.txt" \
  --overwrite="no" \
  --logfolder="/storage/brno2/home/pe_so/qunex/ocd/processing/logs" \
  --sessionids="" \
=================================================================

Starting multiprocessing sessions in /storage/brno2/home/pe_so/qunex/ocd/processing/batch.txt with a pool of 1 concurrent processes

---- Running local

Starting processing of sessions 1002 at Monday, 22. August 2022 20:06:41

------------------------------------------------------------
Session id: 1002 
[started on Monday, 22. August 2022 20:06:41]
Running HCP PreFreeSurfer Pipeline [HCPStyleData] ...

---> T1w image file present.
---> T2w image file present.
ERROR: Unknown error occured: 
...................................
Traceback (most recent call last):
  File "/opt/qunex/python/qx_utilities/hcp/process_hcp.py", line 735, in hcp_pre_freesurfer
    fmmag = hcp['fieldmap'][int(fmnum)]['magnitude']
KeyError: 1
...................................

HCP PreFS completed on Monday, 22. August 2022 20:06:41

Thank you for your help,
Petr
batch.txt (3.1 KB)

Hi Petr,

can you try setting

--hcp_avgrdcmethod=="SiemensFieldMap"

You can set this in the command call or change line #31 in your batch file. Let me know if this works.

Thanks!

Hi Jure,
unfortunately the same error occurs:/
Petr

The algorithm looks for the FieldMap Magnitude file with the following pattern:

/storage/brno2/home/pe_so/qunex/ocd/sessions/1002/hcp/1002/unprocessed/FieldMap*/1002*_FieldMap_Magnitude.nii.gz

Can you provide us with contents of

/storage/brno2/home/pe_so/qunex/ocd/sessions/1002/hcp/1002/unprocessed/

And also the contents of any FieldMap subfolders if they exist. Thanks!

The files should be at:

/unprocessed/FieldMap1/1002_FieldMap_Magnitude.nii.gz
/unprocessed/FieldMap1/1002_FieldMap_Phase.nii.gz

All of this is created in the import_dicom => create_session_info => setup_hcp pipeline. Did you maybe do any edits to input parameters, files or output folders after you ran this or in the middle of running it?

Hi Jure,
this is the content of the /unprocessed folder:

Diffusion FieldMap T1w T2w

./Diffusion:
1002_DWI_dir30_AP.bval 1002_DWI_dir30_AP.bvec 1002_DWI_dir30_AP.nii.gz 1002_DWI_dir30_PA.bval 1002_DWI_dir30_PA.bvec 1002_DWI_dir30_PA.nii.gz

./FieldMap:
1002_FieldMap_Magnitude.nii.gz 1002_FieldMap_Phase.nii.gz

./T1w:
1002_T1w_MPR1.nii.gz

./T2w:
1002_T2w_SPC1.nii.gz

I am not aware to change anything during/after import_dicom => create_session_info => setup_hcp pipeline but I will rerun the steps to be sure.

Thank you, Petr

Can you also paste the mapping file here, just so we have all the information, thanks!

So, the problem is that /unprocessed/FieldMap/1002_FieldMap_Magnitude.nii.gz should be stored in /unprocessed/FieldMap1/1002_FieldMap_Magnitude.nii.gz. Let us know if the 1 will be again missing from the FieldMap folder and we will investigate what is going on. We ran some tests but were unable to reproduce the described issue.