Reconstruction and fiber tracking with DSI-Studio on a qsipreprocessed dataset

Hi all, a former colleague preprocessed DWI data using qsiprep. She used this code for the preprocessing:

singularity run --cleanenv -B ${bids_root_dir} /pandora/opt/container/qsiprep-0.14.3.sif \
	$bids_root_dir/rawdata $bids_root_dir/derivatives \
	participant \
	--participant-label ${sub} \
	--skip-bids-validation \
	--fs-license-file $bids_root_dir/derivatives/license.txt \
	--dwi-denoise-window 5 \
	--output-resolution 1 \
	--output-space T1w \
	--use-syn-sdc \
	--force-syn \
	--hmc-model eddy \
	--recon_spec  csdsi_3dshore \

And this is what the folder structure looks like after qsiprep was running (deleted some parts to make it less verbose). Besides, I also have the .html reports in case this helps for the question below):

/data
 |-sub-INDI132M2
 | |-ses-01
 | | |-anat
 | | | |-sub-INDI132M2_ses-01_from-orig_to-T1w_mode-image_xfm.txt
 | | |-dwi
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bval
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.nii.gz
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_desc-SliceQC_dwi.json
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bvec
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_dwiref.nii.gz
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-brain_mask.nii.gz
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_dwiqc.json
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_desc-ImageQC_dwi.csv
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-eddy_cnr.nii.gz
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.b
 | | | |-sub-INDI132M2_ses-01_acq-multishell_dir-pa_confounds.tsv
 |-sub-INDI292BG
 | |-ses-01
 | | |-anat
 | | | |-sub-INDI292BG_ses-01_from-orig_to-T1w_mode-image_xfm.txt
 | | |-dwi
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_desc-ImageQC_dwi.csv
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_desc-SliceQC_dwi.json
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_dwiref.nii.gz
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_dwiqc.json
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-eddy_cnr.nii.gz
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.b
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.nii.gz
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_confounds.tsv
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-brain_mask.nii.gz
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bval
 | | | |-sub-INDI292BG_ses-01_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bvec
 | |-ses-02
 | | |-anat
 | | | |-sub-INDI292BG_ses-02_from-orig_to-T1w_mode-image_xfm.txt
 | | |-dwi
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bvec
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_confounds.tsv
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.nii.gz
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.bval
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-preproc_dwi.b
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_dwiqc.json
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-eddy_cnr.nii.gz
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_dwiref.nii.gz
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_desc-SliceQC_dwi.json
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_desc-ImageQC_dwi.csv
 | | | |-sub-INDI292BG_ses-02_acq-multishell_dir-pa_space-T1w_desc-brain_mask.nii.gz

Now I would like to also run the reconstruction and fibertracking using the DSI-Studio docker image and my own reconstruction and fiber tracking bash-scripts. Before doing that however, I have to obtain .src files using each of the *_dwi.nii.gz, *_dwi.bval and *_dwi.bvec files. This can be done using dsi_studio --action=src. However, @mattcieslak pointed out on a GitHub thread that it’s

[…] possible to use DSI Studio directly on these outputs but be careful on how the bvecs are interpreted. The version of DSI Studio in qsiprep is a bit behind the current DSI Studio and interprets bvecs differently. The bvec file is in LPS+ world coordinates, not LAS+ voxel coordinates (the FSL convention

So my question would be:

How can I find out if I can run dsi_studio --action=src on the files? And if not, what would have to be done to get proper .src files to then continue with dsi_studio --action=rec and dsi_studio --action=trk?

Hi,

I’m not sure if this would work, but have you considered just doing the first step of QSIPrep’s dsi_studio workflow? That is, the input recon spec would just be (cut down from here):

{
“name”: “dsistudio_pipeline”,
“space”: “T1w”,
“atlases”: [“schaefer100”, “schaefer200”, “schaefer400”, “brainnetome246”, “aicha384”, “gordon333”, “aal116”],
“nodes”: [
{
“name”: “dsistudio_gqi”,
“software”: “DSI Studio”,
“action”: “reconstruction”,
“input”: “qsiprep”,
“output_suffix”: “gqi”,
“parameters”: {“method”: “gqi”}
}
[
}

Perhaps it would output the minimal .src files you need?

Best,
Steven

Yup, I have considered it but I get all sorts of BIDS-errors when trying to run a reconstruction workflow using qsiprep.

If QSIPrep was able to run the first time, it should be able to run the second time using similar code unless changes to the BIDS root directory were made. What kind of errors?