aramis-lab/clinica

Issue with FSL PhaseEncodingDirection in DWI-Preprocessing Pipeline

Closed this issue · 7 comments

Describe the bug
Encountered a RuntimeError during the execution of the dwi-preprocessing pipeline.

RuntimeError: FSL PhaseEncodingDirection (found value: y+) is unknown, it should be a value in (x, y, z, x-, y-, z-)

To Reproduce
Steps to reproduce the behavior:

  1. Download and convert to BIDS a sufficiently large number of dti images (minimum of 2 images are mentioned in Additional Context) from ADNI.
  2. Run the dwi-preprocessing pipeline using the command: clinica run dwi-preprocessing-using-t1 -wd temp --use_cuda BIDS CAPS -tsv subset/subset_file_1.tsv -dc

Expected behavior
The pipeline should execute without errors, handling both "y" and "y+" PhaseEncodingDirections as equivalent.

Screenshots
N/A

Desktop:

  • OS: Ubuntu 20.04.6 LTS
  • Python Version: 3.8.18
  • Clinica Version: 0.7.6

Additional context
Examined the pipeline's stdout, which shows instances of both "y" and "y+" PhaseEncodingDirections for different BIDS images. E.g.

2023-12-09 19:22:13,976:INFO:Running pipeline for sub-ADNI021S2100 | ses-M003 (TotalReadoutTime = 0.035028, PhaseEncodingDirection = y)
2023-12-09 19:22:13,979:INFO:Running pipeline for sub-ADNI006S6651 | ses-M000 (TotalReadoutTime = 0.0439567, PhaseEncodingDirection = y+)

Seeking guidance on how to modify the pipeline logic to treat these variations as equivalent or any alternative solutions.

Hi @souravraha,

Indeed that is a problem. I've just opened a PR #1035 which enables you to have a y+ value in the json.

However this is not taken into account by the BIDS specification, values for the PhaseEncodingDirection are supposed to be (x/y/z/x-/y-/z-). Which leads me to the following question: did you convert your data with our converter ?

Hi @souravraha

This should have been fixed. If you install Clinica from the dev branch you should be able to run the pipeline with the phase encoding directions that you have in your data.
Feel free to re-open the issue if you're still having the problem.

Hi @souravraha,

Indeed that is a problem. I've just opened a PR #1035 which enables you to have a y+ value in the json.

However this is not taken into account by the BIDS specification, values for the PhaseEncodingDirection are supposed to be (x/y/z/x-/y-/z-). Which leads me to the following question: did you convert your data with our converter ?

Hi @MatthieuJoulot. Yes I used clinica's in-house converter (adni-to-bids).

Hi @souravraha

This should have been fixed. If you install Clinica from the dev branch you should be able to run the pipeline with the phase encoding directions that you have in your data. Feel free to re-open the issue if you're still having the problem.

Hi @NicolasGensollen. Thanks, I shall check it out. Have you modified both the bids converter and the pre-processer algorithms? I mean should repeat both steps, or just the latter?

Hi @souravraha,

Yes I used clinica's in-house converter (adni-to-bids).

Alright, we'll need to open an issue for this then, since it means the converter doesn't tackle the PhaseEncodingDirection.

Thanks, I shall check it out. Have you modified both the bids converter and the pre-processer algorithms? I mean should repeat both steps, or just the latter?

The bids converter has not been modified. Only the pre-processing algorithm. You should just repeat the latter step only.

Hi @souravraha,

Yes I used clinica's in-house converter (adni-to-bids).

Alright, we'll need to open an issue for this then, since it means the converter doesn't tackle the PhaseEncodingDirection.

Thanks, I shall check it out. Have you modified both the bids converter and the pre-processer algorithms? I mean should repeat both steps, or just the latter?

The bids converter has not been modified. Only the pre-processing algorithm. You should just repeat the latter step only.

@MatthieuJoulot

Thanks. Sorry to say, the error didn't go away. I installed Clinica from the dev branch, and ran the same command. The error didn't go away for me. Did you check if it went away after the change? I deleted the temp folder, and re-ran the pipeline. No improvement still.

Hi @souravraha,

That is unfortunate. Is the error still the same ? I have checked, and the error does go away, the PhaseEncodingDirection is corrected to y as shown below.
Capture d’écran 2023-12-20 à 15 50 21

My bad, indeed this works. Thank you!