
Hello DIPY experts, I am attempting to apply a free water correction to my DWI data in order to look at structures such as the fornix. Normally I process data within FSL, though I do have experience coding with Python. To use the free water correction, do I need to do all of my preprocessing within DIPY, or am I able to use the data I have already preprocessed within FSL? Are there also any tutorials in using my own data for processing, rather than examples? I am able to process examples with no issue, but I am struggling with applying these commands to my own data. I have mainly been confused with where to house my data, and how to proceed when I have a different type of data than the example (I have multi-shelled HYDI data, but many examples are with HARDI). I have not been successful at loading my own data for any of the examples as of yet. Any advice or resources would be extremely helpful. My lab believes that DIPY will be the way forward, so I am more than willing to learn how to do preprocessing within DIPY, it would just be convenient for my current project to use my already preprocessed data. Thank you for your help, Katie

Hi Katie, Thanks for your email. Let me try to answer these one-by-one: On Fri, May 8, 2020 at 10:58 AM Katie Jobson <tuj96493@temple.edu> wrote:
You can analyze the data that you have preprocessed with FSL. To be completely honest, I think that it's fair to say that we don't have a very good preprocessing pipeline yet. Some of us are working on this in https://github.com/nipreps/dmriprep, but that's still under heavy development. So: for now data that has been preprocessed with your existing preprocessing pipeline should work.
We should improve this. There are some tutorials on the command line interfaces that will be included in the upcoming release. For now, notice that this code: https://github.com/dipy/dipy/blob/master/doc/examples/reconst_fwdti.py#L66, creates two objects from the example data. One variable, called `img` is a nibabel image object. The other, `gtab` is a gradient table object. Instead of that line of code, you can run the following: import nibabel as nib img = nib.load('full/path/to/your/preprocessed/dwi.nii.gz') import dipy.gradients as dpg gtab = dpg.gradient_table('full/path/to/your/preprocessed/dwi.bval', 'full/path/to/your/preprocessed/dwi.bvec') After you have done that, the rest of the code in that example should run as-is (but let me know if I am missing something -- I am not 100% sure that I understand how the HYDI acquisition might affect this).
I hope it's clear that this is possible. Let me know if more information would be helpful. Cheers, Ariel

Ariel, Thank you so much for your prompt email! This looks like it should get at the problems that I was having loading the data. If I have any further questions I will be sure to ask, but I am hopeful this will solve my issues. On Fri, May 8, 2020 at 2:11 PM Ariel Rokem <arokem@gmail.com> wrote:
-- Katie Jobson, M.S. Research Assistant | Aphasia Rehabilitation Research Lab Ph.D. Student | Cognitive Neuroscience Lab Temple University

Hi Katie, Yes, you can use your other data. You do not need to host your data anywhere specifically. If you are working with python you can provide the file path of the files you need to use. For example, for the diffusion data, fname_dwi = `c:\Users\test_user\Downloads\Data\dwi.nii.gz` fname_bvals = `c:\Users\test_user\Downloads\Data\bvals` fname_bvecs = `c:\Users\test_user\Downloads\Data\bvecs` HYDI is a bit different than HARDI but still many models can be used. It would be great if you could provide more information about what exactly you want to do. For some of the models we provide command lines which maybe easier to use than writing your own scripts. For example have you tried to use the command dipy_fit_dti with your data. I suggest doing that as a learning experience. Then try to replicate the results with writing your own python script. After you become familiar with this we can suggest other models such as Mapmri/DSI/GQI which would be great with your type of data. Be happy to ask any additional questions you may have and thank you for contacting us. Best, Eleftherios On Fri, May 8, 2020 at 1:58 PM Katie Jobson <tuj96493@temple.edu> wrote:

Eleftherios, Thank you for your response as well!
My current goal is to get a free water corrected tensor map, with which I can get values for specific tracts recreated via probabilistic tractography. Our main goal is to be able to do this for the fornix, as it is a white matter tract most notably affected by CSF, but we would like to implement FW corrections for all of our data going forward.
I had not known this was available! I will explore this as well, as I agree it would be a valuable learning experience for creating my own pipeline. If you have further suggestions/questions from my explanation of what we are looking to do, I am more than happy to continue to chat. With the information both you and Ariel have provided, I feel much better equipped! Thank you!
-- Katie Jobson, M.S. Research Assistant | Aphasia Rehabilitation Research Lab Ph.D. Student | Cognitive Neuroscience Lab Temple University

Hi Katie, Thanks for your email. Let me try to answer these one-by-one: On Fri, May 8, 2020 at 10:58 AM Katie Jobson <tuj96493@temple.edu> wrote:
You can analyze the data that you have preprocessed with FSL. To be completely honest, I think that it's fair to say that we don't have a very good preprocessing pipeline yet. Some of us are working on this in https://github.com/nipreps/dmriprep, but that's still under heavy development. So: for now data that has been preprocessed with your existing preprocessing pipeline should work.
We should improve this. There are some tutorials on the command line interfaces that will be included in the upcoming release. For now, notice that this code: https://github.com/dipy/dipy/blob/master/doc/examples/reconst_fwdti.py#L66, creates two objects from the example data. One variable, called `img` is a nibabel image object. The other, `gtab` is a gradient table object. Instead of that line of code, you can run the following: import nibabel as nib img = nib.load('full/path/to/your/preprocessed/dwi.nii.gz') import dipy.gradients as dpg gtab = dpg.gradient_table('full/path/to/your/preprocessed/dwi.bval', 'full/path/to/your/preprocessed/dwi.bvec') After you have done that, the rest of the code in that example should run as-is (but let me know if I am missing something -- I am not 100% sure that I understand how the HYDI acquisition might affect this).
I hope it's clear that this is possible. Let me know if more information would be helpful. Cheers, Ariel

Ariel, Thank you so much for your prompt email! This looks like it should get at the problems that I was having loading the data. If I have any further questions I will be sure to ask, but I am hopeful this will solve my issues. On Fri, May 8, 2020 at 2:11 PM Ariel Rokem <arokem@gmail.com> wrote:
-- Katie Jobson, M.S. Research Assistant | Aphasia Rehabilitation Research Lab Ph.D. Student | Cognitive Neuroscience Lab Temple University

Hi Katie, Yes, you can use your other data. You do not need to host your data anywhere specifically. If you are working with python you can provide the file path of the files you need to use. For example, for the diffusion data, fname_dwi = `c:\Users\test_user\Downloads\Data\dwi.nii.gz` fname_bvals = `c:\Users\test_user\Downloads\Data\bvals` fname_bvecs = `c:\Users\test_user\Downloads\Data\bvecs` HYDI is a bit different than HARDI but still many models can be used. It would be great if you could provide more information about what exactly you want to do. For some of the models we provide command lines which maybe easier to use than writing your own scripts. For example have you tried to use the command dipy_fit_dti with your data. I suggest doing that as a learning experience. Then try to replicate the results with writing your own python script. After you become familiar with this we can suggest other models such as Mapmri/DSI/GQI which would be great with your type of data. Be happy to ask any additional questions you may have and thank you for contacting us. Best, Eleftherios On Fri, May 8, 2020 at 1:58 PM Katie Jobson <tuj96493@temple.edu> wrote:

Eleftherios, Thank you for your response as well!
My current goal is to get a free water corrected tensor map, with which I can get values for specific tracts recreated via probabilistic tractography. Our main goal is to be able to do this for the fornix, as it is a white matter tract most notably affected by CSF, but we would like to implement FW corrections for all of our data going forward.
I had not known this was available! I will explore this as well, as I agree it would be a valuable learning experience for creating my own pipeline. If you have further suggestions/questions from my explanation of what we are looking to do, I am more than happy to continue to chat. With the information both you and Ariel have provided, I feel much better equipped! Thank you!
-- Katie Jobson, M.S. Research Assistant | Aphasia Rehabilitation Research Lab Ph.D. Student | Cognitive Neuroscience Lab Temple University
participants (4)
-
Ariel Rokem
-
Eleftherios Garyfallidis
-
Katie Jobson
-
Katie Jobson