PennLINC / qsirecon

Reconstruction of preprocessed q-space images (dMRI)
https://qsirecon.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

AFQ Recon workflow missing "itk_file" error #18

Open pierre-nedelec opened 3 months ago

pierre-nedelec commented 3 months ago

Summary

AFQ reconstruction (pyafq_tractometry) outputs some errors and doesn't stop there, although it seems stuck in the next step for a long time (still "running" after 30+min | UPDATE: I killed it after 50min).

ValueError: PyAFQRecon requires a value for input 'itk_file'. For a list of required inputs, see PyAFQRecon.help()

Also, how to use PyAFQRecon.help() for more details?

Additional details

What were you trying to do?

Run reconstruction only:

singularity run --cleanenv --nv \
    -B ${OUTPUT_DIR}:/derivatives:ro \
    -B ${OUTPUT_DIR}:/out \
    -B ${WORK_DIR}:${WORK_DIR} \
    -B ${FS_LICENSE}:/opt/freesurfer/license.txt \
    /path/to/qsiprep_${QSIPREP_VERSION}.sif \
    /derivatives/ /out participant \
    --fs-license-file /opt/freesurfer/license.txt \
    --work-dir ${WORK_DIR} \
    --nthreads ${ncpus} \
    --omp-nthreads $((ncpus)) \
    --participant_label ${subjectID} \
    --output-resolution 1.7 \
    --recon_input /derivatives/qsiprep \
    --recon_only \
    --recon_spec pyafq_tractometry \
    -v -v --skip_bids_validation

What did you expect to happen?

To run without errors.

What actually happened?

WARNING:nipype.workflow:[Node] Error on "qsirecon_0_22_wf.sub-${subjectID}_pyafq_tractometry.sub_${subjectID}_ses_${sessionID}_dir_AP_space_T1w_desc_preproc_recon_wf.pyafq_tractometry.run_afq" (${workdir}/qsiprep_${subjectID}/qsirecon_0_22_wf/sub-${subjectID}_pyafq_tractometry/sub_${subjectID}_ses_${sessionID}_dir_AP_space_T1w_desc_preproc_recon_wf/pyafq_tractometry/run_afq)
ERROR:concurrent.futures:exception calling callback for <Future at 0x7f3d9ec2bbb0 state=finished raised FileNotFoundError>
concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 722, in _run_command
    result = self._interface.run(cwd=outdir, ignore_exception=True)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 388, in run
    self._check_mandatory_inputs()
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 275, in _check_mandatory_inputs
    raise ValueError(msg)
ValueError: PyAFQRecon requires a value for input 'itk_file'. For a list of required inputs, see PyAFQRecon.help()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 70, in run_node
    result["result"] = node.result
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 223, in result
    return _load_resultfile(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/utils.py", line 291, in load_resultfile
    raise FileNotFoundError(results_file)
FileNotFoundError: ${workdir}/qsiprep_${subjectID}/qsirecon_0_22_wf/sub-${subjectID}_pyafq_tractometry/sub_${subjectID}_ses_${sessionID}_dir_AP_space_T1w_desc_preproc_recon_wf/pyafq_tractometry/run_afq/result_run_afq.pklz
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/concurrent/futures/_base.py", line 342, in _invoke_callbacks
    callback(self)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 159, in _async_callback
    result = args.result()
  File "/opt/conda/envs/qsiprep/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/opt/conda/envs/qsiprep/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
FileNotFoundError: ${workdir}/qsiprep_${subjectID}/qsirecon_0_22_wf/sub-${subjectID}_pyafq_tractometry/sub_${subjectID}_ses_${sessionID}_dir_AP_space_T1w_desc_preproc_recon_wf/pyafq_tractometry/run_afq/result_run_afq.pklz
240725-12:18:46,243 nipype.workflow INFO:
         [MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 226.41/226.61, Free processors: 7/8.
                     Currently running:
                       * qsirecon_0_22_wf.sub-${subjectID}_pyafq_tractometry.sub_${subjectID}_ses_${sessionID}_dir_AP_space_T1w_desc_preproc_recon_wf.pyafq_tractometry.run_afq
INFO:nipype.workflow:[MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 226.41/226.61, Free processors: 7/8.

Reproducing the bug

See above.

mattcieslak commented 3 months ago

Hi Pierre - is it possible you have an older pyafq in your home directory's python installation? Using --containall instead of --cleanenv can prevent locally installed python packages from sneaking in to the container

mattcieslak commented 3 months ago

second thought - did you preprocess this data with --dwi only?