MASILab / Synb0-DISCO

Distortion correction of diffusion weighted MRI without reverse phase-encoding scans or field-maps
https://my.vanderbilt.edu/masi
57 stars 28 forks source link

Failed to read volume /OUTPUTS/b0_all.nii.gz Error : No image files match: /OUTPUTS/b0_all #68

Closed tasciseda closed 1 month ago

tasciseda commented 1 month ago

Hello, I ran the synb0-DISCO docker container with the following command, sudo docker run --rm -v $(pwd)/INPUTS/:/INPUTS/ -v $(pwd)/OUTPUTS:/OUTPUTS/ -v $(pwd)/license.txt:/extra/freesurfer/license.txt --user $(id -u):$(id -g) leonyichencai/synb0-disco:v3.1 I got the following error; "Failed to read volume /OUTPUTS/b0_all.nii.gz Error : No image files match: /OUTPUTS/b0_all FINISHED!!!"

I attached my OUTPUTS file. As far as I understand topup and eddy steps didn't go through. Can you please help me with this issue. Thank you very much. Seda

Screenshot 2024-07-13 at 11 12 29 PM
schillkg commented 1 month ago

Can you post the full log output on the terminal?

tasciseda commented 1 month ago

Sure! my_log_output.pdf Thank you for your help.

schillkg commented 1 month ago

This is a memory issue. How much RAM are you allowing your container to access? We recommend >12Gb and it will work successfully.

Thank you, Kurt

tasciseda commented 1 month ago

I increased the RAM to 20gb and ran again. I got the other outputs except topup outputs and now I am getting this error "Topup: msg=topup_clp::topup_clp: Subsampling levels incompatible with image data." I should have 64 slices in my image. What might be the problem ? Thank you Seda

schillkg commented 1 month ago

What is the size of the data? TOPUP from FSL will give that error if your topup configuration file is written requiring subsampling by a factor of 2 or 4. Ours does indeed assume a matrix size where all values are even, but you can use other configuration files (b02b0_2.cnf I believe is provided by FSL). Let me know if you need help implementing that.

tasciseda commented 1 month ago

I attached the size of the data. I am a bit confused and your help is highly appreciated to implement this. Thank you!

Screenshot 2024-07-15 at 10 49 31 PM
schillkg commented 1 month ago

The 3rd dimension is an odd number. Our default configuration file will fail with odd numbers. There are a few options. You can replace this was an FSL provided file (they provide one called b02b0_2.cnf that does not subsample the data and does not require even numbers). Or you can zero-pad your dwi volume so that it is a multiple of two (adding one slice so that there are 74 slices). You can also just run the synthesis and run topup outside of the container/synb0 pipeline. I think zero-padding the image will likely be the easiest solution.

tasciseda commented 1 month ago

I see. I was checking to add zero to make it 74 slices however I couldn't find any documentation. Is there an fsl command to make it or should I use another software? Thank you, Seda

schillkg commented 4 weeks ago

yes - there are a few options - I typically use MRTrix functions. I believe "mrpad" can zero-pad images. Also FSL should have tools, something like "fslroi" should work. I have not done this, and it may actually be easier to remove the first or last slice than to actually 0-pad! Here is some info from FSL developers on the challenges with odd slices: https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=FSL;6c4c9591.2002

tasciseda commented 4 weeks ago

I have been trying couple methods, I extract one slice and padded with zeros, however when I try to add that new padded slice to the original image it said "header transformations of input images do not match" and then like you suggested I removed the last slice and topup worked in container. I have run eddy outside the container, I used the acqparams.txt that I used for the container which was ; 0 -1 0 0.0438149 0 -1 0 0.000000 my question is should I change acqparams.txt to; 0 -1 0 0.0438149 0 1 0 0.0438149 after the topup for other steps including eddy? Thank you. Seda

schillkg commented 4 weeks ago

acqparams should stay constant for the entire process. You will also want to be sure that the input to eddy is the same size as the input to topup.

schillkg commented 4 weeks ago

Do the results look reasonable after the synb0 process after zero-padding the image?

tasciseda commented 4 weeks ago

I wasn't able to do zero-padding, however I removed the last slice and the results looked reasonable for one subject. I will test with couple more subjects and see. Thank you! Seda