Hi everyone,
I am new to both qsiprep
and the BIDS format but I managed to make my dataset compatible with qsiprep
.
- I am using
qsiprep-0.16.1
. - Data were BIDS-validated with
bids-validator 1.9.9
.
However, I encountered problems on 66/69 subjects on my dataset. They all underwent a raw_rpe_concat
node crash (more info below, in point ).
I have a dataset of 69 subjects where each participant underwent
- a T1-weighted MPRAGE scan
- diffusion weighted images with opposite phase encoding directions (PED)
- A DW volume was obtained at b-value 0 in the PA PED,
shape = (148, 148, 90)
- 67 DW volumes were obtained at different b-values in the AP PED,
shape = (148, 148, 90, 67)
DW images are severely distorted and must be corrected for that using the PEPOLAR TOPUP technique.
I ran qsiprep
in two different configurations for my dataset.
Configuration
I used the following BIDS-valid dataset :
βββ anat
β βββ sub-VS006_T1w.json
β βββ sub-VS006_T1w.nii.gz
βββ dwi
β βββ sub-VS006_acq-cusp66b0_dir-pa_sbref.bval
β βββ sub-VS006_acq-cusp66b0_dir-pa_sbref.bvec
β βββ sub-VS006_acq-cusp66b0_dir-pa_sbref.json
β βββ sub-VS006_acq-cusp66b0_dir-pa_sbref.nii.gz (3D file, shape = (148,148,90))
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.bval
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.bvec
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.json
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.nii.gz (4D file, shape = (148,148,90,67))
I had individual HTML reports for all subjects
Pre-processed DWI looked good except forβ¦
distortion correction was not performed
Configuration
I used the following BIDS-valid dataset.
I adjusted the dataset by doing a tiny trick to try to toggle the PEPOLAR TOPUP distortion correction step.
My 3D PA single volume (shape = (148, 148, 90)
) was converted into a 4D volume (shape = (148, 148, 90, 2)
) by concatenating twice the same single PA volume.
βββ anat
β βββ sub-VS006_T1w.json
β βββ sub-VS006_T1w.nii.gz
βββ dwi
β βββ sub-VS006_acq-cusp66b0_dir-pa_dwi.bval
β βββ sub-VS006_acq-cusp66b0_dir-pa_dwi.bvec
β βββ sub-VS006_acq-cusp66b0_dir-pa_dwi.json
β βββ sub-VS006_acq-cusp66b0_dir-pa_dwi.nii.gz (4D file, shape = (148,148,90,2))
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.bval
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.bvec
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.json
β βββ sub-VS006_acq-cusp66b3000_dir-ap_dwi.nii.gz (4D, file, shape = (148,148,90,67))
This indeed toggled the distortion correction but ended in a different system output.
I did not have individual HTML reports (only one subject succeeded in creating the html report)
However, pre-processed DWI looked good
DWI were unambiguously corrected for distortions
I had 66 raw_rpe_concat
crashes (example crash file below)
For these 66 subjects two files were systematically missing compared to the outputs obtained for configuration sub-XXX_desc-ImageQC_dwi.csv
and sub-XXX_desc-SliceQC_dwi.json
Content of an example crash file :
Node: qsiprep_wf.single_subject_VS006_wf.dwi_preproc_wf.pre_hmc_wf.raw_rpe_concat
Working directory: /work/qsiprep_wf/single_subject_VS006_wf/dwi_preproc_wf/pre_hmc_wf/raw_rpe_concat
Node inputs:
compress = True
dtype = f4
header_source = <undefined>
in_files = <undefined>
is_dwi = True
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 527, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node raw_rpe_concat.
Traceback:
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 398, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.8/site-packages/qsiprep/interfaces/nilearn.py", line 134, in _run_interface
new_nii = concat_imgs(self.inputs.in_files, dtype=self.inputs.dtype)
File "/usr/local/miniconda/lib/python3.8/site-packages/nilearn/_utils/niimg_conversions.py", line 487, in concat_niimgs
for index, (size, niimg) in enumerate(zip(lengths, _iter_check_niimg(
File "/usr/local/miniconda/lib/python3.8/site-packages/nilearn/_utils/niimg_conversions.py", line 160, in _iter_check_niimg
raise ValueError(
ValueError: Field of view of image #1 is different from reference FOV.
Reference affine:
array([[-1.49992088e+00, 1.51489924e-06, 1.54058855e-02,
1.04946426e+02],
[-3.61095565e-03, 1.45818010e+00, -3.51706936e-01,
-8.49841766e+01],
[ 1.49767256e-02, 3.51725472e-01, 1.45810318e+00,
-8.69976807e+01],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
Image affine:
array([[-1.49992108e+00, -8.02594400e-08, 1.53924711e-02,
1.04946426e+02],
[-3.60936113e-03, 1.45818007e+00, -3.51706922e-01,
-8.49841766e+01],
[ 1.49633121e-02, 3.51725459e-01, 1.45810342e+00,
-8.69976807e+01],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
Reference shape:
(148, 148, 90)
Image shape:
(148, 148, 90, 67)
Here are my questions :
- Can the trick (3D to 4D volume) be the reason of the crash ?
- How should I organize my dataset to properly toggle the PEPOLAR TOPUP distortion correction with
qsiprep
? - Can I use the pre-processed DWI file ?
Thank you very much for your help.
Cheers
Quentin