[RESOLVED] Map_hcpls2nii incomplete mapping

Description:

Hello. I am trying to start a qunex study and import my data using import_hcp. The first step of copying over to the hcpls directory is successful. However, the second step which is the mapping to the nii directory is incomplete. Specifically, in my raw data directory, I have a Diffusion directory which has dMRI data acquired with two different numbers of directions, and only the one direction in mapped. One file name is 4006_3T_dMRI_dir99_AP (or PA) and the other is 4006_3T_dMRI_dir107_AP (or PA). The dir99 is mapped successfully while the dir107 is not.
I experimented with renaming the dir99 to dir95 and that did not work either.
Finally if I remove the dir99 data I get an error that no files were found to map in the directory.
I cannot see in the naming of the files or the hcp_batch.txt file something that would indicate it is restricted to a particular naming template for the study. Is there something I am missing?
Thank you!

Call:

export QUNEXCONIMAGE="/software/imaging/QuNex/0.93.6/qunex_suite-0.93.6.sif"

# set folders
STUDY_FOLDER="${HOME}/HCP/hcpya_test"
RAW_DATA="${HOME}/HCP/4006"
BATCH_TEMPLATE="${HOME}/HCP/hcp_batch.txt"
SESSIONS="4006_3T"

comlogs=${STUDY_FOLDER}/processing/logs/comlogs

######## step-by-step processing

# create study
qunex_container create_study \
  --studyfolder="${STUDY_FOLDER}"

# import data
qunex_container import_hcp \
    --sessionsfolder="${STUDY_FOLDER}/sessions" \
    --inbox="${RAW_DATA}" \
    --sessions="${SESSIONS}" \
    --action="copy" \
    --overwrite="yes" \
    --archive="leave" \
    --nameformat="(?P<subject_id>[^/]+?)/unprocessed/(?P<session_name>.*?)/(?P<data>.*)" \
    --hcplsname="hcpya" \
  --container="${QUNEXCONIMAGE}"

#################
Raw Diffusion Data attached as image.

![Screenshot 2023-02-01 at 16.31.51|690x150](upload://3saVYsq9QOUib4CnxzuGdIV1fgF.png)

Alternatively (if the image doesn't work) here is the path and list:

ls ${HOME}/HCP/4006/unprocessed/3T:

4006_3T_BIAS_32CH.json               4006_3T_dMRI_dir107_PA.json          4006_3T_dMRI_dir99_PA.json
4006_3T_BIAS_32CH.nii.gz             4006_3T_dMRI_dir107_PA.nii.gz        4006_3T_dMRI_dir99_PA.nii.gz
4006_3T_BIAS_BC.json                 4006_3T_dMRI_dir107_PA_SBRef.json    4006_3T_dMRI_dir99_PA_SBRef.json
4006_3T_BIAS_BC.nii.gz               4006_3T_dMRI_dir107_PA_SBRef.nii.gz  4006_3T_dMRI_dir99_PA_SBRef.nii.gz
4006_3T_dMRI_dir107_AP.bval          4006_3T_dMRI_dir99_AP.bval           4006_3T_SpinEchoFieldMap1_AP.json
4006_3T_dMRI_dir107_AP.bvec          4006_3T_dMRI_dir99_AP.bvec           4006_3T_SpinEchoFieldMap1_AP.nii.gz
4006_3T_dMRI_dir107_AP.json          4006_3T_dMRI_dir99_AP.json           4006_3T_SpinEchoFieldMap1_PA.json
4006_3T_dMRI_dir107_AP.nii.gz        4006_3T_dMRI_dir99_AP.nii.gz         4006_3T_SpinEchoFieldMap1_PA.nii.gz
4006_3T_dMRI_dir107_AP_SBRef.json    4006_3T_dMRI_dir99_AP_SBRef.json     4006_3T_SpinEchoFieldMap2_AP.json
4006_3T_dMRI_dir107_AP_SBRef.nii.gz  4006_3T_dMRI_dir99_AP_SBRef.nii.gz   4006_3T_SpinEchoFieldMap2_AP.nii.gz
4006_3T_dMRI_dir107_PA.bval          4006_3T_dMRI_dir99_PA.bval           4006_3T_SpinEchoFieldMap2_PA.json
4006_3T_dMRI_dir107_PA.bvec          4006_3T_dMRI_dir99_PA.bvec           4006_3T_SpinEchoFieldMap2_PA.nii.gz

OUTPUT:

--- Full QuNex call for command: import_hcp 

gmri import_hcp --sessionsfolder="/home/mszsa9/HCP_test/hcpya_test/sessions" --inbox="/home/mszsa9/HCP_test/4006" --action="copy" --overwrite="yes" --archive="leave" --nameformat="(?P<subject_id>[^/]+?)/unprocessed/(?P<session_name>.*?)/(?P<data>.*)" --hcplsname="hcpya" --sessions="4006_3T" 

--------------------------------------------------------- 


started running import_hcp at 2023-02-01 16:49:41, track progress in /home/mszsa9/HCP_test/hcpya_test/processing/logs/comlogs/tmp_import_hcp_4006_3T_2023-02-01_16.49.41.560315.log
call: gmri import_hcp sessionsfolder="/home/mszsa9/HCP_test/hcpya_test/sessions" inbox="/home/mszsa9/HCP_test/4006" action="copy" overwrite="yes" archive="leave" nameformat="(?P<subject_id>[^/]+?)/unprocessed/(?P<session_name>.*?)/(?P<data>.*)" hcplsname="hcpya" sessions="4006_3T"
-----------------------------------------
Running import_hcp
==================
--> identifying files in /home/mszsa9/HCP_test/4006
--> mapping files to QuNex hcpls folders
    --> creating hcpl session 4006_3T
info: subject 4006, session 3T
Running map_hcpls2nii for subject 4006, session 3T
==================================================
--> filesort: name_type_se
--> linked 01.nii.gz <-- 4006_3T_dMRI_dir99_AP_SBRef.nii.gz
--> linked 02.nii.gz <-- 4006_3T_dMRI_dir99_AP.nii.gz
--> linked 03.nii.gz <-- 4006_3T_dMRI_dir99_PA_SBRef.nii.gz
--> linked 04.nii.gz <-- 4006_3T_dMRI_dir99_PA.nii.gz

Final report
============
subject 4006, session 3T completed ok. 4 images mapped

-----------------------------------------
Finished at 2023-02-01 16:49:42

===> Successful completion of task


Hi StephAssim!

Welcome to the QuNex forums!

I was able to reproduce your behavior. A current workaround is to rename all dir107 files to dir98. For the next version of QuNex I will update the importer, so it will be also able to import also dirXY where XY falls out of the usual HCP values. The HCP diffusion data usually fits two of the below patterns:

  1. dMRI_dir[98-99]_[AP/PA],
  2. DWI_dir[95-95]_[LR/RL],

And current version of QuNex looks for these two patterns specifically. Like I said, the next version (probably released next week) will be more flexible when it comes to numerical values behind the dir string.

Kind regards, Jure