[RESOLVED] Incorrect mapping

Dear Jure:

I ran into a problem with a the mapping text file. For whatever reason, the mapped files (under <>/unprocessed) do not correspond to the sequences that I specified in my mapping text.

For example, in my mapping file:

t1_mprage_sag_iso  => T1w
t2_space_sag       => T2w
ep2d_se_AP  => SE-FM-AP
ep2d_se_PA  => SE-FM-PA
ep2d_diff_mddw_99_AP        => DWI:dir99_AP
ep2d_diff_mddw_99_PA       => DWI:dir99_PA
ep2d_diff_mddw_98_AP       => DWI:dir98_AP
ep2d_diff_mddw_98_PA        => DWI:dir98_PA

But after running create_study,map_raw_data,import_dicom,create_session_info,setup_hcp, the following sequences were mapped instead (from session_<>.txt):

# Generated by QuNex 0.96.2 on 2023-05-09_14.38.57.240269
#
session: CLC555
subject: CLC555
dicom: /home/ehui/qunex/cimt/sessions/CLC555/dicom
raw_data: /home/ehui/qunex/cimt/sessions/CLC555/nii
data: /home/ehui/qunex/cimt/sessions/CLC555/4dfp
hcp: /home/ehui/qunex/cimt/sessions/CLC555/hcp
hcpready: true
11  :                :AAHead_Scout_
21  :                :AAHead_Scout__MPR_sag [1/4] i02001
22  :                :AAHead_Scout__MPR_sag [2/4] i02002
23  :                :AAHead_Scout__MPR_sag [3/4] i02003
24  :                :AAHead_Scout__MPR_sag [4/4] i02004
31  :                :AAHead_Scout__MPR_cor [1/3] i03001
32  :                :AAHead_Scout__MPR_cor [2/3] i03002
33  :                :AAHead_Scout__MPR_cor [3/3] i03003
41  :                :AAHead_Scout__MPR_tra [1/3] i04001
42  :                :AAHead_Scout__MPR_tra [2/3] i04002
43  :                :AAHead_Scout__MPR_tra [3/3] i04003
51  :                :t1_mprage_sag_iso
61  :T2w             :t2_space_sag: se(1)
71  :T1w             :vessel_scout_head: se(1)
81  :                :vessel_scout_head_MSUM
91  :                :vessel_scout_head_MSUM_MIP_SAG
101 :                :vessel_scout_head_MSUM_MIP_COR
111 :                :ep2d_se_AP
121 :SE-FM-AP        :ep2d_se_PA: se(1)
131 :SE-FM-PA        :ep2d_diff_mddw_99_AP: se(1)
141 :DWI:dir99_AP    :ep2d_diff_mddw_99_AP_ADC: se(1)
151 :                :ep2d_diff_mddw_99_AP_TRACEW
161 :                :ep2d_diff_mddw_99_AP_FA
171 :                :ep2d_diff_mddw_99_AP_ColFA
191 :                :ep2d_diff_mddw_99_AP_TENSOR_B0
201 :                :ep2d_diff_mddw_99_PA
211 :                :ep2d_diff_mddw_99_PA_ADC
221 :DWI:dir99_PA    :ep2d_diff_mddw_99_PA_TRACEW: se(1)
231 :                :ep2d_diff_mddw_99_PA_FA
241 :                :ep2d_diff_mddw_99_PA_ColFA
261 :                :ep2d_diff_mddw_99_PA_TENSOR_B0
271 :                :ep2d_diff_mddw_98_AP
281 :                :ep2d_diff_mddw_98_AP_ADC
291 :                :ep2d_diff_mddw_98_AP_TRACEW
301 :DWI:dir98_AP    :ep2d_diff_mddw_98_AP_FA: se(1)
311 :                :ep2d_diff_mddw_98_AP_ColFA
331 :                :ep2d_diff_mddw_98_AP_TENSOR_B0
341 :                :ep2d_diff_mddw_98_PA
351 :                :ep2d_diff_mddw_98_PA_ADC
361 :                :ep2d_diff_mddw_98_PA_TRACEW
371 :                :ep2d_diff_mddw_98_PA_FA
381 :DWI:dir98_PA    :ep2d_diff_mddw_98_PA_ColFA: se(1)

Please kindly advise.

Many thanks for your help as always!

Best,
Ed

Hi Ed,

I cannot reproduce the issue with the mapping snippet you provided. Could you please share the complete mapping file and the session.txt?
Note that in mapping files rules defined using image numbers always take precedence. For example, a set of rules like this could cause the behavior you observed.

71 => T1w
t1_mprage_sag_iso  => T1w

Best,
Lining

Hi Lining:
006_mapping_steven_chau.txt (224 Bytes)
session_hcp.txt (2.5 KB)
session.txt (1.8 KB)

Please find my mapping file (006_mapping_steven_chau.txt), and the session files. I have also shared the zip file (link) with all the dicom data for your reference. And below is the script that I used to run the qunex container:

export SDIR=“${HOME}”
PATH=${SDIR}/qunex:${PATH}
export STUDY_NAME=“cimt”
export WORK_DIR=“${SDIR}/qunex”
export QUNEX_CONTAINER=“gitlab.qunex.yale.edu:5002/qunex/qunexcontainer:0.93.6”
export RAW_DATA=“${WORK_DIR}/data”
export INPUT_BATCH_FILE=“${RAW_DATA}/006_batch.txt”
export INPUT_MAPPING_FILE=“${RAW_DATA}/006_mapping_steven_chau.txt”
export SESSIONS=“CLC555”
export RUNTURNKEY_TYPE=“local”
export RUNTURNKEY_STEPS=“create_study,map_raw_data,import_dicom,create_session_info,setup_hcp,create_batch,hcp_pre_freesurfer,hcp_freesurfer,hcp_post_freesurfer,hcp_fmri_volume,hcp_fmri_surface,hcp_diffusion”
qunex_container run_turnkey
–rawdatainput=“${RAW_DATA}”
–paramfile=“${INPUT_BATCH_FILE}”
–mappingfile=“${INPUT_MAPPING_FILE}”
–workingdir=“${WORK_DIR}”
–projectname=“${STUDY_NAME}”
–path=“${WORK_DIR}/${STUDY_NAME}”
–sessions=“${SESSIONS}”
–sessionids=“${SESSIONS}”
–sessionsfoldername=“sessions”
–turnkeytype=“${RUNTURNKEY_TYPE}”
–nv
–container=“${QUNEX_CONTAINER}”
–turnkeysteps=“${RUNTURNKEY_STEPS}”
–overwrite=“yes”

Hi Ed,

The mapping file you shared only contains mapping rules for diffusion. However, the session_hcp.txt shows that T1, T2, and spin-echo images are also mapped. Since you are using run_turnkey, the mapping file is copied from ${INPUT_MAPPING_FILE} to /home/ehui/qunex/cimt/sessions/specs during the map_raw_data step. Could you also show me that file, in case it’s different?

Could you also confirm the qunex container version you are using?

Hi Lining:

Below is the /home/ehui/qunex/cimt/sessions/specs/006_mapping_steven_chau.txt:

#  HCP mapping file
#  ----------------

71              => T1w
61              => T2w
121  => SE-FM-AP
131  => SE-FM-PA
141        => DWI:dir99_AP
221        => DWI:dir99_PA
301        => DWI:dir98_AP
381        => DWI:dir98_PA

Like you said, it is different from the one I specified. I am not sure about the version of my qunex_container, but is definitely not the current version. I tried using the latest qunex_container but it appeared that the /home/ehui/qunex/cimt/sessions/specs/006_mapping_steven_chau.txt was not updated.

When I manually deleted /home/ehui/qunex/cimt/sessions/specs/006_mapping_steven_chau.txt, the mapping was finally correct!

Thanks so much for your help.

Best,
Ed