QSIrecon problem with HCP preprocessed DWI data

Summary of what happened:

Hi, experts. I want to run reconstruction on the minimally preprocessed HCP-YA DWI data and I’m a bit confused about how to feed the HCP-YA preprocessed DWI data into the QSIrecon pipeline. The preprocessed DWI data for each subject:

.
├── Diffusion
│   ├── bvals
│   ├── bvecs
│   ├── data.nii.gz
│   ├── eddylogs
│   │   ├── eddy_unwarped_images.eddy_movement_rms
│   │   ├── eddy_unwarped_images.eddy_outlier_map
│   │   ├── eddy_unwarped_images.eddy_outlier_n_sqr_stdev_map
│   │   ├── eddy_unwarped_images.eddy_outlier_n_stdev_map
│   │   ├── eddy_unwarped_images.eddy_outlier_report
│   │   ├── eddy_unwarped_images.eddy_parameters
│   │   ├── eddy_unwarped_images.eddy_post_eddy_shell_alignment_parameters
│   │   └── eddy_unwarped_images.eddy_restricted_movement_rms
│   ├── grad_dev.nii.gz
│   └── nodif_brain_mask.nii.gz
└── T1w_acpc_dc_restore_1.25.nii.gz

I have organized the DWI files (data, bvec, and bval) and T1w into the BIDS format:

.
├── dataset_description.json
└── sub-001
    ├── anat
    │   └── sub-001_T1w.nii.gz
    └── dwi
        ├── sub-001_dwi.bval
        ├── sub-001_dwi.bvec
        └── sub-001_dwi.nii.gz

I encountered an error with the BIDS format. Should I use the BVAL and BVEC files from the unprocessed DWI folder?

Command used (and if a helper script was used, a link to the helper script or the command generated):

export HOME=/home/data/user7/HCPYA_Diffusion_Preprocessed/test
docker run -ti --rm \
    --gpus all  -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all \
    -v $HOME/hcpya_dwi:/data \
    -v $HOME/output:/output \
    -v $HOME/freesurfer:/freesurfer_output \
    -v $HOME/working_dir:/working_dir \
    pennbbl/qsiprep:0.20.0 \
    /data /output participant \
    --output-resolution 1.5 \
    --recon_input /data
    --recon-input-pipeline hcpya \
    --freesurfer-input /freesurfer_output \
    --recon-spec mrtrix_multishell_msmt_ACT-hsvs \
    --recon-only \
     --fs-license-file /usr/local/freesurfer/license.txt \
     -w /working_dir -v -v

Version:

pennbbl/qsiprep:0.20.0

Environment (Docker, Singularity / Apptainer, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

1: [ERR] Each row in a .bvec file should contain the same number of values. (code: 46 - BVEC_ROW_LENGTH)
2: [ERR] .bval and .bvec files must be single space delimited and contain only numerical values. (code: 47 - B_FILE)

Screenshots / relevant information:

sub-001_dwi.bval.txt (1.3 KB)
sub-001_dwi.bvec.txt (9.3 KB)


Hi @ZitengHan,

I think QSIRecon expects HCP-YA data to be in its original structure (that is, not BIDS). What happens if you feed in the original data structure?

Best,
Steven

Hi @Steven, I’m sorry about the missing newline characater in the command I used above. After feeding preprocessed HCP-YA DWI data in its original structure into the qsirecon pipeline, it seems that qsirecon does not yet support running reconstruction based on preprocessed HCP-YA DWI data.

docker run -ti --rm \
>     --gpus '"device=0"'  -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all \
>     -v $HOME/hcpya_dwi:/data \
>     -v $HOME/output:/output \
>     -v $HOME/freesurfer:/freesurfer_output \
>     -v $HOME/working_dir:/working_dir \
>     -v /usr/local/freesurfer:/FREESURFER_HOME \
>     pennbbl/qsiprep:0.20.0 \
>     /data /output participant \
>     --output-resolution 1.5 \
>     --recon_input /data \
>     --recon-input-pipeline hcpya \
>     --freesurfer-input /freesurfer_output \
>     --recon-spec mrtrix_multishell_msmt_ACT-hsvs \
>     --recon-only \
>      --fs-license-file /FREESURFER_HOME/license.txt \
>      -w /working_dir -v -v
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/local/miniconda/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.10/site-packages/qsiprep/cli/run.py", line 1110, in build_recon_workflow
    raise NotImplementedError(f"{opts.recon_input_pipeline} is not supported as recon-input yet.")
NotImplementedError: hcpya is not supported as recon-input yet.

Hi @ZitengHan, HCP-YA is not supported for recon yet, but we do support UK Biobank. HCPYA isn’t too different from UKB, so hopefully it will be supported soon.

1 Like

@mattcieslak : if the data are reorganized into a BIDS-compliant structure, would qsirecon work out of the box? There are a couple of ways to do that, including this DIPY function.

If the minimally processed HCP data are renamed to match qsiprep outputs (along with the LPS+ orientation in the images and bvecs) then it may also work. Any of the workflows involving anatomical data (eg connectomes) likely will have problems though

Hi @mattcieslak,

I would like to try this if it is available. My problem is that a single complete subject is almost 20 GB, so I’m hoping to provide just the dwi (and anat?) data that qsirecon needs.

I looked at the following discussion, but it does not clarify what’s expected in terms of directory structure:

For example, could I do this, providing just the dwi data:

100206
└── Diffusion
    ├── bvals
    ├── bvecs
    ├── data.nii.gz
    ├── eddylogs
    │   ├── eddy_unwarped_images.eddy_movement_rms
    │   ├── eddy_unwarped_images.eddy_outlier_map
    │   ├── eddy_unwarped_images.eddy_outlier_n_sqr_stdev_map
    │   ├── eddy_unwarped_images.eddy_outlier_n_stdev_map
    │   ├── eddy_unwarped_images.eddy_outlier_report
    │   ├── eddy_unwarped_images.eddy_parameters
    │   ├── eddy_unwarped_images.eddy_post_eddy_shell_alignment_parameters
    │   └── eddy_unwarped_images.eddy_restricted_movement_rms
    ├── grad_dev.nii.gz
    └── nodif_brain_mask.nii.gz

Or do I need to retain more of the original directory structure?

100206
–T1w
(Some assortment of T1w files)
|—Diffusion
----

Thanks in advance for your insight and guidance,

Dianne

I also see: despite the existence of the command line flag, HCPYA is not supported. I jumped the gun. Sorry.