QSIprep stuck at "plot_connectivity", and connectivity matrix gives zero arrays

When I ran the following QSIprep code, time qsiprep-docker /scratch/connectome/dyhan316/dwMRI/UKB_sample/sub_02_INPUT_4/ /scratch/connectome/dyhan316/dwMRI/time_it/outputs/time_gqi/2_2_gqi/ participant --output_resolution 1.2 --recon_only --recon_input /scratch/connectome/dyhan316/dwMRI/UKB_sample/sub_02_INPUT_4/ --recon_spec dsi_studio_gqi --fs-license-file /scratch/connectome/dyhan316/dwMRI/license.txt --skip_bids_validation --nthreads 2 --omp_nthreads 1 --stop_on_first_crash

to only do reconstruction using data that was already preprocessed, I got stuck at “plot_connectivity”, as the log file that I have uploaded shows:

With the following recon folder tree structure
image

This was also true for when I tried another reconstruction method, multi_msmt_ACT . Could anyone tell me what might’ve gone wrong? When I opened up the .mat file (which was the last file that was made) I saw that all of the contents inside that .mat file were either zero arrays or NaN (which would indicate an incomplete tractography). However, when I looked at the other files (fib files and nii.gz files) using mrview and dsi_studio, they were normal.

Could anyone tell me what I might’ve done and how to fix it?

Thank you:)

*edit : I have added the log.txt files!
log.txt (325.0 KB)

In the log text, I see the following error first:

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 521, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 639, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 715, in _run_command
    result = self._interface.run(cwd=outdir, ignore_exception=True)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 388, in run
    self._check_mandatory_inputs()
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 275, in _check_mandatory_inputs
    raise ValueError(msg)
ValueError: ApplyTransforms requires a value for input 'transforms'. For a list of required inputs, see ApplyTransforms.help()

During handling of the above exception, another exception occurred:

Are there anatomical derivatives from QSIPrep available to QSIRecon? How were the images preprocessed?

It looks like you passed in the BIDS directory as the recon_input too. The recon input should point to the QSIPrep-preprocessed derivatives.

It would also help if you specify a working directory with the QSIPrep -w flag.

Also, you were not stuck at “plot_connectivity”, as that is the last step of QSIRecon, and in fact the log you attached indicated that it finished. I think the error that I described above was propagated through the remainder of the code.

Best,
Steven

1 Like

Hi Steven!

Thank you for the answer! (I really am!)

To answer your questions:

Q1: Are there anatomical derivatives from QSIPrep available to QSIRecon? How were the images preprocessed?

The data I was using was already pre-processed via a different software, which was why there was no QSIprep anatomical derivatives (and why recon_only was used). The file structure that I used as input was the following (I intentionally changed the file names to mimic the names that would’ve been given had QSIPrep been used for preprocessing):
image
(how the preprocessing was done can be seen via : Image processing and Quality Control for the first 10,000 brain imaging datasets from UK Biobank - ScienceDirect)

Q2 : It looks like you passed in the BIDS directory as the recon_input too. The recon input should point to the QSIPrep-preprocessed derivatives.

I see! My initial intention was that since the dwi and anatomical images were already preprocessed, I wanted them to act as the recon_input. Is it required for the recon_input to be QSIPrep-preprocessed derivatives or is it OK to just use files that were preprocessed via a different software?

Q3 : It would also help if you specify a working directory with the QSIPrep -w flag.

Does this mean that I should set the -w flag as the directory my recon_only is set to?

Thank you:)

Danny

As of right now, QSIRecon can only handle outputs from QSIPrep, although I know there is active interest and development for ingressing other pipelines.

No, -w should point to some scratch or temporary directory, but that will not solve the problems stated above.

Sorry that this probably was not the answer you were hoping for.

Best,
Steven

1 Like

Thank you for the answer :slight_smile:

One last question if you don’t mind ! : If I intend on using QSIPrep for only getting tck files, will the results obtained by modifying the reconstruction JSON file to finish once tcksift2 is done be OK to be used?

Sorry I am not sure I understand the question. What is your reason for modifying the recon JSON file?