Import dicom raising No such file or directory error

Description:

Hi,

I have already used create study successfully, and now want to use import_dicom**:**

qunex_container import_dicom \
>     --sessionsfolder="${STUDY_FOLDER}/sessions"\
>     --sessions="${SESSIONS}" \
>     --masterinbox="${RAW_DATA}" \
>     --dockeropt="-v ${BIND_FOLDER}:${BIND_FOLDER}"\
>     --archive="leave" \
>     --container="${QUNEX_CONTAINER}"\
>     --overwrite=yes

I keep getting this error:

---> QuNex will run the command over 1 sessions. It will utilize:

    Maximum sessions run in parallel for a job: 1.
    Maximum elements run in parallel for a session: 1.
    Up to 1 processes will be utilized for a job.

    Job #1 will run sessions: 041
bash: /home/docker/volumes/hcppipelines/gili/couples_study/processing/logs/batchlogs/qunex_container_command_2026-05-05_20.06.52.064927.sh: No such file or directory

When I go to the batchlogs folders manually to check, the file which is reported nonexistent does exist.

What am I doing wrong to cause this?

Thank you!

Hi gilinaggar,

Welcome to the QuNex forum!

The most likely culprit is that you need to spefically give the system inside the QuNex container access to the location (folder). Try this:

qunex_container import_dicom \
  --sessionsfolder="${STUDY_FOLDER}/sessions"\
  --sessions="${SESSIONS}" \
  --masterinbox="${RAW_DATA}" \
  --bind="/home/docker/volumes/hcppipelines/gili:/home/docker/volumes/hcppipelines/gili" \
  --archive="leave" \
  --container="${QUNEX_CONTAINER}"\
  --overwrite=yes

I already see that you are doing some binding with --dockeropt, that should work as well, but a more elegant way is to use the --bind parameter. If needed also add ${BIND_FOLDER}:${BIND_FOLDER} to the bind parameter, just add a comma between multiple binds.

Let me know how it goes.

Hey Jure,

Thank you so much for the help! This worked and I moved on with the preprocessing.

When trying to run hcp_icafix I ran into a problem which I assume had to do with the way tasks are defined in my mapping and batch file, will greatly appreciate your help.

My code:

export QUNEX_CONTAINER=“qunexcontainer:0.99.2d_edited”
qunex_container hcp_icafix 
–sessionsfolder=“${STUDY_FOLDER}/sessions” 
–batchfile=“${STUDY_FOLDER}/processing/batch.txt” 
–sessions=“${SESSIONS}”
-hcp_icafix_bolds=“rsfMRI,tfMRI_EmotionalNBack,tfMRI_social_dialogue_video_AP,tfMRI_social_dynamic_video_AP,tfMRI_neutral_nature_video_AP,tfMRI_neutral_painting_video_AP”
–bind=“/home/docker/volumes/hcppipelines/gilinaggar:/home/docker/volumes/hcppipelines/gilinaggar”
–container=“${QUNEX_CONTAINER}” \ 
–parsessions=3 
–hcp_filename=userdefined


the error I got:

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

Session id: 041 

[started on Monday, 11. May 2026 08:32:44]

Running HCP ICAFix pipeline [HCPStyleData] ...



Comparing bolds with those specifed via parameters

     ... all bolds specified via hcp_icafix_bolds are present



Single-run HCP ICAFix on 6 bolds



Processing 2 ICAFix elements in parallel



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

---> Processing BOLD image 6

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/6/6.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



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

---> Processing BOLD image 1

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/1/1.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



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

---> Processing BOLD image 5

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/5/5.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



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

---> Processing BOLD image 4

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/4/4.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



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

---> Processing BOLD image 2

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/2/2.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



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

---> Processing BOLD image 3

     ... ERROR: bold image [/home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp/041/MNINonLinear/Results/3/3.nii.gz] missing!

---> ERROR: something missing, skipping this BOLD!



HCP ICAFix completed on Monday, 11. May 2026 08:32:44

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





===> Final report for command hcp_icafix

... 041 ---> HCP ICAFix: 6, 1, 5, 4, 2, 3 not ready

===> Not all tasks completed fully!

My mapping file:

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

T1w_MPRAGE_RL           => T1w
T2w_SPC_RL              => T2w
SpinEchoFieldMap_AP     => SE-FM-AP
SpinEchoFieldMap_PA     => SE-FM-PA
rsfMRI_AP_SBRef  => boldref:rest:filename(rsfMRI_SBRef)
rsfMRI_AP        => bold:rest:filename(rsfMRI)
tfMRI_EmotionalNBack_AP     => bold:emot_nback1:filename(tfMRI_EmotionalNBack)
tfMRI_EmotionalNBack_AP_SBRef     => boldref:emot_nbackref1:filename(tfMRI_EmotionalNBack_SBRef)
tfMRI_social_dialogue_video_AP     => bold:social_dia1:filename(tfMRI_social_dialogue_video_AP)
tfMRI_social_dialogue_video_AP_SBRef     => boldref:social_diaref1:filename(tfMRI_social_dialogue_video_AP_SBRef)
tfMRI_social_dynamic_video_AP     => bold:social_dyn1:filename(tfMRI_social_dynamic_video_AP)
tfMRI_social_dynamic_video_AP_SBRef     => boldref:social_dynref1:filename(tfMRI_social_dynamic_video_AP_SBRef)
tfMRI_neutral_nature_video_AP     => bold:neutral_nat1:filename(tfMRI_neutral_nature_video_AP)
tfMRI_neutral_nature_video_AP_SBRef     => boldref:neutral_natref1:filename(tfMRI_neutral_nature_video_AP_SBRef)
tfMRI_neutral_painting_video_AP     => bold:neutral_pain1:filename(tfMRI_neutral_painting_video_AP)
tfMRI_neutral_painting_video_AP_SBRef     => boldref:neutral_painref1:filename(tfMRI_neutral_painting_video_AP_SBRef)
dMRI_MB4_185dirs_d15D45_AP_SBRef        => DWI:dir185_AP_SBRef
dMRI_MB4_185dirs_d15D45_AP        => DWI:dir185_AP
dMRI_MB4_6dirs_d15D45_PA_SBRef        => DWI:dir6_PA_SBRef
dMRI_MB4_6dirs_d15D45_PA        => DWI:dir6_PA


My batch file:

# Generated by QuNex 1.3.0 [QIO] on 2026-05-06_08.32.18.266886

#

# Sessions folder: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions

# Source files: ['session_hcp.txt']

# Parameter file: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/specs/couples_study_batch_file.txt

#

# Generated by QuNex 0.98.1 on 2024-02-05_10.23.19.657180

#

# Sessions folder: /home/docker/volumes/hcppipelines/asaf_decoy_mouse/decoy/sessions

# Source files: ['session_hcp.txt']

# Parameter file: /home/docker/volumes/hcppipelines/asaf_decoy_mouse/decoy/sessions/specs/batch.txt

#

# Generated by QuNex 0.98.1 on 2023-07-31_10.00.04.704860

#

# Sessions folder: /Users/elaine/qunex/decoy/sessions

# Source files: ['session_hcp.txt']

# Parameter file: /Users/elaine/qunex/decoy_data/decoy_batch_file.txt

#

# -------------------------------------------------

# -- Qu|Nex Environment Preprocessing Parameters --

# -------------------------------------------------



# -------------------------------------

# ---> HCP Pipelines general parameters

# -------------------------------------

_hcp_Pipeline            : ${HCPPIPEDIR}

_parsessions             : 1

_parelements             : 2



# -------------------------------------

# ---> Pre FreeSurfer parameters

# -------------------------------------

_hcp_suffix             :

_hcp_brainsize          : 150

_hcp_t2                 : t2

_hcp_fmap               : NONE

_hcp_t1samplespacing    : 0.0000098 # taken from Shachar's pipeline scripts (run_PreFreeSurfer_HCP.sh)

_hcp_t2samplespacing    : 0.0000026 # taken from Shachar's pipeline scripts (run_PreFreeSurfer_HCP.sh)

_hcp_unwarpdir          : y

_hcp_avgrdcmethod       : TOPUP

_hcp_topupconfig        : b02b0.cnf

_hcp_printcom           :

_hcp_sephaseneg         : AP

_hcp_sephasepos         : PA

_hcp_seechospacing      : 0.000575072

_hcp_seunwarpdir        : y





# -------------------------------------

# ---> FreeSurfer parameters

# -------------------------------------

_hcp_freesurfer_home    : ${FREESURFER_HOME}





# -------------------------------------

# ---> Post FreeSurfer parameters

# -------------------------------------

_hcp_regname            : MSMSulc

_hcp_grayordinatesres   : 2

_hcp_hiresmesh          : 164

_hcp_lowresmesh         : 32





# -------------------------------------

# ---> Diffusion preprocessing - N/A

# -------------------------------------

_hcp_dwi_echospacing    : 0.689998

_hcp_dwi_PEdir          : 2





# -------------------------------------

# ---> fMRI Volume parameters

# -------------------------------------

_hcp_bold_echospacing   : 0.000575072

_hcp_bold_echodiff      : NONE

_hcp_bold_dcmethod      : TOPUP

_hcp_bold_topupconfig   : b02b0.cnf

_hcp_bold_sbref         : use

_hcp_bold_sephaseneg    : AP

_hcp_bold_sephasepos    : PA

_hcp_bold_unwarpdir     : y-

_hcp_bold_res           : 2

_hcp_bold_gdcoeffs      : NONE

_hcp_bold_doslicetime   : FALSE

_hcp_bold_seimg         : independent

_hcp_bold_movref        : independent

_hcp_bold_prefix        :





# -------------------------------------

# ---> fMRI Surface parameters

# -------------------------------------

_hcp_bold_smoothFWHM    : 2





# -------------------------------------

# ---> Further BOLD analyses parameters

# -------------------------------------

_image_source       : hcp

_image_target       : cifti

_bolds              : emot_nback1,rest,social_dyn1,social_dia1,neutral_nat1,neutral_pain1

_TR                 : 0.75

_omit               : 0

_pignore            : hipass=linear|regress=spline|lopass=linear

_log                : keep

_glm_matrix         : both

_glm_residuals      : save



   # # ==========  _bold_actions  ==============

   #

   # m ... Motion scrubbing.

   # s ... Spatial smooting.

   # h ... High-pass filtering.

   # r ... Regression (nuisance and/or task) with an optional number 0, 1, or 2

   #       specifying the type of regression to use (see REGRESSION below).

   # c ... Saving of resulting beta coefficients (allways to follow 'r').

   # l ... Low-pass filtering.

   #

   # =========================================



_bold_actions       : shrcl





# -------------------------------------

# ---> BOLD de-noising parameters

# -------------------------------------

_bold_nuisance      : m,V,WM,WB

_event_file         :

_nprocess           : 0

_bold_prefix        :

_event_string       :

_event_file         :

_boldname           : bold

_shrinknsroi        : true





# -------------------------------------

# ---> CIFTI mapping naming variable

# -------------------------------------

_hcp_cifti_tail      : _Atlas





# -------------------------------------

# ---> Smoothing parameters

# -------------------------------------

_surface_smooth      : 2

_volume_smooth       : 2

_voxel_smooth        : 1

_smooth_mask         : nonzero

_dilate_mask         : ${TOOLS}/${QUNEXREPO}/library/data/atlases/MNITemplates/MNI152_T1_2mm_brain_mask.nii.gz





# -------------------------------------

# ---> Movement scrubbing parameters

# -------------------------------------

_mov_dvars:         3.0

_mov_dvarsme:       1.6

_mov_fd:            0.5

_mov_radius:        50.0

_mov_scrub:         yes

_mov_fidl:          udvarsme

_mov_plot:          mov_report

_mov_post:          udvarsme

_mov_before:        0

_mov_after:         0

_mov_bad:           udvarsme

_mov_mreport:       movement_report.txt

_mov_preport:       movement_report_post.txt

_mov_sreport:       movement_scrubbing_report.txt

_mov_pdf:           movement_plots

---



---





---

# Generated by QuNex 1.3.0 [QIO] on 2026-05-06_08.24.08.227133

#

session: 041

subject: 041



dicom: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/dicom

raw_data: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/nii

data: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/4dfp

hcp: /home/docker/volumes/hcppipelines/gilinaggar/couples_study/sessions/041/hcp


   


hcpready: true



11  :                :localizer_3D_2 (9X5X5) [1/3] i00001: TR(0.0076): PEDirection(i): DwellTime(8.1e-06)

12  :                :localizer_3D_2 (9X5X5) [2/3] i00004: TR(0.0076): PEDirection(i): DwellTime(8.1e-06)

13  :                :localizer_3D_2 (9X5X5) [3/3] i00007: TR(0.0076): PEDirection(j-): DwellTime(8.1e-06)

21  :SE-FM-AP        :SpinEchoFieldMap_AP: TR(8.152): PEDirection(j-): EchoSpacing(0.000570006): DwellTime(2.5e-06): se(1)

31  :SE-FM-PA        :SpinEchoFieldMap_PA: TR(8.152): PEDirection(j): EchoSpacing(0.000570006): DwellTime(2.5e-06): se(1)

41  :boldref1:rest   :rsfMRI_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(rsfMRI_SBRef): se(1)

51  :bold1:rest      :rsfMRI_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(rsfMRI): se(1)

61  :                :t2_tirm_FLAIR: TR(8): PEDirection(i): DwellTime(6e-06)

71  :boldref2:neutral_natref1:tfMRI_neutral_nature_video_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_neutral_nature_video_AP_SBRef): se(1)

81  :bold2:neutral_nat1:tfMRI_neutral_nature_video_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_neutral_nature_video_AP): se(1)

91  :boldref3:neutral_painref1:tfMRI_neutral_painting_video_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_neutral_painting_video_AP_SBRef): se(1)

101 :bold3:neutral_pain1:tfMRI_neutral_painting_video_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_neutral_painting_video_AP): se(1)

111 :T1w             :T1w_MPRAGE_RL: TR(2.4): DwellTime(9.8e-06): se(1)

121 :T1w             :T1w_MPRAGE_RL: TR(2.4): DwellTime(9.8e-06): se(1)

131 :boldref4:social_diaref1:tfMRI_social_dialogue_video_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_social_dialogue_video_AP_SBRef): se(1)

141 :bold4:social_dia1:tfMRI_social_dialogue_video_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_social_dialogue_video_AP): se(1)

151 :boldref5:social_dynref1:tfMRI_social_dynamic_video_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_social_dynamic_video_AP_SBRef): se(1)

161 :bold5:social_dyn1:tfMRI_social_dynamic_video_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_social_dynamic_video_AP): se(1)

171 :T2w             :T2w_SPC_RL: TR(3.2): PEDirection(i): DwellTime(2.6e-06): se(1)

181 :T2w             :T2w_SPC_RL: TR(3.2): PEDirection(i): DwellTime(2.6e-06): se(1)

191 :boldref6:emot_nbackref1:tfMRI_EmotionalNBack_AP_SBRef: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_EmotionalNBack_SBRef): se(1)

201 :bold6:emot_nback1:tfMRI_EmotionalNBack_AP: TR(0.75): PEDirection(j-): EchoSpacing(0.000575072): DwellTime(2.5e-06): filename(tfMRI_EmotionalNBack): se(1)

211 :DWI:dir6_PA_SBRef:dMRI_MB4_6dirs_d15D45_PA_SBRef: TR(3.5): PEDirection(j): EchoSpacing(0.000770008): DwellTime(2.6e-06): se(1)

221 :DWI:dir6_PA     :dMRI_MB4_6dirs_d15D45_PA: TR(3.5): PEDirection(j): EchoSpacing(0.000770008): DwellTime(2.6e-06): se(1)

231 :DWI:dir185_AP_SBRef:dMRI_MB4_185dirs_d15D45_AP_SBRef: TR(3.5): PEDirection(j-): EchoSpacing(0.000770008): DwellTime(2.6e-06): se(1)

241 :DWI:dir185_AP   :dMRI_MB4_185dirs_d15D45_AP: TR(3.5): PEDirection(j-): EchoSpacing(0.000770008): DwellTime(2.6e-06): se(1)

Thank you in advance!

Gili

Hi,

I see you are using 0.99.2d which is super old. This seems like a bug where hcp_icafix is not recognizing the hcp_filename=userdefined option and is trying to find files that use the automated naming convention (bolds 1, 2, 3, etc.).

I suggest you try using the latest QuNex version.

Best, Jure