Feed synb0 topup outputs to dwipreproc

Hi,

I run synb0-disco and got topup output files of topup_fieldcoef.nii.gz and topup_movpar.txt. Can I feed the files to Mrtrix3 dwipreproc process? If not, I run the

eddy --imain=dwi.nii.gz --mask=my_hifi_b0_brain_mask.nii.gz\
–-acqp=acqparams.txt --index=index.txt –-bvecs=bvecs --bvals=bvals \
–-topup=OUTOUTS/topup --out=eddy_corrected

Should I use output eddy_corrected.nii.gz as input to mrconvert to mif, denoise, and then dwipreproc?

Thank you!
Qi

Hi Qi,

As mentioned in another thread, this capability is implemented and publicly available and will be included in the 3.1.0 update, but is not present in the most recent release (3.0.2).

For some reason I can’t find the thread, but another user was trying to utilise:
dwifslpreproc ... -eddy_options " ... --topup=../field ..."
, which is kind of bypassing dwifslpreproc’s machinations and giving eddy a direct path to the topup output (assuming the topup output files are called “field_*” in the current working directory, and since eddy is run within the script scratch directory, the path to such needs to go up to the parent directory). But this is a hack and might require some experimentation and/or code modification.

Should I use output eddy_corrected.nii.gz as input to mrconvert to mif, denoise, and then dwipreproc?

  • dwidenoise is not applicable to any image data that have undergone an image interpolation process; this includes the various corrections applied by eddy.

  • Given that the principal purpose of dwifslpreproc is to execute eddy, it’s unclear why you would want to execute it on data where eddy has already been applied.

Cheers
Rob

Hi Robert,

I run the following command:

dwipreproc denoise.mif denoise_preproc.mif -pe_dir PA -rpe_none -eddy_options "--topup=my_topup_results_fieldcoef.nii.gz ". 

However, got error message below in terminal:"

dwipreproc: Script failed while executing the command: eddy_openmp --imain=eddy_                        in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bv                        ecs=bvecs --bvals=bvals --out=dwi_post_eddy --topup=my_topup_results_fieldcoef.n                        ii.gz
dwipreproc: For debugging, inspect contents of temporary directory: ~/..Subj01/dwipreproc-tmp-K89PH5/"

error.txt in the temporary directory:"

eddy_openmp --imain=eddy_in.nii --mask=eddy_mask.nii --acqp=eddy_config.txt --index=eddy_indices.txt --bvecs=bvecs --bvals=bvals --out=dwi_post_eddy --topup=my_topup_results_fieldcoef.nii.gz
EddyInputError:  Error when attempting to read --topup file
Terminating program

Any thoughts or suggestions on it? thank you !

Best,
Qi

Hi Qi,

The trick with this “hack” is that the path to the topup output that is provided to eddy needs to be an appropriate path given that eddy is being executed *from within the scratch directory. Once the script has navigated into the scratch directory, file "my_topup_results_fieldcoef.nii.gz" no longer exists in the current working directory. Therefore, you either need to specify the appropriate relative file given where the scratch directory will be located, or provide an *absolute* filesystem path. You also likely need to specify the *prefix* to the topupoutputs, aseddy` needs to locate not only the NIfTI image containing the spline coefficients, but also the text file containing the transformations between the image volumes it used to estimate that field.

Rob

Hi Rob,

I changed the line to the following by adding the absolute path to the file and add ‘*’ to the ‘my_topup_results’ to include both nii.gz and txt result.

dwipreproc denoise.mif denoise_preproc.mif -pe_dir PA -rpe_none -eddy_options "--topup=absolute_path/my_topup_results_* ".

However, now it cannot retrieve both nii.gz and txt and think the file is named “my_top_results_*”. So is there any way that I can add two files after the “–topup=”

BTW, I also tried -eddy_options "–topup=absolute_path/my_topup_results_fieldcoef.nii.gz --topup=my_topup_results_movpar.txt "

Best,
Qi

and add ‘*’ to the ‘my_topup_results’ to include both nii.gz and txt result.

I’m pretty sure that won’t work. What eddy expects as the input to that command-line option is the same as what was used for the --out option for topup; this is the common prefix of these two files, from which eddy will infer the two file paths by appending the filename suffixes. So you would most likely want something like:

-eddy_options "--topup=/absolute_path/my_topup_results".

Also note that if using an absolute path, it must start with the filesystem root directory; otherwise it’s not an absolute path.