Preprocessing error

Hi!

I am trying to preprocess diffusion data using MRtrix3 following Andy’s tutorial. I am getting this error when I try to do topup eddy correction using command:
dwifslpreproc Par-8_den.mif Par-8_den_preproc.mif -nocleanup -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear --data_is_shelled"

Error:
mrconvert se_epi_pad2.mif topup_in.nii -import_pe_table se_epi_manual_pe_scheme.txt -strides -1,+2,+3,+4 -export_pe_topup topup_datain.txt

mrconvert: [ERROR] unknown option “-import_pe_table”

can anyone guide me in resolving it. thanks!

I get the same error. dwifslpreproc probably still uses the old tag ‘-import_pe_table’ for mrconvert, which is renamed to ‘-import_pe_topup’ in the latest mrtrix version. Will raise the issue on github.

Thank you! till then any workaround?

Hi @namrauf,

This can be easily fixed by running topup and Eddy through FSL - then pipe it back to MRtrix.

I hope this helps,

John

Can it be Andy’s tutorial is based on an old MRtrix version, and you are using a newer one, which expects ‘-import_pe_topup’ ?

ya, it’s based on an older MRtrix version. like HannesAlmgren said, it is probably due to the renaming of certain commands.

I switched to older version of python and the dwifslpreproc runs now. Afterwards when I try to generate a mask, the -ants option gives this error:
antsRegistration: error while loading shared libraries: libITKIOBruker-5.3.so.1: cannot open shared object file: No such file or directory

I tried to run it with fsl, and it works. But it’s not recommended to use fsl option. I found that it’s issue with Conda installation (missing shared libraries when installed from conda / mamba · Issue #1696 · ANTsX/ANTs · GitHub). Any info how can I run -ants option in dwibiascorrect in conda?

I also encountered this error this morning after updating MRtrix to v3.0.7

After some investigation, I did find a way to get dwifslpreproc to execute with some alterations to bin/dwifslpreproc.ccp. I’ll listed I changes I made here, in case someone finds them useful. The outputs look good, but I’m not very familiar with the MRtrix code base, so I won’t make any bold claims about their correctness in case I’ve missed something

The changes

  • Line 512 : import_dwi_pe_table_option = ’ -import_pe_topup dwi_manual_pe_scheme.txt’
  • Line 828 : run.command('mrconvert ’ + dwi_path + import_dwi_pe_table_option + STRIDES_OPTION_FSL_COMPAT_4D + ’ dwi.nii ’
  • Line 829 : ‘-export_pe_eddy applytopup_config.txt applytopup_indices.txt’)

Some notes - the change to line 512 addresses ‘mrconvert: [ERROR] unknown option “-import_pe_table”’. The MRtrix reference guide for mrconvert states that import_pe_topup ‘imports a phase-encoding table intended for FSL TOPUP from file’, and the reference for mrinfo states that ‘If extracting phase encoding information to interface with FSL tools, use the -export_pe_topup or -export_pe_eddy options.’, so this seems to be the intended replacement for import_pe_table

The changes to lines 828 and 829 fixes a subsequent error that arose with mrinfo (‘mrinfo: [ERROR] Only export phase encoding table to FSL eddy format in conjunction with MGH / NIfTI format images’). Converting dwi.mif to .nii and feeding it into mrinfo did not work, as the phase encoding data was not preserved. So I dropped the use of mrinfo entirely, and had mrconvert export the phase encoding directly when it did the .nii conversion

Hope this helps

Hi all, note that this issue is address in PR Fix phase encoding handling on 3.0.7 by Lestropie · Pull Request #3146 · MRtrix3/mrtrix3 · GitHub which will almost certainly make it to the next bug-fix version. If you want to use it before it is released, you can build it yourself, e.g. using:

git clone https://github.com/MRtrix3/mrtrix3.git -b fix_pehandling_307 mrtrix3_fixpe
cd mrtrix3_fixpe
python3 ./configure
python3 ./build 

I appreciate your help but the git clone is not working.

git clone https://github.com/MRtrix3/mrtrix3.git -b fix_pehandling_307 mrtrix3_fixpe

Cloning into ‘mrtrix3_fixpe’… fatal: Remote branch fix_pehandling_307 not found in upstream origin