QSIPrep eddy failure: “Mismatched DiffStatsVector object” with multi-shell DWI (separate_all_dwis=True)

Summary of what happened:

Hi!

QSIPrep fails during the eddy step with the error:

EDDY::ReplacementManager::Update: Mismatched DiffStatsVector object
EDDY::DoVolumeToVolumeRegistration: Exception thrown

The pipeline completes early preprocessing steps but crashes during eddy. No eddy_corrected.nii.gz is produced.

This occurs consistently for a multi-shell DWI acquisition (acq-multib), and previously also for an additional DWI run (now removed from the dataset).

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

apptainer run --cleanenv "${image_path}" \
    "${bids_path}" \
    "${out_path}" \
    participant \
    --participant-label "${participant_id}" \
    --fs-license-file "${license_path}" \
    -w "${work_dir_abs_path}" \
    --output-resolution 1.8 \
    --verbose \
    --write-graph \
    --ignore fieldmaps \
    --separate-all-dwis \
    --b0-threshold 100 \
    --omp-nthreads 4 \
    --nprocs 4 \
    --denoise-after-combining \
    --b0-to-t1w-transform Affine \
    --intramodal-template-transform SyN \
    --skip-bids-validation \
    --unringing-method mrdegibbs \
    --dwi-denoise-window auto

Version:

1.1.1

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

Apptainer on SLURM HPC cluster

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

Yes, BIDS-compliant dataset (OASIS3-derived).

Validator output:

(no critical errors; can provide full output if needed)

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:

EDDY::ReplacementManager::Update: Mismatched DiffStatsVector object
EDDY::DoVolumeToVolumeRegistration: Exception thrown
Eddy failed with message: …
No eddy_corrected.nii.gz produced
Node: dwi_preproc_acq_multib_wf.hmc_sdc_wf.eddy


  1. acq-b1000

    • shape: 96×96×64×65

    • voxel size: 2.5 mm

    • single-shell (b=1000)

    • 1 b0

  2. acq-multib

    • shape: 112×112×80×26

    • voxel size: 2.0 mm

    • multi-shell (b = 0, 50–1400)

    • 1 b0

Key observations:

  • bval/bvec files match the number of volumes and appear valid

  • failure occurs only at eddy stage

  • occurs consistently for acq-multib

  • dataset originally contained additional backup DWI runs, now removed

  • separate_all_dwis=True was required due to different spatial resolutions

Questions:

  1. Is the error “Mismatched DiffStatsVector object” typically associated with specific data issues (e.g., insufficient b0, unstable multi-shell data, motion)?

  2. Could this be related to the short multi-shell acquisition (26 volumes)?

  3. Is there a recommended way to make eddy more robust in QSIPrep (e.g., disabling repol or modifying settings)?

  4. Would excluding this DWI acquisition be the correct approach, or is there a way to salvage it?

Hi @Toan and welcome to neurostars!

May you provide the full error traceback from the terminal / slurm log outputs? Also provide the bval files? It is possible your b-values are not similar enough to one another to form discrete shells. In that case, you can provide an updated eddy config and remove the --data_is_shelled parameter.

Best,

Steven

Thank you for your response!

Please find the details below:

Error traceback:

260326-18:14:11,260 nipype.workflow ERROR:
    could not run node: qsiprep_1_1_wf.sub_01wave2_wf.dwi_preproc_acq_multib_wf.hmc_sdc_wf.eddy
260326-18:14:11,265 nipype.workflow INFO:
260326-18:14:11,265 nipype.workflow ERROR:
    could not run node: qsiprep_1_1_wf.sub_01wave2_wf.dwi_preproc_run_02_wf.hmc_sdc_wf.eddy
260326-18:14:11,269 nipype.workflow INFO:
260326-18:14:11,337 nipype.workflow CRITICAL:
    QSIPrep failed: 2 raised. Re-raising first.

sub-xwave2_acq-b1000_dwi.bval:

0 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000

sub-xwave2_acq-multib_dwi.bval:

0 50 350 600 900 1150 100 400 700 950 1250 150 450 700 1000 1300 200 500 800 1050 1350 300 550 850 1100 1400

Sincerely,

Mikhail

Hi @Toan,

That doesn’t look like the full traceback. Is there any more you can provide, or is it really just

EDDY::ReplacementManager::Update: Mismatched DiffStatsVector object
EDDY::DoVolumeToVolumeRegistration: Exception thrown
Eddy failed with message: …

The multib acquisition doesn’t look like a regular shelled scheme, potentially leading to that failure. You might also consider instead using SHORELine instead of Eddy as the --hmc-model.

Best,

Steven

Thank you! I hope these are the right details.

crash 1:

EDDY::ReplacementManager::Update: Mismatched DiffStatsVector object
	EDDY::EddyHelperClasses.cpp:::  void EDDY::ReplacementManager::Update(const EDDY::DiffStatsVector&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::DiffStatsVector EDDY::detect_outliers(const EddyCommandLineOptions&, ScanType, std::shared_ptr<const DWIPredictionMaker>, const NEWIMAGE::volume<float>&, const ECScanManager&, unsigned int, unsigned int, ReplacementManager&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::DiffStatsVector EDDY::DetectOutliers(const EddyCommandLineOptions&, ScanType, std::shared_ptr<const DWIPredictionMaker>, const NEWIMAGE::volume<float>&, const ECScanManager&, ReplacementManager&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::ReplacementManager* EDDY::Register(const EddyCommandLineOptions&, ScanType, unsigned int, const std::vector<float, std::allocator<float> >&, SecondLevelECModelType, bool, ECScanManager&, ReplacementManager*, NEWMAT::Matrix&, NEWMAT::Matrix&):  Exception thrown
	EDDY::: Eddy failed with message EDDY::eddy.cpp:::  EDDY::ReplacementManager* EDDY::DoVolumeToVolumeRegistration(const EddyCommandLineOptions&, ECScanManager&):  Exception thrown
Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 457, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 325, in validate
	    value = super().validate(objekt, name, value, return_pathlike=True)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
	    self.error(objekt, name, str(value))
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'out_corrected' trait of an ExtendedEddyOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/projects/sciences/psychology/narunpat-lab/Mikhail/work/qsiprep_xwave2/qsiprep_1_1_wf/sub_xwave2_wf/dwi_preproc_run_02_wf/hmc_sdc_wf/eddy/eddy_corrected.nii.gz' <class 'str'> was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 404, in run
	    outputs = self.aggregate_outputs(runtime)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 464, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory '/projects/sciences/psychology/narunpat-lab/Mikhail/work/qsiprep_xwave2/qsiprep_1_1_wf/sub_01wave2_wf/dwi_preproc_run_02_wf/hmc_sdc_wf/eddy/eddy_corrected.nii.gz' for output 'out_corrected' of a ExtendedEddy interface

crash 2:


	EDDY::ReplacementManager::Update: Mismatched DiffStatsVector object
	EDDY::EddyHelperClasses.cpp:::  void EDDY::ReplacementManager::Update(const EDDY::DiffStatsVector&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::DiffStatsVector EDDY::detect_outliers(const EddyCommandLineOptions&, ScanType, std::shared_ptr<const DWIPredictionMaker>, const NEWIMAGE::volume<float>&, const ECScanManager&, unsigned int, unsigned int, ReplacementManager&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::DiffStatsVector EDDY::DetectOutliers(const EddyCommandLineOptions&, ScanType, std::shared_ptr<const DWIPredictionMaker>, const NEWIMAGE::volume<float>&, const ECScanManager&, ReplacementManager&):  Exception thrown
	EDDY::eddy.cpp:::  EDDY::ReplacementManager* EDDY::Register(const EddyCommandLineOptions&, ScanType, unsigned int, const std::vector<float, std::allocator<float> >&, SecondLevelECModelType, bool, ECScanManager&, ReplacementManager*, NEWMAT::Matrix&, NEWMAT::Matrix&):  Exception thrown
	EDDY::: Eddy failed with message EDDY::eddy.cpp:::  EDDY::ReplacementManager* EDDY::DoVolumeToVolumeRegistration(const EddyCommandLineOptions&, ECScanManager&):  Exception thrown
Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 457, in aggregate_outputs
	    setattr(outputs, key, val)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 325, in validate
	    value = super().validate(objekt, name, value, return_pathlike=True)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/traits_extension.py", line 135, in validate
	    self.error(objekt, name, str(value))
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/traits/base_trait_handler.py", line 74, in error
	    raise TraitError(
	traits.trait_errors.TraitError: The 'out_corrected' trait of an ExtendedEddyOutputSpec instance must be a pathlike object or string representing an existing file, but a value of '/projects/sciences/psychology/narunpat-lab/Mikhail/work/qsiprep_xwave2/qsiprep_1_1_wf/xwave2_wf/dwi_preproc_acq_multib_wf/hmc_sdc_wf/eddy/eddy_corrected.nii.gz' <class 'str'> was specified.

	During handling of the above exception, another exception occurred:

	Traceback (most recent call last):
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 404, in run
	    outputs = self.aggregate_outputs(runtime)
	  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 464, in aggregate_outputs
	    raise FileNotFoundError(msg)
	FileNotFoundError: No such file or directory 'qsiprep_xwave2/qsiprep_1_1_wf/sub_xwave2_wf/dwi_preproc_acq_multib_wf/hmc_sdc_wf/eddy/eddy_corrected.nii.gz' for output 'out_corrected' of a ExtendedEddy interface

Sincerely,

Mikhail

Hi @Toan,

Yes that helps; I would try the suggestions in my previous comment.

Best,

Steven

I will.

Thank you so much @Steven

Sincerely,

Mikhail

Dear @Steven,

It worked, thank you!

Sincerely,

Mikhail

1 Like