dki-questions > Assistance needed with DKI pre-processing using MRtrix/FSL
Showing 1-4 of 4 posts
Display:
Results per page:
Mar 28, 2024  05:03 AM | Abhishek Patil - Vellore Institute of Technology
Assistance needed with DKI pre-processing using MRtrix/FSL

Hello all, 

I am new to the DKI preprocessing using MRtrix/fsl and I am encountering a challenge with my dataset.

Specifically, my collected data consists only of three files: *.nii, *.bvec, and *.bval. 
PS: I do not have PA or AP phase-encoded image files included.

In my preprocessing workflow, I have employed the following commands:

 

mrconvert -fslgrad HC001_preop.bvec HC001_preop.bval HC001_preop.nii HC001_dwi.mif
dwidenoise HC001_dwi.mif HC001_den.mif -noise noise.mif
dwiextract HC001_den.mif - -bzero | mrmath - mean mean_bzero.mif -axis 3
mrcalc HC001_dwi.mif HC001_den.mif -subtract residual.mif
mrdegibbs HC001_den.mif HC001_den_unr.mif

 

However, I am encountering difficulty with the "dwifslpreproc" command.
I would greatly appreciate your guidance on how to proceed with the preprocessing in the absence of the phase-encoded files? Could someone please assist me in navigating this issue?

Mar 28, 2024  11:03 AM | Hunter Moss
RE: Assistance needed with DKI pre-processing using MRtrix/FSL

Hi there,


We have a program called PyDesigner (https://pydesigner.readthedocs.io/en/lat...) that performs all the same pre-processing and also provides tensor calculations for diffusion and kurtosis along with their associated rotationally invariants (MD, FA, MK, etc). It is written entirely in Python and easily installed in a 'conda' environment. It could be a good solution as it automatically checks and runs the correct commands for the given data. It also can take in the DICOM folder as input. There is a tutorial video at the URL I posted above. There is also a GitHub forum for issues if you run into trouble (https://github.com/muscbridge/PyDesigner). The outputs are also compatible with MRTrix (orientation-wise) and FSL commands. 


Hope this helps, let us know. 


Best regards,


-Hunter Moss


 

Apr 10, 2024  07:04 AM | Abhishek Patil - Vellore Institute of Technology
RE: Assistance needed with DKI pre-processing using MRtrix/FSL

Thank you for your reply. I think the video tutorial is very helpful.

I tried running the tool on my data. The dataset does not have encoding direction. I have 4 files:
1. Image file .nii, 2. .bval file, 3. bvec file and 4. *.json file.

I installed Pydesigner but I ran in the following error:

pydesigner --standard -o /mnt/hgfs/try/DKI/HC1/ /mnt/hgfs/try/DKI/HC1/T20160603170653_NTang^jia-yu_S19.nii



mrconvert -quiet /mnt/hgfs/try/DKI/HC1/dwi0.mif /mnt/hgfs/try/DKI/HC1/working.mif
[WARNING] Given DWI is partial fourier, overriding --degibbs; no unringing correction will be done to avoid artifacts.Use the "--adv" flag to run forced corrections.
Traceback (most recent call last):
  File "/home/abhishek/mrtrix3/bin/dwifslpreproc", line 1327, in
    import mrtrix3
  File "/home/abhishek/mrtrix3/bin/mrtrix3.py", line 84, in
    if not imported (os.path.join (os.path.dirname (build_path), 'lib')):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abhishek/mrtrix3/bin/mrtrix3.py", line 33, in imported
    spec.loader.exec_module (module)
  File "", line 936, in exec_module
  File "", line 1073, in get_code
  File "", line 1130, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/hgfs/try/DKI/HC1/lib/mrtrix3/__init__.py'
Traceback (most recent call last):
  File "/home/abhishek/anaconda3/envs/mri/bin/pydesigner", line 8, in
    sys.exit(main())
             ^^^^^^
  File "/home/abhishek/anaconda3/envs/mri/lib/python3.11/site-packages/designer/pydesigner.py", line 646, in main
    mrpreproc.undistort(input=working_path,
  File "/home/abhishek/anaconda3/envs/mri/lib/python3.11/site-packages/designer/preprocessing/mrpreproc.py", line 469, in undistort
    raise Exception('dwifslpreproc failed, please look above for '
Exception: dwifslpreproc failed, please look above for error sources.

Does anyone know what this error represents ? 
Thank you in advance.

Regards,


Abhishek

Sep 26, 2024  05:09 PM | Hunter Moss
RE: Assistance needed with DKI pre-processing using MRtrix/FSL

I am so sorry; I did not see this reply. Did you ever get PyDesigner working?


You have to make sure you have a conda environment set up and active before installing PyD. 



  1. If you have that already, I would try to navigate into the directory where the raw data is and run it that way to see if it works.
  2. Next, if that doesn't work, I'd try just giving pydesigner the dicom folder as the input since it can work with that, too. 

Also, FYI: if the data is partial Fourier, the Gibbs unringing will not run as it is currently only for full Fourier encoding. 


Again, I apologize for not responding quickly. If you could ask any other debug questions on the PyDesigner GitHub page, we monitor that regularly.


-Hunter