Showing 1-75 of 91 topics
Display:
Results per page:

1   2   Next >
  • Jan 20, 2022  12:01 PM | ruicheng ba
    Strage pxel blocks on fitting Kmeans maps and parts of the image are missing
    I input dwi images with b=0,0.8,1.5 and 2.5, where b0 has one direction and the other b values have 18 directions. There are discontinuous squares on the Kmean maps of the output result. May I ask why this is caused? I checked the original image, and there were no artifacts of similar shapes.
    In addition, I found that part of images on Kmean Map were missing. I attached the comparison images. Attachment 1 is the Kmean map, and Attachment 2 is the B0 image of the input data.
    Attachment: attachment.png

    • Mar 28, 2022  02:03 PM | Emilie McKinnon - MUSC
      RE: Strage pxel blocks on fitting Kmeans maps and parts of the image are missing
      Hi! 

      Check out the masking feature. By default, DKE uses a threshold value of 50 in the B-0 value to create a brain mask. Just by glancing at your image it looks like this is animal data and so your threshold might have to be adjusted?

      Just so you know, we are phasing out support for DKE and have moved to a more modern software that will be monitored more closely. The documentation can be found here: https://pydesigner.readthedocs.io/en/latest/ 

      I apologize for the delay!

      Best,
      Emilie

      • Mar 29, 2022  08:03 AM | ruicheng ba
        RE: Strage pxel blocks on fitting Kmeans maps and parts of the image are missing
        Thank you for your reply!

        I have tried the directional fitting instead of tensor fitting and I found these pixels disappear and the fitting results became coherent. So what's the difference between these two fitting methods? If I acquired data in >15 directions, which methods could be more accurate? By the way, is there any requirements on adjusting the B-0 threshold?

        Best,
        Ruicheng

        Mar 29, 2022  08:03 AM | ruicheng ba
        RE: Strage pxel blocks on fitting Kmeans maps and parts of the image are missing
        Originally posted by Emilie McKinnon:
        Hi! 

        Check out the masking feature. By default, DKE uses a threshold value of 50 in the B-0 value to create a brain mask. Just by glancing at your image it looks like this is animal data and so your threshold might have to be adjusted?

        Just so you know, we are phasing out support for DKE and have moved to a more modern software that will be monitored more closely. The documentation can be found here: https://pydesigner.readthedocs.io/en/latest/ 

        I apologize for the delay!

        Best,
        Emilie

        Thank you for your reply! I have tried the directional fitting instead of tensor fitting and I found these pixels disappear and the fitting results became coherent. So what's the difference between these two fitting methods? If I acquired data in >15 directions, which methods could be more accurate? By the way, is there any requirements on adjusting the B-0 threshold?

        Best,
        Ruicheng

  • Mar 28, 2022  09:03 AM | Liu Kuiyuan
    Fail in installation of DKE
    I installed  MCR (R2012a (7.17) 64-bit),but I can't run DKE. Using DKEGUI.exe, I get message:

    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18];
    idx_gradients{3} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18];

    command line: dke DKEParameters.dat
    An Error has occurred while trying to initialize the MCR.
    The error is: Fatal error loading library C:\WINDOWS\system\libmx.dll Error: The specified module could not be found
    Error:mclmcr initialization failed


    I don't know if I installed MCR correctly. When I installed MCR, I just selected installation path,should I select a specific path? 

    I tried to set environment variables,but it still didn't work(message above).I really need help.

    • Mar 28, 2022  02:03 PM | Emilie McKinnon - MUSC
      RE: Fail in installation of DKE
      Hi Liu, 

      Couple of questions: 

      - What operating system are you using? 
      - Did you try running DKE using the command line?

      Lastly, just so you know we are phasing out support for DKE and have moved to a different processing software that will be more active. I will post the link here for your convenience: https://pydesigner.readthedocs.io/en/latest/ 

      Best, 
      Emilie

  • Oct 6, 2021  06:10 PM | Cristina Roman
    Apply DKI model to multi-shell acquisition?
    Hello, 

    I have a multishell diffusion protocol (see parameters below) and was curious if I can apply a DKI model to the data through DKE to obtain DKI metrics? Or, are the below parameters insufficient for DKI? 

    Thank you in advance for your help!
    Cristina

    3T Siemens Prisma Scanner, 64-channel head coil
    Multiband factor of 3, no GRAPPA, bipolar acquisition
    Diffusion directions calculated using INRIA (Caruyer et al., 2013)
    Six separate scans
    12 directions, 2 B0s (A>>P), b= 500 s/mm2
    12 directions, 2 B0s (P>>A), b= 500 s/mm2
    29 directions, 3 B0s (A>>P), b=1500 s/mm2
    29 directions, 3 B0s (P>>A), b=1500 s/mm2
    64 directions, 4 B0s (A>>P), b=3000 s/mm2
    64 directions, 4 B0s (A>>P), b=3000 s/mm2
    Data was concatenated and run through topup and eddy

    • Oct 8, 2021  04:10 PM | Kayti Thorn
      RE: Apply DKI model to multi-shell acquisition?
      Hi Cristina,

      The parameters you supplied are sufficient for DKI and DKE should work just fine with your dataset. However, DKE is now a legacy software that is no longer supported. Our lab has transitioned to a similar tool called PyDesigner, which we encourage all DKE users to consider using as well. It is a hands-off Python-based implementation of NYU's DESIGNER dMRI preprocessing pipeline designed to maximize signal-to-noise ratio. You can read about it further on the PyDesigner Github page here and in the PyDesigner documentation here.

  • Nov 7, 2019  07:11 PM | Xinman Liu
    Problem in processing DKE after preprocessing in FSL ( eddy_correct and BET2)
    Dear experts,
    I have attached my original dwi image and nifty file in this post, with which I have difficulty fed into dke processing after eddy_correct and BET in fsl, (see as following), could you please give me some suggestions?
    % Thu Nov 07 07:40:16 PM
    studydir = 'J:/betTest/';​
    subject_list = {''};​
    preprocess_options.format = 'nifti';​
    preprocess_options.fn_nii = '13Correct_brain.nii.gz';​
    fn_img_prefix = 'rdki';​
    bval = [0 1000 2000];​
    ndir = 61;​
    idx_1st_img = 1;​
    Kmin = 0;​
    NKmax = 3;​
    Kmin_final = 0;​
    Kmax_final = 3;​
    T = 50;​
    find_brain_mask_flag = 1;​
    dki_method.no_tensor = 0;​
    dki_method.linear_weighting = 1;​
    dki_method.linear_constrained = 1;​
    dki_method.nonlinear = 0;​
    dki_method.linear_violations = 0;​
    dki_method.robust_option = 0;​
    dki_method.noise_tolerance = 0.09;​
    dti_method.dti_flag = 1;​
    dti_method.dti_only = 0;​
    dti_method.no_tensor = 0;​
    dti_method.linear_weighting = 1;​
    dti_method.b_value = 1e+003;​
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    dti_method.robust_option = 0;​
    dti_method.noise_tolerance = 0.09;​
    fn_noise = '';​
    fwhm_img = [3.375 3.375 3.375];​
    fwhm_noise = [0 0 0];​
    median_filter_method = 2;​
    map_interpolation_method.flag = 0;​
    map_interpolation_method.order = 1;​
    map_interpolation_method.resolution = 1;​
    fn_gradients = 'J:/betTest/ep2ddiff12CH30dirDKIAP20151201AGBSZA013s009a001.txt';​
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​

    command line: dke DKEParameters.dat​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015​
    Start date and time: November 07, 2019 19:42:50​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0​
    Reading input images... complete​
    Index exceeds matrix dimensions.​

    Error in dke_estimate (line 183)​



    Error in dke (line 182)​



    MATLAB:badsubscript​

    • Aug 23, 2021  07:08 PM | Hayley Clocksin
      RE: Problem in processing DKE after preprocessing in FSL ( eddy_correct and BET2)
      Hello, 

      Were you able to find a solution to this problem? I am having a similar issue and would appreciate any advice!

      Hayley

  • Sep 8, 2020  12:09 PM | psikorova
    Bruker data Command line
    Good morning,

    I am new to using the DKE software and I have been struggling with running the image processing on my Bruker data. I am trying to upload my data using the command line, since the GUI does not support Bruker data - however, after running the process for circa 30 minutes (the coregistration), it stops due to a significant number of errors. I have been trying to figure out the reason for such early and unexpected stopping, but so far I was not succesful, thus I am kindly asking here for help.

    The list of errors I get:
    Error using spm_vol>subfunc (line 101)
    File "" does not exist.
    Error in spm_vol>subfunc1 (line 77)
    Error in spm_vol>subfunc2 (line 69)
    Error in spm_vol (line 54)
    Error in spm_reslice (line 121)
    Error in dke_preprocess_bruker>coregister (line 274)
    Error in dke_preprocess_bruker>(parfor body) (line 125)
    Error in parallel_function (line 470)
    Error in dke_preprocess_bruker (line 120)
    Error in dke (line 176)

    I am pretty positive there must be something wrong in my DKE parameters file, but I just cannot figure out what exactly. Therefore, I attach my parameters file (par.dat). I am working with 5 different b values (300, 600, 900, 1200 and 1500) and 30 gradient directions.

    Thank you very much for any help,
    Pavlína Sikorová
    Attachment: par.dat

    • Sep 8, 2020  07:09 PM | Emilie McKinnon - MUSC
      RE: Bruker data Command line
      Dear Pavlina, 


      The error tells me that DKE is trying to find your images in a folder named "" (blank). This probably stems from the subject_list parameter. If I remember correctly the 20200803_140853_celer_1_1 should be placed in the subject_list. Let me know if that works. Otherwise I would try just putting the 1 there. 

      Emilie

      • Sep 9, 2020  12:09 PM | psikorova
        RE: Bruker data Command line
        Dear Emilie,

        I have tried to run it as you suggested, but it did not help. Not even the coregistration would start. The path 'C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1\' leads directly to my 2dseq file of one study subject. When I tried to follow your advice and first added the "20200803_140853_celer_1_1" to the subject_list, it was not able to get to the 2dseq at all. Then I moved the "1" to the subject_list and it would start the coregistration, but stopped at the same errors that I had mentioned in my first message.

        Thank you,

        Pavlína Sikorová

        • Sep 9, 2020  12:09 PM | Emilie McKinnon - MUSC
          RE: Bruker data Command line
          When you run it can you see if it creates a log file?  Does it create a folder called intermediate processing? 
          This is where DKE will try and find your images : dir_subj = fullfile(studydir, subject_list{isubject}); % subject root folder
          I also think this is where it is trying to find your reco file. So you might have to put that in the same folder as 2dseq. 

          Does that work? Sorry it's been a while since I used Bruker data :) 

          Emilie

          • Sep 9, 2020  02:09 PM | psikorova
            RE: Bruker data Command line
            Dear Emilie, 

            unfortunately, it does not even create the folder intermediate processing, so I am afraid I cannot follow the rest of your message. Would it help if I sent you my data set (20200803_140853_celer_1_1)? However, I am not sure whether the file is not too big for 
            And no need to apologize, I am glad for any kind of help or advice, I have been struggling with that for way too long already :)

            Pavlína

            • Sep 9, 2020  03:09 PM | Emilie McKinnon - MUSC
              RE: Bruker data Command line
              Does the log file get created? And did you try moving the rec file?

              It wont really help If you send me the data because the issue is your folder structure/path name.

              Can you send me the entire output text and your command and your dat file.

              Emilie

              • Sep 9, 2020  03:09 PM | Emilie McKinnon - MUSC
                RE: Bruker data Command line
                Did you have a look at the older forum posts. I think I helped solve similar issues to this one a couple of years ago ( that's why I cant remember :) ). The method file also needs to be in the same folder as the 2dseq. I know an update is due to the software! 

                Emilie

                • Sep 10, 2020  07:09 AM | psikorova
                  RE: Bruker data Command line
                  Dear Emilie,

                  I have been working on my issue and managed to get the file intermediate_processing being created! It is saved directly on the path studydir, so the file is created in the same place as 2dseq is (that means C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1) - this folder contains also the id, method, procs, reco, roi and visu_pars files from bruker.

                  The file intermediate_processing contains these sub folders: dki_avg1_coreg, dki_avg1_nii, dki_b0_coreg, dki_b0_nii, but it did not come to the successful ending, because there was an error which stopped the process:

                  Error using nifti/create>create_each (line 29)
                  Unable to write header for
                  "C:\Users\Katka\Desktop\sikorova\20200803_140853_celer_1_1\19\pdata\1\intermediate_processing\dki_avg2_nii\adki_300.nii".

                  Error in nifti/create (line 15)
                  Error in spm_create_vol>create_vol (line 162)
                  Error in spm_create_vol (line 16)
                  Error in spm_write_vol (line 82)
                  Error in dke_preprocess_bruker>image_avg (line 294)
                  Error in dke_preprocess_bruker (line 109)
                  Error in dke (line 176)

                  So apparently it is supposed to create more subfolders, but something caused the early stopping - I do not understand why the first four folders with files could have been created without any problem, but then the DKE was unable write header and so on...

                  Best regards,
                  Pavlína
                  Attachment: dke.log

      Sep 10, 2020  05:09 PM | Emilie McKinnon - MUSC
      RE: Bruker data Command line
      Good to hear! 

      Does it write any .nii files in any of the folders? 
      Are you sure you acquire 2 sets of averages? Maybe, preprocess_options.navg = 2; needs to be equal to 1. 

      Emilie

      • Sep 11, 2020  12:09 PM | psikorova
        RE: Bruker data Command line
        Yes, all of the folders contain files - currently (after changing preprocess_options.navg to 1 as you suggested) there are 5 of the folders: dki_avg1_coreg, dki_avg1_nii, dki_b0_coreg, dki_b0_nii and combined. And the files inside are all *.nii files.

        So in this moment, the co-registration, averaging images and reading input files are complete!
        Now I have a problem with this:

        Undefined function 'plus' for input arguments of type 'cell'.
        Error in dke_estimate (line 183)
        Error in dke (line 182)
        MATLAB:UndefinedFunction
         
        I thought it has something to do with the variables dti_method.b_value and dti_method.directions. I tried to write [1:30] instead of {1:30} and some other options, but nothing seems to be the right way... Currently it is like this:

        dti_method.b_value = [300 600 900 1200 1500];
        dti_method.directions{1} = {1:30};
        dti_method.directions{2} = {1:30};
        dti_method.directions{3} = {1:30};
        dti_method.directions{4} = {1:30};
        dti_method.directions{5} = {1:30};

        Do you by any chance have an idea what to do with that?

        Thank you!
        Attachment: par.dat

        • Sep 11, 2020  12:09 PM | Emilie McKinnon - MUSC
          RE: Bruker data Command line
          Are you using the same gradient directions for each b value?
          how many gradient directions are in fn_gradient.dat

          The structure you need is the following:
          fn_gradients = 'gradient_vectors_siemens30.dat'; = path where DKE can find your gradient table
          bval = [ 0 300 600 900 1200 1500]; = your b values , you should have acquired 0 too
          ndir = 30;
          idx_gradients = {1:ndir 1:ndir 1:ndir 1:ndir 1:ndir}; = for your non zero b-values write down which lines in your gradient table correspond to the correct gradient directions. If in fn_gradient.dat there are only 30 gradients this is the right set up.
          If you have a different gradient table for each bvalue the set up is different.
          I noticed below you copied something about dti_method ? Unless you are interested in pure DTI calculations you can just keep that part turned off. The DKI output will include FA, MD etc.
          You should be able to follow the manual more closely now that your bruker data is coverted to nifti. From this point on any error will not be related to the bruker data but to the way you set up your .dat file.
          Hope this helped.
          Emilie

          • Sep 16, 2020  06:09 AM | psikorova
            RE: Bruker data Command line
            Dear Emilie,

            I would like to ask about the maps. I still have just the five subfiles in the intermediate_processing file and I assume those are not the final maps of FA, MD etc? If so, what should I do to really get them?

            Thanks in advance,
            Pavlína

            • Sep 16, 2020  12:09 PM | Emilie McKinnon - MUSC
              RE: Bruker data Command line
              Make sure the program runs without errors until the end :) are you still getting the same error?

              • Sep 16, 2020  01:09 PM | psikorova
                RE: Bruker data Command line
                I still have some errors - currently I am trying to figure out this:

                Co-registration complete.
                Averaging images... complete.
                Reading input images... complete
                Filtering input images... complete.

                Processing voxels... Error using matlabpool (line 144)
                Failed to open matlabpool. (For information in addition to the causing error,
                validate the profile 'local' in the Cluster Profile Manager.)

                Error in dke_estimate (line 403)
                Error in dke (line 182)

                Caused by:
                Error using
                distcomp.interactiveclient/pGetSockets>iThrowIfBadParallelJobStatus (line
                114)
                The interactive parallel job finished without any messages.
                parallel:cluster:MatlabpoolRunValidation

                I do not know what in the par.dat file is connected to the matlabpool and causing this error.

                Best regards,
                Pavlína
                Attachment: par.dat

                • Sep 16, 2020  01:09 PM | Emilie McKinnon - MUSC
                  RE: Bruker data Command line
                  Are you still using the command line ? What matlab compiler runtime are you using?

                  • Sep 16, 2020  02:09 PM | psikorova
                    RE: Bruker data Command line
                    yes, still the command line. I am using the MCR R2012a

                    • Sep 16, 2020  02:09 PM | Emilie McKinnon - MUSC
                      RE: Bruker data Command line
                      Hmm I am not sure what is going on. It's weird to have a matlabpool error in the compiled version. 
                      Can you type in the word path in your command window and check if the correct MCR folder is highest in your path? 
                      A problem might be that you already had a newer version of MCR installed on your computer and the command window is not choosing MCR R2012a to run DKE.

                      • Sep 16, 2020  02:09 PM | psikorova
                        RE: Bruker data Command line
                        Well, I have a big folder called Program Files - DKE and MCR R2012a are subfolders. Not sure if this is what you meant? Othervise the MCR R2012a is definitely the only version I have on my laptop.

                        • Sep 16, 2020  03:09 PM | Emilie McKinnon - MUSC
                          RE: Bruker data Command line
                            
                          I am sorry but I am not sure what is going on at this point. It might not be related to DKE (see https://www.mathworks.com/matlabcentral/answers/57833-error-using-matlabpool-line-144 ) and I dont know how to further help you.  

                          There are two things you can do, 1. try and run DKE from the source code which will allow you more flexibility and you should be able to circumvent this matlabpool issue (https://github.com/m-ama/DKE), or 2. the lab is working on incorporating Bruker options in some of our newer processing softwares, however I have no idea how long before this will be finished. 

                          Sorry I could not figure this one out! 
                          Good luck!

                          • Sep 16, 2020  03:09 PM | psikorova
                            RE: Bruker data Command line
                            Okay, thank you very much for everything, you helped me a lot anyway! You were very helpful and responsive and I truly appreciate the time you dedicated to me :)

  • Sep 10, 2020  07:09 PM | psikorova
    2dseq from PV 6.0.1
    Good morning,

    I have a question about running DKE with DICOM files created in Paravision 6.0.1. After failing at loading my bruker data in DKE software using the command line, I wanted to try to upload DICOM files from PV 6.0.1 using both the command line and also the GUI, which DKE also provides. However, it seems that these files do not have any headers, which are typical for any other DICOM files - the DKE apparently requires it and since it cannot find it within my bruker DICOMs, it cannot identify the directions nor B0 correctly. And thus, the process cannot be executed properly. So I must wonder -  are DICOMs from PV 6.0.1 even compatible with DKE? Does anyone have any experience with this?

    Thank you all kindly for any help,
    best regards,

    Pavlína Sikorová

    • Sep 11, 2020  12:09 PM | Emilie McKinnon - MUSC
      RE: 2dseq from PV 6.0.1
      Hey Pavlina, 

      We will have better luck trying to get your data to run with bruker data than using the DICOMs from your bruker scanner I have not had much luck with DICOMs from the scanner :) 

      Emilie

  • Aug 14, 2020  02:08 PM | XING GAN - 13041128211
    gradient vectors option
    Dear experts

    After I read the dke operation document, I still don't know much about the gradient vectors option in dke. Can you tell me what it means and how I should choose.
    Looking forward to your reply.
    sincerely

    GAN XING
    GUIZHOU UNIVERTY

    • Aug 21, 2020  01:08 PM | Siddhartha Dhiman - Medical University of South Carolina
      RE: gradient vectors option
      Originally posted by XING GAN:
      Dear experts

      After I read the dke operation document, I still don't know much about the gradient vectors option in dke. Can you tell me what it means and how I should choose.
      Looking forward to your reply.
      sincerely

      GAN XING
      GUIZHOU UNIVERTY

      Hi Gan Xing,

      The gradient file contains the X, Y, and Z diffusion-weighted (DW) gradient scheme. Each row consists of 3 tab-separated floating-point columns corresponding to the X, Y and Z components of the gradient scheme, where every row corresponds to the the DW scheme for non-B0 shells.

      Non-B0 shells (B1000 and B2000) will have the same gradients, which should be stored in a gradients.txt file. For example, a 30 direction DKI dataset consisting of 10 B0s, 30 B1000s, and 30 B2000s will have a gradients.txt file with 30 rows and 3 columns

      The gradient vector option in DKE points to the path of this gradients.txt file.

      Having said that, I must warn you that DKE has been deprecated in favor of our new DTI/DKI/FBI/FBWM pipeline called PyDesigner - it is easier to run and requires less data preparation than DKE, whilst enabling slightly better tensor estimation. You may find PyDesigner at https://github.com/m-ama/PyDesigner

      Best,
      Sid

  • Mar 21, 2018  06:03 AM | minchulusa
    Tensor metrics differ between FSL_FDT and DKE
    Hello,

    I compared the FA images produced by FSL_FDT and DKE
    and found that there is somewhat difference.

    I give an example of difference image (FDT FA minus DKE FA).

    I find it somewhat different at corpus callosum, and which I think should not happen.

    I guess is it because of difference in tensor fitting method? 
    suppose that FSL do not capture kurtosis term (W)

    best wishes
    Minchul
    Attachment: subtract.jpg

    • Mar 21, 2018  11:03 AM | Emilie McKinnon - MUSC
      RE: Tensor metrics differ between FSL_FDT and DKE
      Minchul,

      Thank you for your question. Can you tell me what the scale is in your subtract.jpg? Are we talking about a 1% difference or a 10% difference (positive or negative) ? 

      Changing the dti_method.dti_flag to 1 in dkeparameters will output an FA map calculated using the DTI method (calculating D without estimating the W term). You can use this map and compare it to the FSL output. 

      dti_method.dti_flag = 0; % whether (1) or not (0) to estimate DTI parametric maps based on the DTI (in addition to DKI) signal model (default: 0)

      Best, 
      Emilie

      • Jan 27, 2020  10:01 PM | Shereif Haykal
        RE: Tensor metrics differ between FSL_FDT and DKE
        Hi,

        I have a couple of follow-up questions to this old post, if you don't mind:

        1. What's the difference between the DTI maps produced by turning on the "dti_method.dti_flag", and those automatically produced with the DKI method using the default settings? For example, what's the difference between the produced maps "fa.nii" and "fa_dti.nii"? 

        2. When using the DTI method (with "dti_method.dti_flag" on), are all the DWI shells used to produce the tensor maps or only the lower shell(s)?

        I tried to look for answers to my questions in the documentation but couldn't find what I was looking for.

        Any help would be appreciated. Thanks.

        Best,
        Shereif

  • Nov 7, 2019  07:11 PM | Xinman Liu
    Problem in processing DKE after preprocessing in FSL ( eddy_correct and BET2)
    Dear experts,
    I have attached my original dwi image and nifty file in this post, with which I have difficulty fed into dke processing after eddy_correct and BET in fsl, (see as following), could you please give me some suggestions?
    % Thu Nov 07 07:40:16 PM
    studydir = 'J:/betTest/';​
    subject_list = {''};​
    preprocess_options.format = 'nifti';​
    preprocess_options.fn_nii = '13Correct_brain.nii.gz';​
    fn_img_prefix = 'rdki';​
    bval = [0 1000 2000];​
    ndir = 61;​
    idx_1st_img = 1;​
    Kmin = 0;​
    NKmax = 3;​
    Kmin_final = 0;​
    Kmax_final = 3;​
    T = 50;​
    find_brain_mask_flag = 1;​
    dki_method.no_tensor = 0;​
    dki_method.linear_weighting = 1;​
    dki_method.linear_constrained = 1;​
    dki_method.nonlinear = 0;​
    dki_method.linear_violations = 0;​
    dki_method.robust_option = 0;​
    dki_method.noise_tolerance = 0.09;​
    dti_method.dti_flag = 1;​
    dti_method.dti_only = 0;​
    dti_method.no_tensor = 0;​
    dti_method.linear_weighting = 1;​
    dti_method.b_value = 1e+003;​
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    dti_method.robust_option = 0;​
    dti_method.noise_tolerance = 0.09;​
    fn_noise = '';​
    fwhm_img = [3.375 3.375 3.375];​
    fwhm_noise = [0 0 0];​
    median_filter_method = 2;​
    map_interpolation_method.flag = 0;​
    map_interpolation_method.order = 1;​
    map_interpolation_method.resolution = 1;​
    fn_gradients = 'J:/betTest/ep2ddiff12CH30dirDKIAP20151201AGBSZA013s009a001.txt';​
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​

    command line: dke DKEParameters.dat​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015​
    Start date and time: November 07, 2019 19:42:50​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0​
    Reading input images... complete​
    Index exceeds matrix dimensions.​

    Error in dke_estimate (line 183)​



    Error in dke (line 182)​



    MATLAB:badsubscript​

  • Nov 7, 2019  07:11 PM | Xinman Liu
    Problem in processing DKE after preprocessing in FSL ( eddy_correct and BET2)
    Dear experts,
    I have attached my original dwi image and nifty file in this post,  with which I have difficulty fed into dke processing after eddy_correct and BET in fsl, (see as following), could you please give me some suggestions?
    % Thu Nov 07 07:40:16 PM
    studydir = 'J:/betTest/';​
    subject_list = {''};​
    preprocess_options.format = 'nifti';​
    preprocess_options.fn_nii = '13Correct_brain.nii.gz';​
    fn_img_prefix = 'rdki';​
    bval = [0 1000 2000];​
    ndir = 61;​
    idx_1st_img = 1;​
    Kmin = 0;​
    NKmax = 3;​
    Kmin_final = 0;​
    Kmax_final = 3;​
    T = 50;​
    find_brain_mask_flag = 1;​
    dki_method.no_tensor = 0;​
    dki_method.linear_weighting = 1;​
    dki_method.linear_constrained = 1;​
    dki_method.nonlinear = 0;​
    dki_method.linear_violations = 0;​
    dki_method.robust_option = 0;​
    dki_method.noise_tolerance = 0.09;​
    dti_method.dti_flag = 1;​
    dti_method.dti_only = 0;​
    dti_method.no_tensor = 0;​
    dti_method.linear_weighting = 1;​
    dti_method.b_value = 1e+003;​
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    dti_method.robust_option = 0;​
    dti_method.noise_tolerance = 0.09;​
    fn_noise = '';​
    fwhm_img = [3.375 3.375 3.375];​
    fwhm_noise = [0 0 0];​
    median_filter_method = 2;​
    map_interpolation_method.flag = 0;​
    map_interpolation_method.order = 1;​
    map_interpolation_method.resolution = 1;​
    fn_gradients = 'J:/betTest/ep2ddiff12CH30dirDKIAP20151201AGBSZA013s009a001.txt';​
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​

    command line: dke DKEParameters.dat​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015​
    Start date and time: November 07, 2019 19:42:50​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0​
    Reading input images... complete​
    Index exceeds matrix dimensions.​

    Error in dke_estimate (line 183)​



    Error in dke (line 182)​



    MATLAB:badsubscript​

  • Nov 7, 2019  07:11 PM | Xinman Liu
    Problem in processing DKE after preprocessing in FSL ( eddy_correct and BET2)
    Dear experts,
    I have difficulty fed into dke processing after eddy_correct and BET in fsl, (see as following), could you please give me some suggestions?
    % Thu Nov 07 07:40:16 PM
    studydir = 'J:/betTest/';​
    subject_list = {''};​
    preprocess_options.format = 'nifti';​
    preprocess_options.fn_nii = '13Correct_brain.nii.gz';​
    fn_img_prefix = 'rdki';​
    bval = [0 1000 2000];​
    ndir = 61;​
    idx_1st_img = 1;​
    Kmin = 0;​
    NKmax = 3;​
    Kmin_final = 0;​
    Kmax_final = 3;​
    T = 50;​
    find_brain_mask_flag = 1;​
    dki_method.no_tensor = 0;​
    dki_method.linear_weighting = 1;​
    dki_method.linear_constrained = 1;​
    dki_method.nonlinear = 0;​
    dki_method.linear_violations = 0;​
    dki_method.robust_option = 0;​
    dki_method.noise_tolerance = 0.09;​
    dti_method.dti_flag = 1;​
    dti_method.dti_only = 0;​
    dti_method.no_tensor = 0;​
    dti_method.linear_weighting = 1;​
    dti_method.b_value = 1e+003;​
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    dti_method.robust_option = 0;​
    dti_method.noise_tolerance = 0.09;​
    fn_noise = '';​
    fwhm_img = [3.375 3.375 3.375];​
    fwhm_noise = [0 0 0];​
    median_filter_method = 2;​
    map_interpolation_method.flag = 0;​
    map_interpolation_method.order = 1;​
    map_interpolation_method.resolution = 1;​
    fn_gradients = 'J:/betTest/ep2ddiff12CH30dirDKIAP20151201AGBSZA013s009a001.txt';​
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61];​

    command line: dke DKEParameters.dat​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015​
    Start date and time: November 07, 2019 19:42:50​
    Diffusional Kurtosis Estimator (DKE) version 2.6.0​
    Reading input images... complete​
    Index exceeds matrix dimensions.​

    Error in dke_estimate (line 183)​



    Error in dke (line 182)​



    MATLAB:badsubscript​

  • Nov 1, 2019  01:11 PM | rosella trò
    error when running DKE
    when trying to run DKE on DKI spinal cord data it turns out this error:

    Diffusional Kurtosis Estimator (DKE) version 2.6.0, November 2014
    Start date and time: October 30, 2019 16:48:34
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Reading input images... complete
    Index exceeds matrix dimensions.

    Error in dke_estimate (line 183)
    Error in dke (line 183)
    MATLAB:badsubscript

    how can i FIX IT?

  • Oct 14, 2019  03:10 PM | rosella trò
    Problems with DKE installation on MacOs High Sierra
    Hi, I am trying to install DKe on my Mac but I have problems installing MCR 2012a. It gives me the following error: 

    MCR_R2012a_maci64_installer neuroradiologia$ ./install
    Preparing installation files ...
    Installing ...
    Unrecognized option: -d64
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    Finished

    As a result, I cannot install DKE.
    Thank you,
    Rosella

  • Sep 14, 2015  09:09 PM | Luis Zertuche
    DKE Tractography Error
    Hello All,

    I get an error using the DKE_FT tool that I can't figure out how to solve. Message reads:

    C:\Users\luis\Desktop\DKE_FIBERTRACKING>dke_ft.exe ft_parameters.txt
    Starting matlabpool using the 'local' profile ... connected to 2 labs.

    Start date and time: September 14, 2015 14:53:54
    Fiber Tractography with DKI version 1
    July 2015
    Optimizing kurtosis dODF...Error using dke_ft (line 132)
    The number of voxels in the FA image and the tensors must match!
    Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
    the fa image from the DT.mat using the Nifti header from the diffusion weighted
    images.

    Does this mean I have re-run the preprocessing again unchecking the interpolation flag in the gui? (took 5 hours to run)

    ~Thanks for the help, Luis.
    PS
    My scanner (Siemens Skyra) puts out a  FA map (and and FA colored map) for the DKI run, is there a way I could use that to skip some of the preprocessing or do tractography on that one directly?


    Ps 2
    This is the parameters file that I used for preprocessing with DKE:
    % Wed Sep 09 05:12:24 PM
    studydir = 'C:\Users\luis\Desktop\S8306TYX_126265_3\cmrr009DKI_64dir2x2x2';
    subject_list = {''};
    preprocess_options.format = 'dicom';
    preprocess_options.navg = 1;
    preprocess_options.extra_b0 = 0;
    preprocess_options.coreg_flag = 1;
    preprocess_options.series_description = {'cmrr009DKI_64dir2x2x2'};
    fn_img_prefix = 'rdki';
    bval = [0 1000 2000];
    ndir = 64;
    idx_1st_img = 1;
    Kmin = 0;
    NKmax = 3;
    Kmin_final = 0;
    Kmax_final = 3;
    T = 50;
    find_brain_mask_flag = 1;
    dki_method.no_tensor = 0;
    dki_method.linear_weighting = 1;
    dki_method.linear_constrained = 1;
    dki_method.nonlinear = 0;
    dki_method.linear_violations = 0;
    dki_method.robust_option = 0;
    dki_method.noise_tolerance = 0.09;
    dti_method.dti_flag = 0;
    dti_method.dti_only = 0;
    dti_method.no_tensor = 0;
    dti_method.linear_weighting = 1;
    dti_method.b_value = 1e+003;
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];
    dti_method.robust_option = 0;
    dti_method.noise_tolerance = 0.09;
    fn_noise = '';
    fwhm_img = [3.375 3.375 3.375];
    fwhm_noise = [0 0 0];
    median_filter_method = 2;
    map_interpolation_method.flag = 1;
    map_interpolation_method.order = 1;
    map_interpolation_method.resolution = 1;
    fn_gradients = 'C:/Users/luis/Desktop/S8306TYX_126265_3/bvec_64dir_b0rem.txt';
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];

    • Sep 15, 2015  12:09 AM | Russell Glenn - Medical University of South Carolina
      RE: DKE Tractography Error
      Hi Luis,

      You do not necessarily need to rerun DKE to run the FT module. The reason the FT module needs the fa image is the .nii header contains a lot of info that the FT module uses, like the voxel dimensions, image dimensions, and the vox_to_ras transformation in the nifti header. There is a possible solution included below if you have Matlab, which should run in a few seconds. I am not sure if the FT module will run with the output images are from the Skyra, but if they are in .nii format, then it should.

      However, I am very surprised that DKE took 5 hours to run on a single subject. This suggests the constrained fitting could be doing more than it should, which can potentially happen if there is an image / gradient miss-match. I would check the parameter maps such as fa and kmean and make sure they look good. Sometimes it can also be beneficial to drop the median filtering method down to 1 or 0 but that won't effect the processing time.

      Best,

      Russell

      %fn_img: file path 'template' image (.nii) (eg b0 3D or 4D)
      %fn_dt: file path to DT.mat (.mat)
      %fn_fa: file path to new fa image to write (.nii)

      hdr = spm_vol(fn_img);
      load(fn_dt)
      idx = sqrt(sum(DT.^2))>0;
      fa = zeros(1,prod(hdr(1).dim(1:3)));
      fa(idx) = sqrt(3.*sum([DT(1:3,idx)-repmat(sum(DT(1:3,idx))./3,3,1);repmat(DT(4:6,idx),2,1)].^2)./...
      sum([DT(1:3,idx);repmat(DT(4:6,idx),2,1)].^2)./2);
      hdr(1).fname = fn_fa;
      hdr(1).dt = [16 0];
      spm_write_vol(hdr(1),reshape(fa,hdr(1).dim(1:3)));
      edit

      • Dec 7, 2016  08:12 PM | sevim sahin - Kocaeli University
        RE: DKE Tractography Error
        Hello,

        I get the same error using the dke-ft tool and I follow the instructions above;

        I have SPM12 and yet I get the following errors;

        Error using spm_create_vol>create_vol (line 67)
        "." is not a recognised extension.

        Error in spm_create_vol (line 13)
        v = create_vol(V(i));
        Error in spm_write_vol (line 83)
        V = spm_create_vol(V);

        what can I do about that?

        And the second question is;

        am I suppose to switch  the median filtering to no filtering or weak filtering on DKE to avoid the
        " The number of voxels in the FA image and the tensors must match!" error ? 

        Thank you.

        Sevim

        • Dec 12, 2016  03:12 PM | Emilie McKinnon - MUSC
          RE: DKE Tractography Error
          Dear Sevim,

          Regarding your first question: There is still a problem with your path, it is trying to write a file with the extension "." , while most likely it has to be ".nii". fn_fa needs to be something like "fa.nii". 

          With respect to your second question, you need to turn off interpolation. Interpolation will result in an FA map that has different dimensions than your tensors.

          Best, 
          Emilie

      Apr 11, 2018  02:04 PM | Xinman Liu
      RE: DKE Tractography Error
      Hello, Luis, have you finally figured that out how to solve the Problem?
      I mean, did you manage to set map_interpolation_method.flag = 0? Whenever I do it and run dke again, it stays the same.
      If so, could you do me a favor and write down the exact steps how you solve it?
      Thank you.
      Best regards,
      Xinman

      Originally posted by Luis Zertuche:
      Hello All,

      I get an error using the DKE_FT tool that I can't figure out how to solve. Message reads:

      C:\Users\luis\Desktop\DKE_FIBERTRACKING>dke_ft.exe ft_parameters.txt
      Starting matlabpool using the 'local' profile ... connected to 2 labs.

      Start date and time: September 14, 2015 14:53:54
      Fiber Tractography with DKI version 1
      July 2015
      Optimizing kurtosis dODF...Error using dke_ft (line 132)
      The number of voxels in the FA image and the tensors must match!
      Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
      the fa image from the DT.mat using the Nifti header from the diffusion weighted
      images.

      Does this mean I have re-run the preprocessing again unchecking the interpolation flag in the gui? (took 5 hours to run)

      ~Thanks for the help, Luis.
      PS
      My scanner (Siemens Skyra) puts out a  FA map (and and FA colored map) for the DKI run, is there a way I could use that to skip some of the preprocessing or do tractography on that one directly?


      Ps 2
      This is the parameters file that I used for preprocessing with DKE:
      % Wed Sep 09 05:12:24 PM
      studydir = 'C:\Users\luis\Desktop\S8306TYX_126265_3\cmrr009DKI_64dir2x2x2';
      subject_list = {''};
      preprocess_options.format = 'dicom';
      preprocess_options.navg = 1;
      preprocess_options.extra_b0 = 0;
      preprocess_options.coreg_flag = 1;
      preprocess_options.series_description = {'cmrr009DKI_64dir2x2x2'};
      fn_img_prefix = 'rdki';
      bval = [0 1000 2000];
      ndir = 64;
      idx_1st_img = 1;
      Kmin = 0;
      NKmax = 3;
      Kmin_final = 0;
      Kmax_final = 3;
      T = 50;
      find_brain_mask_flag = 1;
      dki_method.no_tensor = 0;
      dki_method.linear_weighting = 1;
      dki_method.linear_constrained = 1;
      dki_method.nonlinear = 0;
      dki_method.linear_violations = 0;
      dki_method.robust_option = 0;
      dki_method.noise_tolerance = 0.09;
      dti_method.dti_flag = 0;
      dti_method.dti_only = 0;
      dti_method.no_tensor = 0;
      dti_method.linear_weighting = 1;
      dti_method.b_value = 1e+003;
      dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];
      dti_method.robust_option = 0;
      dti_method.noise_tolerance = 0.09;
      fn_noise = '';
      fwhm_img = [3.375 3.375 3.375];
      fwhm_noise = [0 0 0];
      median_filter_method = 2;
      map_interpolation_method.flag = 1;
      map_interpolation_method.order = 1;
      map_interpolation_method.resolution = 1;
      fn_gradients = 'C:/Users/luis/Desktop/S8306TYX_126265_3/bvec_64dir_b0rem.txt';
      idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];
      idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64];

      May 12, 2019  10:05 AM | qianrunda
      RE: DKE Tractography Error
      Hello, I found that the reason for FA image doesn't match tensors is interpolation. Just switch off the interpolate button in the DKE GUI can solve this problem.

  • Mar 19, 2019  01:03 PM | Corinna Bauer
    ordering of bvecs
    Hello all,

    I have 30 direction DKI data at b1000 and b2000 with a single b0. The b0 is at the beginning of the dataset, which then alternates back and forth between the b1000 and b2000. My question is regarding the btable and the ordering of the data. Do I need to reorder the data so that all the b1000 images come first, followed by all the b2000 images, or is it acceptable to keep them as alternating. The bvecs in the gradient table are currently alternating (b1000, 2000, 1000, 2000, etc.) to match the images.

    Thank you

    Corinna

    • Mar 19, 2019  09:03 PM | David Lewis - Medical University of South Carolina
      RE: ordering of bvecs
      Hi Corinna,

      Is the data in Nifti format or Dicom? If the data are in a 4D Nifti file, the data ordering has to be the b0 volume followed by all the b1000 volumes and then followed by all the b2000 volumes. If the data are Dicom images in a directory, I don't know if the order matters but I can look into it.

      Best,
      Dave

      • Mar 19, 2019  09:03 PM | Corinna Bauer
        RE: ordering of bvecs
        Hi Dave,

        Thank you for your reply. It is in Nifti format, so I'll reorder the volumes and the bvecs to be the b0 volume, all the b1000 volumes, and then all the b2000 volumes.

        Thanks

        • Mar 20, 2019  12:03 PM | David Lewis - Medical University of South Carolina
          RE: ordering of bvecs
          Hi Corinna,

          Glad I could help and thanks for using DKE!

          Dave

          • Mar 20, 2019  08:03 PM | Corinna Bauer
            RE: ordering of bvecs
            > Thanks Dave,
            >

            I have one further question, I noticed that the kfa map looks a little
            noisy for my test subject from our patient group (ventriculomegaly with
            periventricular white matter damage). I have run DKE using both weak and
            strong filtering and there is an obvious difference, but I am not sure
            which is best to use. Would be able to take a quick look and let me know
            which one looks better to use moving forward? Both have been run with the
            background threshold of 20.
            dki_kfa_T20_filter2.nii




            dki_kfa_T20_filter1.nii

            Thanks!
            Corinna

      Mar 20, 2019  08:03 PM | Corinna Bauer
      RE: ordering of bvecs
      Here is filter 1

  • Jan 10, 2019  11:01 PM | Hanny Yau
    dke downlad page is invalid!
    Hi,

    I am a college student from Sun Yat-sen University, new in using DKE software.

    I am trying to download DKE software here, however, the download page is invalid. If possible, could anyone provide me a new link to it?

    Best regards,
    Hanny yau

    • Jan 11, 2019  02:01 AM | David Lewis - Medical University of South Carolina
      RE: dke downlad page is invalid!
      Hi Hanny Yau,

      Recently our university's website was redesigned, and we have to make modifications to our web pages. After the DKE software gets put back on the website, we'll update the link here on NITRC. I will let you know when it is fixed.

      Thanks for your interest in our DKE software.

      Best regards,
      Dave

  • Oct 3, 2018  02:10 PM | Live Eikenes
    Problems running in batch mode on linux
    Hi

    I have previously been running DKE in batch mode on Windows, but now I have switched to linux and need to perform DKE analysis in batch mode there.

    I do have some problems figuring out how to do that. It says on your web page that linux is run by:

    ./run_dke.sh

    But I do not understand how to put in the DKEparameters into this command. In windows I used the DKEparameters.dat file, and I guess that the parameters in this .dat file are the same parameters that I should use in linux, but in what format should I put them into the linux command? Should it be a .txt file?

    Best,
    Live

    • Oct 3, 2018  03:10 PM | David Lewis - Medical University of South Carolina
      RE: Problems running in batch mode on linux
      Hi Live,

      The usage statement is

      ./run_dke.sh path_to_matlab_compiler DKE_parameter_file

      For DKE_parameter_file you can use whatever file name you want — it can be DKEParameters.dat (same as on Windows) or DKEParameters.txt for example.

      So if your DKE parameter file is called DKEparameters.txt, and if the path to the MATLAB compiler is /usr/local/matlab/MATLAB_Compiler_Runtime/v714, then the command would be

      ./run_dke.sh /usr/local/matlab/MATLAB_Compiler_Runtime/v714 DKEparameters.txt

      Best,
      Dave

      • Oct 4, 2018  12:10 PM | Live Eikenes
        RE: Problems running in batch mode on linux
        Hi Dave,

        Thanks for your reply.

        I managed to run one analysis for one of the id's in the study by writing:

        ./dke /home/eikeliv/Documents/MILD_TBI_DKE/d1_1001/d1_1001.dat

        And by writing this command:

        ./run_dke.sh usr/local/MATLAB/MATLAB_Compiler_Runtime/v717 /home/eikeliv/Documents/MILD_TBI_DKE/d1_1001/d1_1001.dat

        Can I use both these commands?

        However, I still dont understand how I can perform analysis in batch mode. I tried making the following script:

        #!/bin/bash

        for i in 'cat id_mTBI.txt'
        do
        ./dke /home/eikeliv/Documents/MILD_TBI_DKE/${i}/${i}.dat
        done

        But that does not work.

        Best,
        Live

      Oct 12, 2018  03:10 PM | Emilie McKinnon - MUSC
      RE: Problems running in batch mode on linux
      Hi Live,

      Your for loop has some syntax issues. It should look more like this: 

      #!/bin/bash
      export ID_file= id_mTBI.txt
      SUBJ_IDs=$(cat $ID_file)
      for ID in $SUBJ_IDs ; do
      ./dke /home/eikeliv/Documents/MILD_TBI_DKE/${ID}/${ID}.dat
      Done

      Regarding the making of your .dat files automatically try using the "sed" command to replace strings within a file.  
      Try searching some forums on scripting in bash for specific examples! 

      Best,
      Emilie

      Oct 15, 2018  11:10 AM | Live Eikenes
      RE: Problems running in batch mode on linux
      Dear Emilie

      Thanks for your suggestion. I tried the following:

      #!/bin/bash
      export ID_file=id_mTBI.txt
      SUBJ_IDs=$(cat $ID_file)
      for ID in $SUBJ_IDs ; do
      ./dke /home/eikeliv/Documents/MILD_TBI_DKE/test_loop_dke/${ID}/${ID}.dat
      done

      But got the following error message:

      eikeliv@ntnu14028:~/dke$ ./runDKE_mTBI_test.sh
      bash: ./runDKE_mTBI_test.sh: /bin/bash^M: bad interpreter: No such file or directory

      But I cannot figure out what is wrong.

      Best,
      Live

      • Oct 15, 2018  12:10 PM | Corinne McGill - MUSC
        RE: Problems running in batch mode on linux
        Hi Live,

        Concerning the line that runs DKE, on a Mac you need to use the following format:

        ./run_dke.sh

        not "./dke /home/eikeliv/Documents/MILD_TBI_DKE/test_loop_dke/${ID}/${ID}.dat".

        Hope this helps!
        Corinne

        Originally posted by Live Eikenes:
        Dear Emilie

        Thanks for your suggestion. I tried the following:

        #!/bin/bash
        export ID_file=id_mTBI.txt
        SUBJ_IDs=$(cat $ID_file)
        for ID in $SUBJ_IDs ; do
        ./dke /home/eikeliv/Documents/MILD_TBI_DKE/test_loop_dke/${ID}/${ID}.dat
        done

        But got the following error message:

        eikeliv@ntnu14028:~/dke$ ./runDKE_mTBI_test.sh
        bash: ./runDKE_mTBI_test.sh: /bin/bash^M: bad interpreter: No such file or directory

        But I cannot figure out what is wrong.

        Best,
        Live

        • Oct 15, 2018  01:10 PM | Live Eikenes
          RE: Problems running in batch mode on linux
          Hi Corinne,

          I am not running this on mac, but on linux.

          And I can run one and one job in the terminalwindow by writing:

          ./dke /home/eikeliv/Documents/MILD_TBI_DKE/d1_1001/d1_1001.dat

          But when I try to run it in a .sh script like the one below, and in a loop for all the individuals in my study, I cannot make it to work. 

          Any other suggestions?

          Best,
          Live

          Originally posted by Corinne McGill:
          Hi Live,

          Concerning the line that runs DKE, on a Mac you need to use the following format:

          ./run_dke.sh

          not "./dke /home/eikeliv/Documents/MILD_TBI_DKE/test_loop_dke/${ID}/${ID}.dat".

          Hope this helps!
          Corinne

          Originally posted by Live Eikenes:
          Dear Emilie

          Thanks for your suggestion. I tried the following:

          #!/bin/bash
          export ID_file=id_mTBI.txt
          SUBJ_IDs=$(cat $ID_file)
          for ID in $SUBJ_IDs ; do
          ./dke /home/eikeliv/Documents/MILD_TBI_DKE/test_loop_dke/${ID}/${ID}.dat
          done

          But got the following error message:

          eikeliv@ntnu14028:~/dke$ ./runDKE_mTBI_test.sh
          bash: ./runDKE_mTBI_test.sh: /bin/bash^M: bad interpreter: No such file or directory

          But I cannot figure out what is wrong.

          Best,
          Live

          • Oct 15, 2018  02:10 PM | David Lewis - Medical University of South Carolina
            RE: Problems running in batch mode on linux
            Hi Live,

            It looks to me like your script runDKE_mTBI_test.sh is in DOS format, which has different end-of-line characters than Linux (or Unix) format. The ^M at the end of the /bin/bash line represents a carriage return, which is at the end of text files created on a Windows PC but not on text files created on a Linux computer.

            If your Linux computer has a program dos2unix, you can use that to convert the script to Unix format so that it will run on your Linux computer. If not you might be able to open it in a text editor and save it in Unix format.

            Best,
            Dave

  • Jul 25, 2018  12:07 PM | Alzbeta Minsterova
    Specific error with Inf/NaN
    Hello everyone, 

    I have 4D nifiti DKI data of many patients and I am calling DKE via command line, using my own b-vectors. It worked well for majority of my subjects. However, there are few subjects with following error:

    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Reading input images... complete
    Filtering input images... complete.
    Processing voxels... 6% complete.Error using parallel_function (line 589)

    Input to EIG must not contain NaN or Inf.
    Error stack:
    dke_estimate>dke_core at 1023
    dke_estimate>(parfor body) at 441
    Error in dke_estimate (line 438)
    Error in dke (line 182)
    MATLAB:eig:matrixWithNaNInf

    I have checked and there are no Infs or NaNs in my images or b-vecs. However, if I try to calculate maps of these patients with GUI using default vectors, it works withour errors. Therefore I think, there is some problem which DKE/MATLAB cannot handle during the calculations (e.g. dividing by 0 or so). 

    Is there any possibility to get inside the DKE code, so I can debug it maybe? Or did anyone have simmilar problems? Did you solve it, anyhow?

    Thanks in advance!
    Alzbeta

    • Aug 13, 2018  02:08 PM | Emilie McKinnon - MUSC
      RE: Specific error with Inf/NaN
      Hi Alzbeta, 

      I have ran into this problem before. That said, it tends to happen when I actually have NaNs at the edge of my image that were introduced by preprocessing :). One thing that comes to mind is that a gradient vector of [0,0,0] left in your .txt will introduce NaNs/Inf as well. Is that the case here? Feel free to share the gradient file with us if you would like. I would also be happy to look at your data. 

      My apologies for the delay in responding. 

      Best, 
      Emilie

      • Aug 14, 2018  08:08 AM | Alzbeta Minsterova
        RE: Specific error with Inf/NaN
        Originally posted by Emilie McKinnon:
        Hi Alzbeta, 

        I have ran into this problem before. That said, it tends to happen when I actually have NaNs at the edge of my image that were introduced by preprocessing :). One thing that comes to mind is that a gradient vector of [0,0,0] left in your .txt will introduce NaNs/Inf as well. Is that the case here? Feel free to share the gradient file with us if you would like. I would also be happy to look at your data. 

        My apologies for the delay in responding. 

        Best, 
        Emilie

        Hello Emilie, 

        thank you for your answer. I am attaching the data of one patient (four bvecs .txt files for bvals 500, 1000, 2000, 4000 s/mm2 (yes, we know, that 4000 is too much but we are trying anyway), the data and the DKEParameters.dat file).

        I will be more that happy if you identify some problem. I am already out of ideas.

        Best, 
        Alzbeta

        Aug 14, 2018  09:08 AM | Alzbeta Minsterova
        RE: Specific error with Inf/NaN
        Uhm, seems like the attachement is to big for this forum.
        I will try to send it to you via email. 
        Thanks for help, 
        Best, 
        A.

        • Aug 14, 2018  11:08 AM | Emilie McKinnon - MUSC
          RE: Specific error with Inf/NaN
          Got it! Will let you know what the problem is asap. 

          Best, 
          Emilie

          Sep 26, 2018  09:09 PM | Emilie McKinnon - MUSC
          RE: Specific error with Inf/NaN
          Hi Alzbeta, 

          I believe the errors are caused by the robust fitting option. If you change dki_method.robust_option = 0 your data runs fine on my end. I have always done the tensor fitting using the constrained least squares and cleaned up some of the poor fits using median filtering. So, I am not familiar with the exact details of the robust fitting. That said, at first glance it looks like for a few voxels the code treats every gradient direction as an outlier and ends up with empty matrices which results in inf /NaN later on.  I don't know what your preprocessing steps are but denoising your data helps alleviate some of these bad fitting voxels. 

          Best, 
          Emilie

  • Sep 2, 2015  03:09 PM | Robert Welsh
    DKE + FSL pipeline has issue
    Hi,

    I have successfully used DKE on a Mac (10.10.5) to reconstruct DKE metrics. I would now like to take the estimates from the DKE and utilize my FSL TBSS pipeline to run statistical analyses. Here is what I'm doing.

    Data were converted from DICOM to NII using mcverter from University of Oregon

    (0) the data have a qform and sform of "Scanner Anat" 
    (1) taking native space DKI data set and running through FSL DTIFIT to get a FA map. 
    (2) use the native space FA map (I'll call it FA_FSL) to run TBSS with my two cohorts
    (3) use DKE on the native space DKI data set to calculate metrics (KFA, KMEAN etcetera). I have DKE resample to 1.5mm isotropic 
    (4) I now want to take the TBSS derived warps and apply them to the DKE data. 

    This doesn't work. It appears that the qform and sform are change by DKE to be in "Aligned Anat" with diagonal qto_xyz and sto_xyz matrices. 

    If I do a "Check Reg" in spm, the images show they are aligned.

    If I try to a FSL/flirt realignment without resampling/reslicing, specifying rigid body (dof = 6), they affine matrix is the identity matrix

    If, however, I try to do a flirt resampling/resclicing using the identity matrix, the resulting image is all skewed with respect to the original b=0 image.

    And of course, if I apply the warping, that is also messed up.

    Robert

    • Sep 2, 2015  04:09 PM | C C
      RE: DKE + FSL pipeline has issue
      Hi Robert,

      Great to hear that DKE runs successfully in the latest build of Yosemite.  In my experience in using DKE (version 2.6) and TBSS, I have always started the processing from the straight dicoms.  [Or alternatively, generated a nifti from the dicoms (DKI sequence, DKI B0 sequence) using dcm2nii, found in MRIcron]

      If you are using the DKE GUI, you don't have to presort your dicom folder with different sequences, as the GUI will display the different sequences to be used for processing in the folder that you specified for the GUI to load from. I bring this up due to the fact that DKE by default will generate the standard 7 metrics (3 diffusion, 1 FA, and 3 kurtosis) among others.  The key is this generated FA map that DKE gives us for each subject.

      It is this FA map for each subject that I feed into the standard TBSS pipeline.  In my opinion and experience, I believe it is unnecessary to go through the trouble of of using the extra tools in FSL to obtain the FA map that you specified.  The reason is because if you use the FA map that is generated from the DKE processing, it will be in the same space as your output diffusion and kurtosis maps.  Which in the case of TBSS, it will take care of all normalization and coregistration for you anyways based on your template or option that you are choosing (tbss_2_reg tbss_3_postreg).

      Furthermore, if you are looking to normalize all the FA maps to same space and subsequent non-FA maps (kmean, krad, dmean, etc...), FSL's TBSS also takes care of that for you in their standard pipeline.  If you are following the TBSS standard pipeline Steps 1-4, once you use the FA maps and other non-FA maps, there will be a stats folder generated that contains the 4D nifti files for your metrics such as: all_FA.nii.gz; all_kmean.nii.gz; all_krad.nii.gz; etc.  These 4D files contain all of the subjects metric map concatenated into one file with normalization and coregistration taken care of into MNI space.  From this 4D file where each time series corresponds with one independent subject, you can then use FSL split to retrieve the independent 3D nifiti.  TBSS can be tricky when using non-FA maps due to the file directory organization.

      To wrap it up though, this is my standard pipeline of processing of utilizing DKE to output my metric maps of interest, and using them in a TBSS analysis, hope that provides some clarity in using TBSS.

      Cliff

      • Aug 14, 2017  03:08 PM | Eric Forman - University of Kentucky
        RE: DKE + FSL pipeline has issue
        Hi Cliff,

          We are running the DKE through TBSS and getting bad images and low numbers.  For example, in the attached pic, you can see that the FA in the genu is only 0.14.  From what we are finding, the average on a normal healthy adult should be around 0.64.  Any ideas on what might be going on here?  Any help is greatly appreciated.

        Thanks, 
        Eric
        Attachment: Low_genu.png

      Aug 15, 2017  08:08 AM | Kirk Feindel - University of Western Australia
      RE: DKE + FSL pipeline has issue
      Hi Robert,

      You have entered the lovely realm of file format interpretation . . . FSL requires a specific orientation and is rather inflexible, which can cause problems such as you are encountering.

      Personally, I convert from DICOM to nifti using MRtrix.  We use the FSL eddy tool and BET, and then feed into DKE after restructuring the nifti to have one leading B0, then each Bseries.

      After DKE you can use fslreorient2std on the niftis to get them in the orientation that FSL likes, coregister to MNI via an FA atlas (using the FA out of DKE).  We first go FA atlas to MNI atlas (once) then FA(DKE) to FA(atlas), and then concatenate the matrices to go direct FA(DKE) to MNI.  Then we're good to go for TBSS.

      If you want more details, I can ask one of my student's who's set up our TBSS analysis pipeline.

      Cheers,

      Kirk

      • Aug 8, 2018  10:08 AM | Shereif Haykal
        RE: DKE + FSL pipeline has issue
        Dear Kirk,

        I'm running into the same problem as the original poster. Whenever I try to run the first step of TBSS (tbss_1_preproc) with the produced fa maps, I get the message "ERROR: Inconsistent left-right order stored in sform and qform in file fa Using sform instead of qform values". I tried using fslreorient2std as suggested to put them in an FSL-friendly orientation, but still got the same error message. I tried to register the maps to MNI space, still same error.

        FSL just refuses to to handle any DKE output files. I tested my input files with FSL dtifit, and produced regular FA maps which I was able to feed into the TBSS pipeline, so my input files definitely have no orientation issue (I think!).

        Is there any solution to that problem? I was so excited to finally produce DKI maps, but now I have no idea how to handle them.... 

        Thanks for the help.

        Cheers,

        Shereif

        • Aug 8, 2018  01:08 PM | Corinne McGill - MUSC
          RE: DKE + FSL pipeline has issue
          Hi Shereif,

          I run TBSS on the outputs of DKE weekly and have never run into this problem. I also use fslreorient2std, FNIRT, and many other FSL commands on this data. 

          Perhaps the problem is originating earlier in your pipeline. How are you converting your dicoms to niftis? Can you describe your pipeline prior to running DKE?

          Thank you,
          Corinne
          Originally posted by Shereif Haykal:
          Dear Kirk,

          I'm running into the same problem as the original poster. Whenever I try to run the first step of TBSS (tbss_1_preproc) with the produced fa maps, I get the message "ERROR: Inconsistent left-right order stored in sform and qform in file fa Using sform instead of qform values". I tried using fslreorient2std as suggested to put them in an FSL-friendly orientation, but still got the same error message. I tried to register the maps to MNI space, still same error.

          FSL just refuses to to handle any DKE output files. I tested my input files with FSL dtifit, and produced regular FA maps which I was able to feed into the TBSS pipeline, so my input files definitely have no orientation issue (I think!).

          Is there any solution to that problem? I was so excited to finally produce DKI maps, but now I have no idea how to handle them.... 

          Thanks for the help.

          Cheers,

          Shereif

          • Aug 8, 2018  03:08 PM | Shereif Haykal
            RE: DKE + FSL pipeline has issue
            Hi Corinne,

            Thank you for the prompt reply!


            So first, the data was aquired on a Siemens scanner, 3 shells (0, 1000, 2500), in both AP and PA directions.

            My pipline is as follows:

            I convert my data from dicom to nifti using dcm2nii gui, then I denoise the data using dwidenoise function in MRTrix3. The denosied dwi data is then corrected for motion, eddy current and susceptibility artifacts using FSL topup and eddy. Then using fslmerge and fslroi, I arrange the corrected diffusion data in the format required by DKE, average b0 first, then the second shell (b=1000 in my case) and then the third (b=2500). As for the bvecs, they are transposed in matlab to put them in 3 colums (x,y,z), and then arranged in a txt file to correspond to the arrangement of shells.

            Would it help if I attach an example of the DKE produced fa/kfa files?

            Thank you so much for the help! Looking forward to your reply.

            Best,
            Shereif

          Aug 8, 2018  03:08 PM | Hunter Moss
          RE: DKE + FSL pipeline has issue
          Hi Shereif,

          Have you compared the sform and qform fields in the image headers before and after running DKE? 

          -Hunter

          • Aug 8, 2018  05:08 PM | Shereif Haykal
            RE: DKE + FSL pipeline has issue
            Hello Hunter,

            Thank you for taking the time to contribute to the discussion.

            I'm not very well-versed in the world of image orientations to be honest, and this is the first time I encounter such an issue, so please bear with me...


            So, using fslhd, the nifti file going in has the following orientation:

            qform_name Scanner Anat
            qform_code 1
            qto_xyz:1 -2.018740 -0.000000 0.044033 103.536331
            qto_xyz:2 -0.010218 1.965173 -0.459562 -75.819267
            qto_xyz:3 0.043266 0.464093 1.945987 -87.045891
            qto_xyz:4 0.000000 0.000000 0.000000 1.000000
            qform_xorient Right-to-Left
            qform_yorient Posterior-to-Anterior
            qform_zorient Inferior-to-Superior
            sform_name Scanner Anat
            sform_code 1
            sto_xyz:1 -2.018740 0.000000 0.044034 103.536331
            sto_xyz:2 -0.010218 1.965174 -0.459562 -75.819267
            sto_xyz:3 0.043267 0.464093 1.945987 -87.045891
            sto_xyz:4 0.000000 0.000000 0.000000 1.000000
            sform_xorient Right-to-Left
            sform_yorient Posterior-to-Anterior
            sform_zorient Inferior-to-Superior



            And checking the file header for the DKE fa output, first I got this message:


            ERROR: Inconsistent left-right order stored in sform and qform in file fa
            Using sform instead of qform values 



            Followed by the usual header info:


            qform_name Aligned Anat
            qform_code 2
            qto_xyz:1 1.000000 0.000000 -0.000000 -104.393929
            qto_xyz:2 0.000000 1.000000 -0.000000 -106.743248
            qto_xyz:3 0.000000 0.000000 -1.000000 -87.045891
            qto_xyz:4 0.000000 0.000000 0.000000 1.000000
            qform_xorient Left-to-Right
            qform_yorient Posterior-to-Anterior
            qform_zorient Superior-to-Inferior
            sform_name Aligned Anat
            sform_code 2
            sto_xyz:1 1.000000 0.000000 0.000000 -104.393929
            sto_xyz:2 0.000000 1.000000 0.000000 -106.743248
            sto_xyz:3 0.000000 0.000000 1.000000 -87.045891
            sto_xyz:4 0.000000 0.000000 0.000000 1.000000
            sform_xorient Left-to-Right
            sform_yorient Posterior-to-Anterior
            sform_zorient Inferior-to-Superior


            There seems to be some obvious changes in the image orientation, e.g from Right-to-Left  to Left-to-Right and "Scanner Anat" to "Aligned Anat" etc.

            Any idea why this is happening? Can it be rectified somehow? 

            Thanks again for the help!

            Cheers,
            Shereif

            • Aug 8, 2018  05:08 PM | Hunter Moss
              RE: DKE + FSL pipeline has issue
              Hi Shereif,

              Is this the nifti file you pulled the first qform/sform from the nifti following the eddy and TOPUP? Either way, it looks like there is a left-to-right flip and a different alignment present in the files afterwards. I am unsure at the moment how this would happen.

              -Hunter

              • Aug 8, 2018  10:08 PM | Shereif Haykal
                RE: DKE + FSL pipeline has issue
                Hi Hunter,

                Yes, the first fslhd output is from the eddy corrected and rearranged nifti file that I fed the DKE software (sorry if that wasn't clear!). And the second header is from the fa file produced by DKE.

                Hopefully now that the problem is clearer someone might be able to help. In any case, thanks for your time :)


                -Shereif

                • Aug 9, 2018  12:08 PM | Emilie McKinnon - MUSC
                  RE: DKE + FSL pipeline has issue
                  Hi Shereif,

                  Would it be possible to share both .nii files with us (before and after DKE)? I have an idea of what is going on, but would need to see the headers to confirm! 

                  Best, 
                  Emilie

                  • Aug 9, 2018  04:08 PM | Shereif Haykal
                    RE: DKE + FSL pipeline has issue
                    Hi Emilie,

                    I would be more than happy to share the files, but unfortunately I'm away from the office for the next few days. As soon as I'm back next week I'll share the before and after .nii files. 

                    Thanks for  your willingness to  help!

                    Best,
                    Shereif

                    Aug 13, 2018  11:08 AM | Shereif Haykal
                    RE: DKE + FSL pipeline has issue
                    Hello again,

                    I attached a zipped folder containing the diffusion data before using DKE and the resulting fa and kfa files. Let me know if you need anything else. And thanks again for the help!!

                    Best,
                    Shereif

                    EDIT: it seems the file is too big to upload directly on the forum, I keep getting an error after the uploading is done. Instead, I uploaded it to wetransfer, here's the link. Hope that's ok!

                    • Aug 13, 2018  12:08 PM | Emilie McKinnon - MUSC
                      RE: DKE + FSL pipeline has issue
                      Hi Shereif, 

                      While we look at this in some more detail, can you do me a favor and run DKE without interpolating the resulting parametric maps and see if that fixed the problem? If you are using the GUI the interpolation option is a checkbox on the second panel, or if you are using the command line just change "map_interpolation_method.flag= 1" to "map_interpolation_method.flag = 0" in your dkeparameters.dat file.  We would recommend to have this option turned off (even though by default it's turned on (oops)).

                      Thanks, 
                      Emilie

                      • Aug 13, 2018  02:08 PM | Shereif Haykal
                        RE: DKE + FSL pipeline has issue
                        Hi Emilie,

                        I ran DKE with interpolation off like you suggested and it worked!! I checked the headers of the output files and they show the same orientation as the input files, and I got no sform/qform errors as before. Thank you so much!! 

                        I attached the fa.nii file produced by DKE (with no interpolation), just in case you want to compare it to the files I uploaded earlier.

                        Thanks again!

                        Cheers,
                        Shereif
                        Attachment: fa.nii

                        • Aug 13, 2018  02:08 PM | Emilie McKinnon - MUSC
                          RE: DKE + FSL pipeline has issue
                          Happy that this fixed the problem! We will look into the header inconsistenties generated by the interpolation option. 

                          Don't hesitate to reach out if you have any more problems/questions.

                          Best,
                          Emilie

      Sep 16, 2018  08:09 AM | jing zhao
      RE: DKE + FSL pipeline has issue
      Hi,
      Recently i began to processing the DKI data by using DKE and FSL. 
      I met a problem, the TBSS anlysis need all the diffusion paramters after scalping. So I preanalysis the data by FSL (BET), then, put the data after scalping into DKE and DKE did not work. 
      How are you deal with this situation? would you please give your suggestion?
      Thanks!
      Jing 
      Hi,

      I have successfully used DKE on a Mac (10.10.5) to reconstruct DKE metrics. I would now like to take the estimates from the DKE and utilize my FSL TBSS pipeline to run statistical analyses. Here is what I'm doing.

      Data were converted from DICOM to NII using mcverter from University of Oregon

      (0) the data have a qform and sform of "Scanner Anat" 
      (1) taking native space DKI data set and running through FSL DTIFIT to get a FA map. 
      (2) use the native space FA map (I'll call it FA_FSL) to run TBSS with my two cohorts
      (3) use DKE on the native space DKI data set to calculate metrics (KFA, KMEAN etcetera). I have DKE resample to 1.5mm isotropic 
      (4) I now want to take the TBSS derived warps and apply them to the DKE data. 

      This doesn't work. It appears that the qform and sform are change by DKE to be in "Aligned Anat" with diagonal qto_xyz and sto_xyz matrices. 

      If I do a "Check Reg" in spm, the images show they are aligned.

      If I try to a FSL/flirt realignment without resampling/reslicing, specifying rigid body (dof = 6), they affine matrix is the identity matrix

      If, however, I try to do a flirt resampling/resclicing using the identity matrix, the resulting image is all skewed with respect to the original b=0 image.

      And of course, if I apply the warping, that is also messed up.

      Robert

  • Jun 13, 2018  04:06 PM | Michael De Biasio
    Error when running DKE: svd
    Hi,

    When running DKE, I get the following error:

    Start date and time: June 13, 2018 11:49:41
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Reading input images... complete
    Filtering input images... complete.
    {Error using svd
    Input to SVD must not contain NaN or Inf.

    Error in pinv (line 29)
    Error in dke_estimate (line 251)
    Error in dke (line 182)
    }
    MATLAB:svd:matrixWithNaNInf


    What is the meaning of SVD? What could cause an error like this?

    I am using input NIFTI Images with their associated gradient tables. The DKEParameters file used used is attached.

    Any help would be greatly appreciated!
    Attachment: DKEParameters.dat

    • Jun 13, 2018  04:06 PM | Hunter Moss
      RE: Error when running DKE: svd
      Hi Michael,

      SVD is singular value decomposition. Most likely there is NaN's within the volumes, possibly outside the brain, somewhere. You can check in MATLAB if this is the case and then just make all voxels where it is NaN = 0. 

      Hope this helps.

      -Hunter

      • Jun 14, 2018  12:06 PM | Michael De Biasio
        RE: Error when running DKE: svd
        Hi Henry,

        Thank you for your suggestion. However, I have checked the image files, and there are neither NaN or Inf values in the image volumes. Are there any other reasons why I could be getting this error?

        Thanks,

        Michael

        • Jun 15, 2018  06:06 PM | David Lewis - Medical University of South Carolina
          RE: Error when running DKE: svd
          Hi Michael,

          Do you have any 0 vectors in your gradient vector files? The vectors in your gradient vector files should correspond to nonzero b-values.

          The gradient vectors are normalized by the program after being read from file. If any of the lines in a gradient vector file are all 0 values, the calculations will produce NaN values in the matrix that is input to SVD.

          Hope this helps,
          Dave

          • Jun 15, 2018  07:06 PM | Michael De Biasio
            RE: Error when running DKE: svd
            Hi Dave,

            Thank you! I completely forgot about deleting b0's from the gradient table since I had needed them for all of my pre-processing steps. It's running smoothly now.

            Thanks,
            Michael

            • Jun 15, 2018  07:06 PM | David Lewis - Medical University of South Carolina
              RE: Error when running DKE: svd
              Great to hear that it's working now!

              Dave

  • May 24, 2018  03:05 AM | Yuanchao Zhang - University of Electronic Science and Technology of China
    some parts are missing for dke parameters
    Hi, experts,

    I tried to use dke to process my data from dicom files. I obtained the parameters images, for instance kfa.nii, however, I noticed that part of the images of the first several slices are missing, with half of the image having values  and other half completely background (namely zero). Why did this happen? Can I do analysis with data like this? See the attached fig file for the error.

    Thanks a lot!

    Best,

    Yuanchao
    Attachment: test.png

    • May 24, 2018  12:05 PM | Emilie McKinnon - MUSC
      RE: some parts are missing for dke parameters
      Hi Yuanchao,

      Please check your raw nifti files in the intermediate processing folder (combined). If they have the same artifact this is caused by registration. This is a common issue and only effects slices at the edge. You should be good to go and analyse your data ( just stay away from the boarder). 

      Hope this helps, 
      Emilie

  • May 11, 2018  07:05 PM | Michael De Biasio
    Pre-processing of NIFTI images of DKI Data
    Hi all,

    I have a number of DKI NIFTI images (.nii extension) that I will need to preprocess before using them in DKE. For pre-processing, I plan on using FSL functions eddy and topup to remove distortions, and then perform skull stripping on the dataset.

    One issue I have with my dataset is that I have numerous NIFTI volumes for b = 0 data. As such, I am having trouble determining a way to average all of these NIFTI images to get a single b = 0 NIFTI volume, of which I can use in the DKE software. I have heard about co-registration with SPM, but am confused by the procedure to get these images. Any clarification on the methodology and implementation of this procedure (or another averaging procedure) would be greatly appreciated.

    Another question I have is if there should be any additional pre-processing I should do prior to submitting my images to DKE (aside from that aforementioned above). The MRI scanner used was of higher resolution (4.7 T), so I am not sure how effective or useful an additional denoising procedure in my pre-processing pipeline will be, as the images are fairly clean as they are currently.

    Thanks in advance!

    • May 17, 2018  03:05 PM | Emilie McKinnon - MUSC
      RE: Pre-processing of NIFTI images of DKI Data
      Hi Michael, 

      Since you already seem familiar with fsl look into using FLIRT for coregistration. I am not positive but eddy might actually have motion correction build in. 
      Once your images are coregistered a simple averaging procedure using either matlab or FSL (FSL maths - Tmean) is sufficient before running DKE.  

      Other preprocessing steps you can look into is denoising and correction for gibbs artefacts using mrtrix. If you follow the preprocessing suggested here (http://mrtrix.readthedocs.io/en/0.3.16/w...) you will be in good shape! 

      Hope this helps, 
      Emilie

      • May 17, 2018  06:05 PM | Michael De Biasio
        RE: Pre-processing of NIFTI images of DKI Data
        Hi Emily,

        Ok great, thank you for your help! I will definitely check out those resources.

        Best,
        Michael

  • May 8, 2018  02:05 PM | Xinman Liu
    Neither Matlab nor dcm2niix can save my data...what should I do?
    Hello, everyone. As I'm still struggling with my patient data as I previously posted before. So I think I need to sum up a little bit about what I have done. There is something wrong with my data that I cannot run DKE successfully.
    One problem is that my sequence name did not contain"ep", so I use Matlab to change the sequence name. But it still doesn't work out. 
    So I turn to dcm2niix and generate my own bvec files, which is attached. And when I look at the file, I realized that there are altogether 5 ep_b0 files in between. So I make some adjustment in Matlab in order to realize the correspondence with it and then delete the rest 4 b0 files, And then I run DKE, the result was exactly like before, which reads,

    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: May 08, 2018 16:21:14
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... complete.
    Co-registering images...
    Error using spm_hist2
    Wrong number of dims (1).

    Error in spm_coreg>optfun (line 165)
    Error in spm_coreg (line 88)
    Error in spm_powell (line 27)
    Error in spm_coreg (line 143)
    Error in dke_preprocess_dicom>coregister (line 207)
    Error in dke_preprocess_dicom (line 78)
    Reading input images... Error using dke_estimate (line 165)
    Input NIfTI image F:\PN6\intermediate_processing\combined\rdki does not exist!
    Error in dke (line 182)

    and then I thought maybe i should extract bo series to another file so that I can put them into different columns in DKE, and then the result showed
    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: May 08, 2018 16:43:06
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... ***************************************************
    * The AcquisitionNumber counter does not appear *
    * to be changing from one volume to another. *
    * Another possible explanation is that the same *
    * DICOM slices are used multiple times. *
    * The conversion is having to guess how slices *
    * should be arranged into volumes. *
    * NCH_PROGLIO_001 / 9 / 1
    ***************************************************
    complete.
    Co-registering images...
    Error using spm_hist2
    Wrong number of dims (1).

    Error in spm_coreg>optfun (line 165)
    Error in spm_coreg (line 88)
    Error in spm_powell (line 27)
    Error in spm_coreg (line 143)
    Error in dke_preprocess_dicom>coregister (line 207)
    Error in dke_preprocess_dicom (line 78)
    Reading input images... Error using dke_estimate (line 165)
    Input NIfTI image F:\P7\intermediate_processing\combined\rdki does not exist!
    Error in dke (line 182)

    And then I thought maybe I should combine the two folder together and put it all in DKI series Column, and it reads exactly the same like before.
    I'm running out of methods...

    Best,
    Xinman
    Attachment: bvecnew.txt

  • Apr 27, 2018  12:04 PM | Xinman Liu
    After using Matlab to change DICOM sequence name, new problem appear while running DKE
    Hello, everyone. Sorry to post again because my problem is not solved yet.

    So at first the process of running DKE stopped because my SequenceName and the console window reads: Converting input DICOM images to NIfTI... Error using spm_dicom_convert_series_description>nii_name (line 1186)
    Invalid sequence name in DICOM header! Sequence name must contain 'ep'! And later I confirmed it with Matlab and it did show that my SequenceName contains no ' ep'

    Then I use following lines in Matlab to change the sequence name of my DICOM data sucessfully. 

    info=dicominfo('1.3.12.2.1107.5.2.32.35420.2018010410543453162206454');
    info.SequenceName = '*ep_b0';
    dbstop if error

    filenames = dir('*.dcm');
    for i = 1: size(filenames,1)
    X =dicomread(filenames(i).name);
    info = dicominfo(filenames(i).name);
    info.SequenceName = '*ep_b0';
    % fname= ['./result/',info.MediaStorageSOPInstanceUID, '.dcm'];
    fname= strcat('test',num2str(i), '.dcm');
    dicomwrite(X, fname ,info)
    end

    So after finishing changing the SequenceName, new problems appear, and it still doesn't work. The console window reads as following:
    % Fri Apr 27 01:54:55 PM
    studydir = 'F:\P8';
    subject_list = {''};
    preprocess_options.format = 'dicom';
    preprocess_options.navg = 1;
    preprocess_options.extra_b0 = 0;
    preprocess_options.coreg_flag = 1;
    preprocess_options.series_description = {'ep2d_diff_log2_iso20_free42_B1000_p2'};
    fn_img_prefix = 'rdki';
    bval = [0 1000 2000];
    ndir = 30;
    idx_1st_img = 1;
    Kmin = 0;
    NKmax = 3;
    Kmin_final = 0;
    Kmax_final = 3;
    T = 50;
    find_brain_mask_flag = 1;
    dki_method.no_tensor = 0;
    dki_method.linear_weighting = 1;
    dki_method.linear_constrained = 1;
    dki_method.nonlinear = 0;
    dki_method.linear_violations = 0;
    dki_method.robust_option = 0;
    dki_method.noise_tolerance = 0.09;
    dti_method.dti_flag = 0;
    dti_method.dti_only = 0;
    dti_method.no_tensor = 0;
    dti_method.linear_weighting = 1;
    dti_method.b_value = 1e+003;
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
    dti_method.robust_option = 0;
    dti_method.noise_tolerance = 0.09;
    fn_noise = '';
    fwhm_img = [3.375 3.375 3.375];
    fwhm_noise = [0 0 0];
    median_filter_method = 2;
    map_interpolation_method.flag = 0;
    map_interpolation_method.order = 1;
    map_interpolation_method.resolution = 1;
    fn_gradients = 'gradient_vectors_siemens30.dat';
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];

    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: April 27, 2018 13:55:07
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... ***************************************************
    * The AcquisitionNumber counter does not appear *
    * to be changing from one volume to another. *
    * Another possible explanation is that the same *
    * DICOM slices are used multiple times. *
    * The conversion is having to guess how slices *
    * should be arranged into volumes. *
    * NCH_PROGLIO_001 / 9 / 1
    ***************************************************
    complete.
    Co-registering images...
    Error using spm_hist2
    Wrong number of dims (1).
    Error in spm_coreg>optfun (line 165)
    Error in spm_coreg (line 88)
    Error in spm_powell (line 27)
    Error in spm_coreg (line 143)
    Error in dke_preprocess_dicom>coregister (line 207)
    Error in dke_preprocess_dicom (line 78)
    Reading input images... Error using dke_estimate (line 165)
    Input NIfTI image F:\P8\intermediate_processing\combined\rdki does not exist!
    Error in dke (line 182)

    Does anyone know what is going on? I'm in desperate need of some suggestions!! Thank you very much.

    Best regards,
    Xinman

    • Apr 27, 2018  12:04 PM | Emilie McKinnon - MUSC
      RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
      Hi Xinman,

      Use the sequence names from the other (working) dicoms you have to guide you. Only the b0 image has a sequence name ep_b0, the other images have a sequence name that is structured ep_b1000_#gradient , etc 

      Good luck, 
      Emilie

      • Apr 29, 2018  02:04 PM | Xinman Liu
        RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
        Hi, Emilie.
        You are right, I did make a mistake. So I revise the command as following, and it did work. The previous problem has been solved.
        % info=dicominfo('1.3.12.2.1107.5.2.32.35420.2018010410543453162206454');
        % info.SequenceName = '*ep_b0';
        dbstop if error

        filenames = dir('*.dcm');
        X =dicomread(filenames(1).name);
        info = dicominfo(filenames(1).name);
        info.SequenceName = '*ep_b0';
        fname= strcat('test',num2str(1), '.dcm');
        dicomwrite(X, fname ,info)
        for i = 2: size(filenames,1)
        X =dicomread(filenames(i).name);
        info = dicominfo(filenames(i).name);
        info.SequenceName = strcat('*ep_b1000#',num2str(i-1));
        % fname= ['./result/',info.MediaStorageSOPInstanceUID, '.dcm'];
        fname= strcat('test',num2str(i), '.dcm');
        dicomwrite(X, fname ,info)
        end

        but then there's only one problem remaining, which is
         command line: dke DKEParameters.dat
        Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
        Start date and time: April 29, 2018 16:38:36
        Diffusional Kurtosis Estimator (DKE) version 2.6.0
        Converting input DICOM images to NIfTI... complete.
        Co-registering images...
        Error using spm_hist2
        Wrong number of dims (1).

        Error in spm_coreg>optfun (line 165)
        Error in spm_coreg (line 88)
        Error in spm_powell (line 27)
        Error in spm_coreg (line 143)
        Error in dke_preprocess_dicom>coregister (line 207)
        Error in dke_preprocess_dicom (line 78)
        Reading input images... Error using dke_estimate (line 165)
        Input NIfTI image F:\P10\intermediate_processing\combined\rdki does not exist!
        Error in dke (line 182)

        [color=#000000]So I think this is the only problem that is left. Do you have any clues about it?[/color]
        [color=#000000]Best regards,[/color]
        [color=#000000]Xinman
        [/color]

        • May 2, 2018  03:05 PM | David Lewis - Medical University of South Carolina
          RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
          Hi Xinman,

          I believe I can help. I looked over the code from your previous email. In the test DICOM images that are written, SequenceName is either '*ep_b0' (for the first image) or '*ep_b1000#' (where = 1, 2, 3, ...).

          What about images at a different b-value? In images with b=2000 (for example), SequenceName should include 'b2000' rather than 'b1000'.

          Best,
          Dave

          • May 2, 2018  03:05 PM | David Lewis - Medical University of South Carolina
            RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
            Hi,

            Sorry, some of what I wrote didn't come out right in the forum post. I mean that the test images have SequenceName = '*ep_b0', '*ep_b1000#1', '*ep_b1000#2', '*ep_b1000#3', etc. There should be images with another b value.

            Dave

            • May 3, 2018  01:05 PM | Xinman Liu
              RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
              Hi, David.
              You are totally right!!! So I think I should go over all the DICOM data all over again. Thank you for your Suggestion!!!
              Best regards,
              Xinman

              • May 3, 2018  01:05 PM | David Lewis - Medical University of South Carolina
                RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
                Hi Xinman,

                Glad that I could help!

                Best,
                Dave

              May 3, 2018  01:05 PM | Xinman Liu
              RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
              Hi,
              But there is one more Problem, the sequence Name of  every single DCM from the false Patient data was set to be 'js_b0', how would I know when it changes to b2000? I mean, in the previous data where DKE perfectly works, I can always use Matlab to check where B2000 Begins or where it b value Begins to change, but there are only 67 DCM in this Folder, but then there are altogether 85 DCM in the data that did not work.  I actually don't know how can I mirror it to the second one...
              Best,
              Xinman

              • May 3, 2018  09:05 PM | David Lewis - Medical University of South Carolina
                RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
                Hi Xinman,

                I hope that I can help. If I understand correctly, there were 85 images in the data from the scanner. When you created the test images, there should also be 85 images (test1.dcm, test2.dcm, ..., test85.dcm). The code in your Apr 29 post should create one test image for every image from the scanner, so I don't know why you have 67 images in a folder.

                You could create new test images from the original 85 images. You know what the b-values are for those images. Try to change the SequenceName values in the new test images to contain 'ep'. You can compare the SequenceName values in the test images to those in the original images to make sure they have the same b-values.

                Or you can use other software to convert your DICOM files to NIfTI format, as Kirk recommended.

                Best,
                Dave

                • May 4, 2018  12:05 PM | Xinman Liu
                  RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
                  Hi, Dave.
                  I think I did not describe it clearly. So now I have data from two different volunteers. The first one is a healthy volunteer, and there is only 61 DCM (sorry, not 67, my mistake) in one Folder. And I can run DKE perfectly with this data. And then I have data from the Patient which is in the second folder. And it contains altogether 85 DCM. And the Sequence Name is wrong. And that's why I Need to use Matlab to Change the Name. As Emilie recomended above, I use the data of the healthy volunteer as reference to Change the Name like, ep_b0, ep_b1000# and ep_b2000#, and I used the following lines in Matlab.
                  % info=dicominfo('1.3.12.2.1107.5.2.32.35420.2018010410543453162206454');
                  % info.SequenceName = '*ep_b0';
                  dbstop if error
                  filenames = dir('*.dcm');
                  X =dicomread(filenames(1).name);
                  info = dicominfo(filenames(1).name);
                  info.SequenceName = '*ep_b0';
                  fname= strcat('test',num2str(1), '.dcm');
                  dicomwrite(X, fname ,info)
                  for i = 2: size(filenames,1)
                  X =dicomread(filenames(i).name);
                  info = dicominfo(filenames(i).name);
                  info.SequenceName = strcat('*ep_b1000#',num2str(i-1));
                  fname= strcat('test',num2str(i), '.dcm');
                  dicomwrite(X, fname ,info)
                  end

                  for  j = 43: size(filenames,1)
                  X =dicomread(filenames(j).name);
                  info = dicominfo(filenames(j).name);
                  info.SequenceName = strcat('*ep_b2000#',num2str(j-42));
                  %     fname= ['./result/',info.MediaStorageSOPInstanceUID, '.dcm']
                  fname= strcat('test',num2str(j), '.dcm');
                  dicomwrite(X, fname ,info)
                  end

                  So I did have 85 DCM where all the SequenceName are already changed. The reason why I divided the DCM in half was because in the healthy volunteer's data ''ep_b2000' starts at 31st DCM. And then I assumed that in this 85-patient data it may start at 43rdDCM. But after I run it with the changed data, it still reads in the command window,
                  Error in spm_coreg>optfun (line 165)
                  Error in spm_coreg (line 88)
                  Error in spm_powell (line 27)
                  Error in spm_coreg (line 143)
                  Error in dke_preprocess_dicom>coregister (line 207)
                  Error in dke_preprocess_dicom (line 78)
                  Reading input images... Error using dke_estimate (line 165)
                  Input NIfTI image F:\P10\intermediate_processing\combined\rdki does not exist!
                  Error in dke (line 182)

                  [color=#ff0000]So I think either my assumption is wrong that 'ep-b2000#' did not start at 43rd DCM or there may be other Problems except the SequenceName of the data. Do you have any clues about when the 'ep-b2000#' starts? By the way, I also try to Change 43rd to 31st, and it doesn't work either.[/color]

                  [color=#ff0000]Best,[/color]
                  [color=#ff0000]Xinman
                  [/color]

                  • May 4, 2018  12:05 PM | Emilie McKinnon - MUSC
                    RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
                    Hi Xinman, 

                    Are there any images in the intermediate processing folder that should be created by DKE? 

                    Emilie

                    • May 5, 2018  01:05 PM | Xinman Liu
                      RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
                      Hi, Emilie,
                      So I check both folders. The folder with which I can run DKE successfully contains 3 folders, named "combined", "dki_avg_coreg" and "dki_avg_nii" persepctively. And each folder contains NII files like rdki_0.nii, rdki_1000_1-30.nii and rdki_2000_1-30.nii, and in dki_avg1_nii contains one more named meandki_0.nii
                      While in the folder that fails to run DKE, in the intermediate_processing folder there is only one folder named "dki_avg1_nii", and then it also contains rdki_0.nii, rdki_1000_1-42.nii and rdki_2000_1-42.nii, without meandki_0.nii
                      Do you know what's wrong with that? Looking forward to your reply. 
                      Best regards,
                      Xinman

      Apr 27, 2018  01:04 PM | Kirk Feindel - University of Western Australia
      RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
      The most direct solution is to abandon using DKE to convert your DICOMs.  Just do it using dcm2niix and generate your own bvecs, or try using MRtrix to convert everything:  http://www.mrtrix.org/, or DSI Studio.

      DKE is not commercial software and random user-end changes (like file naming) can lead to errors.  

      Slow down, step back, and think carefully about your acquired data and what DKE can accept as input data.  The more you understand the fundamentals, the quicker you'll achieve results!

      • Apr 29, 2018  03:04 PM | Xinman Liu
        RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
        Hi, Kirk. 
        Thank you for your suggestion and encouragement.
        I used dcm2nii to generate bvec file before. But it doesn't work. And that's why I begin to doubt what's exactly wrong about my data. Then I used the data that I changed using Matlab based on bvec files, and the results are the same. So I think I have only one problem left which I stated a minute ago. But I will try your suggestion too and see how it goes. It's just that I don't have enough background knowledge of these softwares. It takes really long for me to understand what exactly that means.
        Best regards,
        Xinman

  • Apr 26, 2018  09:04 AM | Xinman Liu
    why the console window still reads "Sequence name must contain 'ep'"even though my data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2?
    Hello, everyone.
    I wonder if anyone come across the same kind of problems. My data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2. But when I begin to run DKE with the data, the console window reads as followings, 
    % Thu Apr 26 10:53:05 AM
    studydir = 'F:\P5';
    subject_list = {''};
    preprocess_options.format = 'dicom';
    preprocess_options.navg = 1;
    preprocess_options.extra_b0 = 0;
    preprocess_options.coreg_flag = 1;
    preprocess_options.series_description = {'ep2d_diff_log2_iso20_free42_B1000_p2'};
    fn_img_prefix = 'rdki';
    bval = [0 1000 2000];
    ndir = 85;
    idx_1st_img = 1;
    Kmin = 0;
    NKmax = 3;
    Kmin_final = 0;
    Kmax_final = 3;
    T = 50;
    find_brain_mask_flag = 1;
    dki_method.no_tensor = 0;
    dki_method.linear_weighting = 1;
    dki_method.linear_constrained = 1;
    dki_method.nonlinear = 0;
    dki_method.linear_violations = 0;
    dki_method.robust_option = 0;
    dki_method.noise_tolerance = 0.09;
    dti_method.dti_flag = 0;
    dti_method.dti_only = 0;
    dti_method.no_tensor = 0;
    dti_method.linear_weighting = 1;
    dti_method.b_value = 1e+003;
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85];
    dti_method.robust_option = 0;
    dti_method.noise_tolerance = 0.09;
    fn_noise = '';
    fwhm_img = [3.375 3.375 3.375];
    fwhm_noise = [0 0 0];
    median_filter_method = 2;
    map_interpolation_method.flag = 0;
    map_interpolation_method.order = 1;
    map_interpolation_method.resolution = 1;
    fn_gradients = 'F:/Patient1/bvecnew.txt';
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85];

    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: April 26, 2018 10:53:18
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... Error using spm_dicom_convert_series_description>nii_name (line 1186)
    Invalid sequence name in DICOM header! Sequence name must contain 'ep'!
    And my data is consist of altogether 86 DICOMs.
    Anyone knows what is exactly wrong with the data? Or is it a bug of DKE software?
    Could anyone please give me some suggestions? Thank you very much.
    P.S the picture attached is how the whole process looks like on my computer.


    Best regards,
    Xinman


    Attachment: ep exist.jpg

    • Apr 26, 2018  11:04 AM | Emilie McKinnon - MUSC
      RE: why the console window still reads "Sequence name must contain 'ep'"even though my data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2?
      Hi Xibman,

      There is a difference between series description ( which obviously contains ep like you stated ) and sequence name. Can you use a dicom reader to check what is stored in the header field sequence name? This might help us get to the bottem of this. My gut feeling says you probably have an automatically generated fa map or ADC map in your series.

      Thanks,
      Emilie

      • Apr 26, 2018  01:04 PM | Xinman Liu
        RE: why the console window still reads "Sequence name must contain 'ep'"even though my data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2?
        Hello, Emilie, Thank you for your quick reply.  I'm somewhat desperate.
        So I use Matlab to get the details, and I input info=dicominfo('filename');to get the results, and it reads as followings
        Filename: 'F:\P6\1.3.12.2.1107.5.2.32.35420.2018010410543453162206454.dcm'
        FileModDate: '04-1月-2018 11:40:12'
        FileSize: 2210748
        Format: 'DICOM'
        FormatVersion: 3
        Width: 1024
        Height: 1024
        BitDepth: 12
        ColorType: 'grayscale'
        FileMetaInformationGroupLength: 178
        FileMetaInformationVersion: [2×1 uint8]
        MediaStorageSOPClassUID: '1.2.840.10008.5.1.4.1.1.4'
        MediaStorageSOPInstanceUID: '1.3.12.2.1107.5.2.32.35420.2018010410543453162206454'
        TransferSyntaxUID: '1.2.840.10008.1.2.1'
        ImplementationClassUID: '1.3.12.2.1107.5.2'
        ImplementationVersionName: 'MR_VB17A'
        SpecificCharacterSet: 'ISO_IR 100'
        ImageType: 'ORIGINAL\PRIMARY\DIFFUSION\NONE\ND\NORM\MOSAIC'
        InstanceCreationDate: '20180104'
        InstanceCreationTime: '105434.953000'
        SOPClassUID: '1.2.840.10008.5.1.4.1.1.4'
        SOPInstanceUID: '1.3.12.2.1107.5.2.32.35420.2018010410543453162206454'
        StudyDate: '20180104'
        SeriesDate: '20180104'
        AcquisitionDate: '20180104'
        ContentDate: '20180104'
        StudyTime: '100554.031000'
        SeriesTime: '105434.937000'
        AcquisitionTime: '105429.440000'
        ContentTime: '105434.953000'
        AccessionNumber: ''
        Modality: 'MR'
        Manufacturer: 'SIEMENS'

        ReferringPhysicianName: [1×1 struct]
        StationName: 'MEDPC'
        StudyDescription: 'NCH^Study'
        SeriesDescription: 'ep2d_diff_log2_iso20_free42_B1000_p2'
        InstitutionalDepartmentName: 'Department'
        PerformingPhysicianName: [1×1 struct]
        OperatorName: [1×1 struct]
        ManufacturerModelName: 'TrioTim'
        ReferencedImageSequence: [1×1 struct]
        PatientName: [1×1 struct]
        PatientID: 'NCH_PROGLIO_001'
        PatientBirthDate: '19720101'
        PatientSex: 'M'
        PatientAge: '046Y'
        PatientSize: 1.8600
        PatientWeight: 85
        ScanningSequence: 'EP'
        SequenceVariant: 'SK\SP'
        ScanOptions: 'PFP\FS'
        MRAcquisitionType: '2D'
        SequenceName: 'js_b0'
        AngioFlag: 'N'
        SliceThickness: 2
        RepetitionTime: 8700
        EchoTime: 104
        NumberOfAverages: 1
        ImagingFrequency: 123.2122
        ImagedNucleus: '1H'
        EchoNumber: 1
        MagneticFieldStrength: 3
        SpacingBetweenSlices: 2.0000
        NumberOfPhaseEncodingSteps: 102
        EchoTrainLength: 1
        PercentSampling: 100
        PercentPhaseFieldOfView: 100
        PixelBandwidth: 1502
        DeviceSerialNumber: '35420'
        SoftwareVersion: 'syngo MR B17'
        ProtocolName: 'ep2d_diff_log2_iso20_free42_B1000_p2'
        TransmitCoilName: 'Body'
        AcquisitionMatrix: [4×1 uint16]
        InPlanePhaseEncodingDirection: 'COL'
        FlipAngle: 90
        VariableFlipAngleFlag: 'N'
        SAR: 0.2206
        dBdt: 0
        PatientPosition: 'HFS'
        Private_0019_10xx_Creator: 'SIEMENS MR HEADER'
        Private_0019_1008: 'IMAGE NUM 4'
        Private_0019_1009: '1.0'
        Private_0019_100a: 60
        Private_0019_100b: 37.5000
        Private_0019_100c: 0
        Private_0019_100d: 'DIRECTIONAL'
        Private_0019_100f: 'Fast'
        Private_0019_1011: 'No'
        Private_0019_1012: [3×1 int32]
        Private_0019_1013: [3×1 int32]
        Private_0019_1014: [3×1 double]
        Private_0019_1015: [3×1 double]
        Private_0019_1016: 4.3675
        Private_0019_1017: 1
        Private_0019_1018: 2600
        Private_0019_1028: 20.8330
        Private_0019_1029: [60×1 double]
        StudyInstanceUID: '1.3.12.2.1107.5.2.32.35420.30000018010409051256200000005'
        SeriesInstanceUID: '1.3.12.2.1107.5.2.32.35420.2018010410535497958406125.0.0.0'
        StudyID: '1'
        SeriesNumber: 9
        AcquisitionNumber: 1
        InstanceNumber: 1
        ImagePositionPatient: [3×1 double]
        ImageOrientationPatient: [6×1 double]
        FrameOfReferenceUID: '1.3.12.2.1107.5.2.32.35420.1.20180104101902734.0.0.0'
        PositionReferenceIndicator: ''
        SliceLocation: -42.0469
        SamplesPerPixel: 1
        PhotometricInterpretation: 'MONOCHROME2'
        Rows: 1024
        Columns: 1024
        PixelSpacing: [2×1 double]
        BitsAllocated: 16
        BitsStored: 12
        HighBit: 11
        PixelRepresentation: 0
        SmallestImagePixelValue: 0
        LargestImagePixelValue: 4074
        WindowCenter: 524
        WindowWidth: 1143
        WindowCenterWidthExplanation: 'Algo1'
        Private_0029_10xx_Creator: 'SIEMENS CSA HEADER'
        Private_0029_11xx_Creator: 'SIEMENS MEDCOM HEADER2'
        Private_0029_1008: 'IMAGE NUM 4'
        Private_0029_1009: '20180104'
        Private_0029_1010: [11940×1 uint8]
        Private_0029_1018: 'MR'
        Private_0029_1019: '20180104'
        Private_0029_1020: [92828×1 uint8]
        Private_0029_1160: 'com'
        RequestedProcedureDescription: 'NCH Study'
        PerformedProcedureStepStartDate: '20180104'
        PerformedProcedureStepStartTime: '100554.093000'
        PerformedProcedureStepID: 'MR20180104100554'
        PerformedProcedureStepDescription: 'NCH^Study'
        Private_0051_10xx_Creator: 'SIEMENS MR HEADER'
        Private_0051_1008: 'IMAGE NUM 4'
        Private_0051_1009: '1.0'
        Private_0051_100a: 'TA 00.03'
        Private_0051_100b: '128p*128'
        Private_0051_100c: 'FoV 2048*2048'
        Private_0051_100e: 'Tra>Cor(1.9)>Sag(0.6)'
        Private_0051_100f: 'T:HEA;HEP'
        Private_0051_1011: 'p2'
        Private_0051_1012: 'TP 0'
        Private_0051_1013: '+LPH'
        Private_0051_1016: 'p2 DIFFUSION/NONE/ND/NORM'
        Private_0051_1017: 'SL 2.0'
        Private_0051_1019: 'A1/PFP/FS'
        StorageMediaFileSetUID: '1.3.12.2.1107.5.2.32.35420.30010018010409384693700000001'
        IconImageSequence: [1×1 struct]

        So I have to say, I'm not sure about what exactly header field sequence is. If the information above did not help, could you please tell me in what way can I get the name of it? I use RadiAnt as DICOM reader. And I search a little bit but didn't get much hope about how can I get the name of header field sequence.

        Best regards,
        Xinman

        • Apr 26, 2018  02:04 PM | Emilie McKinnon - MUSC
          RE: why the console window still reads "Sequence name must contain 'ep'"even though my data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2?
          Hi Xinman, 

          Your sequence name is : SequenceName: 'js_b0'. See how this does not include "ep", this is what is causing the error. I see you have a timtrio, who created that sequence?  Compare this dicom info with one of the other data sets that you have and where DKE runs just fine. 

          Hope this helps, 
          Emilie

          • Apr 27, 2018  05:04 AM | Xinman Liu
            RE: why the console window still reads "Sequence name must contain 'ep'"even though my data is based on EPI sequence and the file name is ep2d_diff_log2_iso20_free42_B1000_p2?
            Hello, Emilie. 
            You are right. So I check the previous data, with which I successfully run DKE. And the sequence name is SequenceName: '*ep_b0'.
            Actually the technician of our hospital create the sequence, but I don't know exactly who. But has timtrio anything to do with the problem? 
            And do I need to rescan the patient? Or are there any ways that I can change the sequence name so that I can use the data?
            Could you please give me some suggestions?
            Best regards,
            Xinman

  • Apr 9, 2018  11:04 AM | Xinman Liu
    problems processing DKI image data using DKE
    Hello, everyone,

    I have successfully use DKE to process Patient data before, but when I applied the same method to another Patient. It just don't work. And it read as followings,

    Start date and time: April 09, 2018 13:44:43
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... {Error using spm_dicom_convert_series_description>nii_name (line 1186)
    Invalid sequence name in DICOM header! Sequence name must contain 'ep'!

    Error in spm_dicom_convert_series_description>getfilelocation (line 1064)
    Error in spm_dicom_convert_series_description>convert_mosaic (line 77)
    Error in spm_dicom_convert_series_description (line 52)
    Error in dke_preprocess_dicom>dcm2nii (line 185)
    Error in dke_preprocess_dicom (line 60)
    }
    Reading input images... {Error using dke_estimate (line 165)
    Input NIfTI image F:\V1\intermediate_processing\combined\rdki does not exist!

    Normally, according to what I get from the last Patient, the document named combined is created automatically. But in this case, it just can't. And when I try to creat the Folder mannually, the result is still the same.
    What should I do with it, Could anyone please help? Thank you.

    Best regards.
    Xinman

    • Apr 14, 2018  11:04 PM | David Lewis - Medical University of South Carolina
      RE: problems processing DKI image data using DKE
      Hi Xinman,

      According to the first error message, the Sequence Name in the DICOM header does not contain 'ep'. Do you know the name of the pulse sequence that was used to obtain the DICOM images? Was it an EPI pulse sequence?

      Normally the "combined" folder gets created during the DICOM-to-NIfTI conversion. However, that conversion was stopped because of the first error (the sequence name doesn't contain 'ep'). Since the conversion was stopped, the "combined" folder didn't get created, and no "rdki" file got created, leading to the second error message.

      Best,
      Dave

      • Apr 24, 2018  05:04 AM | Xinman Liu
        RE: problems processing DKI image data using DKE
        Hallo, Dave.
        It was an EPI pulse sequence. And I wonder what does it have anything to do with the Problem.
        Actually I tried another way though it still doésn't work.
        So I choose User-Defined and then imput Bvec files. and then I Load all DICOMS in a Directory. After a few minutes, the command window still reads the same.
        Could you please give me some suggestions? P.S the documents attached is Bvec file
        Best,
        Xinman
        Attachment: bvecnew.txt

  • Apr 12, 2018  12:04 PM | Xinman Liu
    Reading input images... Error using dke_estimate
    Hello, everyone.

    I have select a new series of patient data and try to run DKE with it. But it can't. I cannot figure out what exactly is the problem. Is there something wrong with my new DICOM data? Could anyone please help me?  The window read as following:
    % Thu Apr 12 02:36:21 PM
    studydir = 'F:\V1';
    subject_list = {''};
    preprocess_options.format = 'dicom';
    preprocess_options.navg = 1;
    preprocess_options.extra_b0 = 0;
    preprocess_options.coreg_flag = 1;
    preprocess_options.series_description = {'ep2d_diff_log2_iso20_free42_B1000_p2'};
    fn_img_prefix = 'rdki';
    bval = [0 1000 2000];
    ndir = 30;
    idx_1st_img = 1;
    Kmin = 0;
    NKmax = 3;
    Kmin_final = 0;
    Kmax_final = 3;
    T = 50;
    find_brain_mask_flag = 1;
    dki_method.no_tensor = 0;
    dki_method.linear_weighting = 1;
    dki_method.linear_constrained = 1;
    dki_method.nonlinear = 0;
    dki_method.linear_violations = 0;
    dki_method.robust_option = 0;
    dki_method.noise_tolerance = 0.09;
    dti_method.dti_flag = 0;
    dti_method.dti_only = 0;
    dti_method.no_tensor = 0;
    dti_method.linear_weighting = 1;
    dti_method.b_value = 1e+003;
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
    dti_method.robust_option = 0;
    dti_method.noise_tolerance = 0.09;
    fn_noise = '';
    fwhm_img = [3.375 3.375 3.375];
    fwhm_noise = [0 0 0];
    median_filter_method = 2;
    map_interpolation_method.flag = 0;
    map_interpolation_method.order = 1;
    map_interpolation_method.resolution = 1;
    fn_gradients = 'gradient_vectors_siemens30.dat';
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];

    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: April 12, 2018 14:36:46
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Converting input DICOM images to NIfTI... Error using spm_dicom_convert_series_description>nii_name (line 1186)
    Invalid sequence name in DICOM header! Sequence name must contain 'ep'!
    Error in spm_dicom_convert_series_description>getfilelocation (line 1064)
    Error in spm_dicom_convert_series_description>convert_mosaic (line 77)
    Error in spm_dicom_convert_series_description (line 52)
    Error in dke_preprocess_dicom>dcm2nii (line 185)
    Error in dke_preprocess_dicom (line 60)
    Reading input images... Error using dke_estimate (line 165)
    Input NIfTI image F:\V1\intermediate_processing\combined\rdki does not exist!
    Error in dke (line 182)

    Best regards,
    Xinman

  • Jan 18, 2018  09:01 AM | Xinman Liu
    Does anyone have problems performing Fiber Tracking after successfully processing DKE?
    Hi, everyone.
    So I have successfully processing DKE, and when I turn to Fiber Tracking module, the command window popped up but it lasted only like 5 minutes no matter whatever command I type in. And my Matlab version is R2017b, but according to the user guide, I still download the Matlab complier runtime R2012a. Does that have anything to do with this weird phenomenon? Could anyone help, please?

    • Jan 18, 2018  02:01 PM | Corinne McGill - MUSC
      RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
      Hello Xinman,

      Are you following the instructions in the attached PDF? The Fiber Tracking module must be run through the command line. There is no GUI.

      Thank you for using DKE!
      Corinne McGill

      Jan 18, 2018  04:01 PM | Hunter Moss
      RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
      Hi Xinman,

      In Matlab you can use this kind of command to run the FT.

      % FT with DKE
      call_dke_ft = sprintf('%s/run_dke_ft.sh %s %s',file_paths.dkePath,file_paths.mcrPath,ft_params_new_fn);
      system(call_dke_ft);

      You will need to give it the path to DKE, the MCR compiler, and the path to the FT parameters file.

      Hope this helps.

      -Hunter

      Feb 5, 2018  10:02 AM | Xinman Liu
      RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
      Thank you for your reply. Unfortunately, both of your method did not work.

      And the command window showed:
      C:\Users\Administrator>F:\6dcm\dke_ft.exe F:\6dcm\ft_parameters.txt
      Starting matlabpool using the 'local' profile ... connected to 2 labs.

      Start date and time: February 05, 2018 11:34:21
      Fiber Tractography with DKI version 1
      July 2015
      Optimizing kurtosis dODF...Error using dke_ft (line 132)
      The number of voxels in the FA image and the tensors must match!
      Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
      the fa image from the DT.mat using the Nifti header from the diffusion weighted
      images

      Could you please give me some advice about what should I do about it?

      • Feb 5, 2018  03:02 PM | Corinne McGill - MUSC
        RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
        Hi Xinman,

        You will need to run DKE again with interpolation off. Then your FA and tensor dimensions will match, and you can run the Fiber Tracking module.

        Hope this helps!
        Corinne

        • Feb 7, 2018  10:02 AM | Xinman Liu
          RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
          Hi,Cornne,
           
          do you mean that I should set odf_optimization=0, and tractography=0 in ft_parameters? Because it worked finally and showed:Optimization complete...
          so every time I want to run Fiber Tracking, does that mean I always have to run it twice in order to get DKE Parameters in the same time?
           
          Best regards,
          Xinman

          • Feb 12, 2018  04:02 PM | Corinne McGill - MUSC
            RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
            Hi Xinman,

            Can you clarify the following statement:
            "does that mean I always have to run it twice in order to get DKE Parameters in the same time?"

            When I said run dke with interpolation off, I meant that you should set map_interpolation_method.flag = 0; in your dke_parameters text file.

            Thanks,
            Corinne

            • Apr 9, 2018  08:04 AM | Xinman Liu
              RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
              Hi Corinne,
              I have already set the map_interpolation_method.flag = 0 in my dke_parameters text file. Then I run the DKE again. The DKE processes successfully, but when I turn to Fibertracking,

              the result is still the same, in the Command window it is written:
              Optimizing kurtosis dODF...Error using dke_ft (line 132)
              The number of voxels in the FA image and the tensors must match!
              Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
              the fa image from the DT.mat using the Nifti header from the diffusion weighted
              images

              What should I do with it? Should I do it like what the command line says''reconstruct
              the fa image from the DT.mat using the Nifti header from the diffusion weighted
              images''? But then how can I achieve it? Are there any procedure protocol?

              • Apr 9, 2018  02:04 PM | Corinne McGill - MUSC
                RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
                Hi Xinman,

                Run DKE one time only with the following setting: "map_interpolation_method.flag = 0". 

                Then run the fiber tracking module with the following settings: "odf_optimization=1" and "tractography=1".

                Attached is the DKE Tractography User's Guide. 
                For more information, please visit http://academicdepartments.musc.edu/cbi/dki/dke.html.

                Best,
                Corinne

                Originally posted by Xinman Liu:
                Hi Corinne,
                I have already set the map_interpolation_method.flag = 0 in my dke_parameters text file. Then I run the DKE again. The DKE processes successfully, but when I turn to Fibertracking,

                the result is still the same, in the Command window it is written:
                Optimizing kurtosis dODF...Error using dke_ft (line 132)
                The number of voxels in the FA image and the tensors must match!
                Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
                the fa image from the DT.mat using the Nifti header from the diffusion weighted
                images

                What should I do with it? Should I do it like what the command line says''reconstruct
                the fa image from the DT.mat using the Nifti header from the diffusion weighted
                images''? But then how can I achieve it? Are there any procedure protocol?

                • Apr 10, 2018  05:04 AM | Xinman Liu
                  RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
                  Hi, Corinne,

                  I am sorry to disturb again. 

                  I realized why it still read "Make sure map_interpolation_method.flag = 0 for tensor fitting " after I have already set map_interpolation method. flag=0.

                  The reason is, even though I turn the interpolation off in DKEparameters.dat, it still show in the Terminal that map_interpolation_method.flag = 0. And that's the problem. But how am I supposed to do that when I cannot actually turn it off?

                  % Tue Apr 10 07:16:34 AM
                  studydir = 'F:\A3';
                  subject_list = {''};
                  preprocess_options.format = 'dicom';
                  preprocess_options.navg = 1;
                  preprocess_options.extra_b0 = 0;
                  preprocess_options.coreg_flag = 1;
                  preprocess_options.series_description = {'ep2d_diff_12CH_STD_30_2x2x2_256FOV_b1000_dist0_AP'};
                  fn_img_prefix = 'rdki';
                  bval = [0 1000 2000];
                  ndir = 30;
                  idx_1st_img = 1;
                  Kmin = 0;
                  NKmax = 3;
                  Kmin_final = 0;
                  Kmax_final = 3;
                  T = 50;
                  find_brain_mask_flag = 1;
                  dki_method.no_tensor = 0;
                  dki_method.linear_weighting = 1;
                  dki_method.linear_constrained = 1;
                  dki_method.nonlinear = 0;
                  dki_method.linear_violations = 0;
                  dki_method.robust_option = 0;
                  dki_method.noise_tolerance = 0.09;
                  dti_method.dti_flag = 0;
                  dti_method.dti_only = 0;
                  dti_method.no_tensor = 0;
                  dti_method.linear_weighting = 1;
                  dti_method.b_value = 1e+003;
                  dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
                  dti_method.robust_option = 0;
                  dti_method.noise_tolerance = 0.09;
                  fn_noise = '';
                  fwhm_img = [3.375 3.375 3.375];
                  fwhm_noise = [0 0 0];
                  median_filter_method = 2;
                  map_interpolation_method.flag = 1;
                  map_interpolation_method.order = 1;
                  map_interpolation_method.resolution = 1;
                  fn_gradients = 'gradient_vectors_siemens30.dat';
                  idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
                  idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];

                  command line: dke DKEParameters.dat
                  Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
                  Start date and time: April 10, 2018 07:17:25
                  Diffusional Kurtosis Estimator (DKE) version 2.6.0
                  Converting input DICOM images to NIfTI... complete.
                  Co-registering images...
                  iteration 1...
                  0 0 0 0 0 0 | -1.1333
                  0 0 0 0 0 0 | -1.1333
                  0 0 -0.001533 0 0 0 | -1.1333
                  0 0 -0.001533 -2.227e-06 0 0 | -1.1333
                  0 0 -0.001533 -2.227e-06 0 0 | -1.1333
                  0 0 -0.001533 -2.227e-06 0 -1.184e-06 | -1.1333
                  iteration 1...
                  0 0 -0.001533 -2.227e-06 0 -1.184e-06 | -1.133
                  0 0 -0.001533 -2.227e-06 0 -1.184e-06 | -1.133
                  0 0 -0.001163 -2.227e-06 0 -1.184e-06 | -1.133
                  0 0 -0.001163 -4.901e-05 0 -1.184e-06 | -1.133
                  0 0 -0.001163 -4.901e-05 0 -1.184e-06 | -1.133
                  0 0 -0.001163 -4.901e-05 0 -4.085e-05 | -1.133
                  Co-registration complete.
                  Averaging images... complete.
                  Reading input images... complete
                  Filtering input images... complete.
                  Processing voxels... 100% complete.
                  Writing output images to files...
                  Writing and interpolating F:\A3\kmean.nii
                  Writing and interpolating F:\A3\dmean.nii
                  Writing and interpolating F:\A3\kax.nii
                  Writing and interpolating F:\A3\krad.nii
                  Writing and interpolating F:\A3\dax.nii
                  Writing and interpolating F:\A3\drad.nii
                  Writing and interpolating F:\A3\fa.nii
                  Writing and interpolating F:\A3\kfa.nii
                  Writing and interpolating F:\A3\mkt.nii
                  Writing F:\A3\KT.mat
                  Writing F:\A3\DT.mat
                  Complete
                  Diffusional kurtosis maps are in folder F:\A3
                  DKE processing parameters file is F:\A3\DKEParameters.dat
                  DKE log file is F:\A3\dke.log

                  So could you please tell me how can I deal with this? Und in the User's Guide, there is no details about how to deal with this...

                  And there is another problem, which is DKEparameters.dat will be created only when I run DKE first, then the document will be created. And that means I need to run it two times. Otherwise, how can I suppose to find the DKEparameters.dat document?

                  Best regards,
                  Xinman

                  • Apr 11, 2018  02:04 PM | Andrew Taylor - MUSC
                    RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
                    Hello!
                    I've attached a screenshot of the DKE "Advanced Options" window. When you run DKE, make sure you uncheck the box that says "interpolate" (I highlighted this). I think if you do this, it will stop changing your "interpolation.flag". Let me know if that solves the problem!

                    Best,
                    J. Andrew Taylor
                    Attachment: interp.PNG

                    • Apr 12, 2018  07:04 AM | Xinman Liu
                      RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
                      Hello, Andrew,

                      Thank you for your Suggestion. It did stop changing after I uncheck the box. But when it come to the FT module, the result is the same. It still read:
                      Optimizing kurtosis dODF...Error using dke_ft (line 132)
                      The number of voxels in the FA image and the tensors must match!
                      Make sure map_interpolation_method.flag = 0 for tensor fitting or reconstruct
                      the fa image from the DT.mat using the Nifti header from the diffusion weighted
                      images

                      It seems that map_interpolation_method.flag = 0 did not work out. Do you have any other Suggestions?

                      Best,
                      Xinman

                      Apr 12, 2018  10:04 AM | Xinman Liu
                      RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
                      Sorry, Andrew, when I create a new Folder and put all the DICOM Pictures in it, it work perferctly. Thank you very much.

                      Best regards,
                      Xinman

              Apr 9, 2018  08:04 AM | Xinman Liu
              RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
              Hi, Corinne,
              When I say run it twice with DKE, I actually mean, at first I run DKE with Interpolation on for one time, and then I set Interpolation off and run DKE again before I run Fibertracking.
              Is this the right Procesure?
              and the result stays the same like before.
              Could you please help me? Thank you.

              Apr 9, 2018  08:04 AM | Xinman Liu
              RE: Does anyone have problems performing Fiber Tracking after successfully processing DKE?
              and only when I set odf_optimization=0, and tractography=0 in ft_parameters, can the command window actually do something, and it read:
              Optimizing dODF...
              Optimization Complete...
              However there isn't any document about Fibertracking in my Folder.
              And am I doing something wrong?

  • Mar 6, 2018  10:03 AM | Xinman Liu
    what should I do with nii document after successfully processing DKE?
    Hello. I have a question and some of you might find it stupid.

    Actually what should I do with those nii documents after successfully processing DKE? I open them with FSL and all I get is different coordinates. what is the relationship between those coordinates  and the Parameters I want to aquire?  for example, if I want the value of MK of a particular voxel, what should I do? and is it possible for me to use FSL to get the value of each voxel along a certain line automatically?

    Could anyone please help? Thank you.

    • Mar 6, 2018  02:03 PM | Corinne McGill - MUSC
      RE: what should I do with nii document after successfully processing DKE?
      Originally posted by Xinman Liu:
      Hello. I have a question and some of you might find it stupid.

      Actually what should I do with those nii documents after successfully processing DKE? I open them with FSL and all I get is different coordinates. what is the relationship between those coordinates  and the Parameters I want to aquire?  for example, if I want the value of MK of a particular voxel, what should I do? and is it possible for me to use FSL to get the value of each voxel along a certain line automatically?

      Could anyone please help? Thank you.

      Hello Xinman,

      I am happy to hear that DKE is working well. The MK value in a certain voxel will correspond to the intensity value in that voxel in the kmean.nii image. You can find this intensity value using viewers such as fsleyes, MRIcron, or ImageJ. I would suggest looking into the forums for these programs to learn more about analyzing your niftis.

      Thank you for using DKE!
      Corinne

  • Feb 23, 2018  07:02 PM | Ryan Cloyd - University of Kentucky
    MATLAB:badsubscript
    Hello,

    I am hoping to use this program to process my DKI scans but I am running into an error that I cannot identify. The DKEGUI returns Error in dke.estimate (line 183) and Error in DKE (line 182). I've attached the full text from the DKEGUI when the error occurs. Is there any insight you can provide to help me identify and solve my problem? I am happy to provide additional information as needed.

    Ryan

    • Feb 28, 2018  06:02 PM | Emilie McKinnon - MUSC
      RE: MATLAB:badsubscript
      Hi Ryan,

      Thank you for your question!
      It looks like the size of your 4D nifti is not matching the number of gradient directions. 
      Would you mind telling me how large your 4D nifti is? Could you also send me your DKI bvec half.txt file?

      Best, 
      Emilie

      • Feb 28, 2018  09:02 PM | Ryan Cloyd - University of Kentucky
        RE: MATLAB:badsubscript
        Hi Emilie,

        Thanks for getting back to me. My 4D nifti should have 128 images plus an averaged image form my B=0 images. I've attached the Bvec.

        Thanks,
        Ryan
        Attachment: DKI bvec half.txt

        • Feb 28, 2018  09:02 PM | Ryan Cloyd - University of Kentucky
          RE: MATLAB:badsubscript
          I tried to also post the nifti but it appears to be too large.

          Ryan

          • Feb 28, 2018  10:02 PM | Emilie McKinnon - MUSC
            RE: MATLAB:badsubscript
            Hi Ryan,

            From this information it sounds like you have 64 gradient directions for each b-value. The parameter ndir needs to be the number of gradient directions for each b-value, not the total amount of gradient directions. Consequently, your gradient vector text file should specify the gradient directions used for each bvalue. Often these will be the same for b1000 and b2000 and you can use one text file. If these  directions are not the same, you can supply two different text files (using the command line version). 

            Here is some information from the manual: 
            ndir:
            Number of gradient directions. If a scalar value is specified, the number of gradient directions
            for all b values is set to the scalar. Otherwise, a 1-by-(nbval-1) vector should be specified, with
            each element of the vector corresponding to the number of gradient directions for a nonzero bvalue.
            fn_gradients:
            Text file containing the gradient vectors. Each row corresponds to a gradient vector. If a
            different gradient set was used for each b-value, a 1-by-(nbval-1) cell array of file names should
            be specified, with each cell specifying the gradient file name for the corresponding nonzero bvalue
            idx_gradients
            Indices of gradient directions to be used for DKI map estimation. Unacceptable diffusionweighted
            images (e.g., those affected by motion- or patient table vibration-induced diffusion
            signal loss) can be excluded here. There must be as many cells as there are nonzero b-values,
            with each cell corresponding to a nonzero b-value.


            Hope this helps! 
            Emilie

            • Mar 1, 2018  02:03 AM | Ryan Cloyd - University of Kentucky
              RE: MATLAB:badsubscript
              Hi Emilie,

              That information does help. We noticed that our bvec values repeated, and assumed our protocol had generated a duplicate set of images, so we removed half the direction vectors and half of the images. When I input the Bvec for 128 directions with the  original set of 257 images (1 image at B=0 and 128 each at B=1000 and B=2000) the program progressed further but still did not complete the processing, giving a different set of errors. I've attached the GUI text for the latest attempt. Any further guidance is greatly appreciated.

              Thank you,
              Ryan

              • Mar 1, 2018  11:03 AM | Emilie McKinnon - MUSC
                RE: MATLAB:badsubscript
                Hi Ryan, 

                I looks like you have some NaNs in your 4D Nifti. Most often they appear only at the edges of the image so they should not have affect the brain. They tend to be introduced by preprocessing techniques (image conversions, denoising, eddy current corrections,..).  

                A quick fix would be to change the values from NaN to 0 in matlab. 

                Something along these lines (or your preferred way of making a 4D nifti) :

                nvol=257;
                hdr=spm_vol('path_to_image');
                image_name=spm_read_vols(hdr);
                image_name(isnan(image_name))=0;

                for vol=1:nvol
                hdr.n(1)=vol;
                spm_write_vol(hdr,img(:, :, :, vol));
                end;

                Best, 
                Emilie

                • Mar 2, 2018  04:03 PM | Ryan Cloyd - University of Kentucky
                  RE: MATLAB:badsubscript
                  Hi Emilie,

                  I removed the NaNs and that fixed the program ran successfully. Thanks so much for your help!

                  I have one (hopefully) last question. I see that the interpolation resolution defaults to 1 mm. Since we are working with mouse brains, I would like to set this resolution smaller. I've tried changing it in the dke_parameters DAT file but these changes are not reflected in the GUI when I run the scans. Is it possible to change the interpolation resolution?

                  Thanks,
                  Ryan

                  • Mar 2, 2018  04:03 PM | Emilie McKinnon - MUSC
                    RE: MATLAB:badsubscript
                    Hi Ryan, 

                    You will have to adjust it in the DKEParameters file and then run DKE through the command line. You can find all the information on how to do that in our manual : http://academicdepartments.musc.edu/cbi/dki/User%20Manual%202.6.pdf.

                    Good luck! 
                    Emilie

  • Feb 22, 2018  03:02 PM | Laura Mancini - UCLH NHS FT
    kmean vs mkt
    Hello,

    sorry, what is the difference between the kmean and the mkt maps created by the dke software?

    Many thanks
    Laura

    • Feb 23, 2018  07:02 PM | Hunter Moss
      RE: kmean vs mkt
      Hi Laura,

      Great question.

      Kmean (MK) is the average kurtosis over all directions (in theory an infinite amount). MK requires knowledge of both the diffusion and kurtosis tensors. Practically speaking, we advise gathering at least 30 directions at both b = 1000 and 2000 s/mm^2 (more often we gather 64 or 128 directions). 

      MKT is the mean kurtosis tensor which is a bit different from MK. The kurtosis tensor, W, can be calculated (with the omission of a scaling factor) and then averaged. So, MKT is really the mean (of the) kurtosis tensor. Explicitly, MKT only approximates MK. However, if diffusion tensor were to be completely isotropic then MKT and MK would be equal.

      The paper for MKT is: Hansen B, Lund TE, Sangill R, Jespersen SN. Experimentally and computationally fast method for estimation of mean kurtosis. Magn Reson. Med 2013; 69:1754-1760.

      MK and MKT have shown to have similar information in this publication: Glenn GR, Helpern JA, Tabesh A, Jensen JH. Quantitative assessment of diffusional kurtosis anisotropy. NMR Biomed 2015;28:448–459.

      I hope this answers your question but if not, please feel free to ask for more clarification.

      Thanks for using DKE!

      -Hunter

      • Feb 27, 2018  09:02 AM | Live Eikenes
        RE: kmean vs mkt
        Hi,

        I have a follow up question regarding MKT. Is MKT the same as GFA?

        Kind regards,
        Live

        • Feb 27, 2018  08:02 PM | Hunter Moss
          RE: kmean vs mkt
          Hi Live,

          No, they are not equivalent by any means. MKT as was explained in the earlier question is the mean of the kurtosis tensor without any information from the diffusion tensor. MK and MKT are equivalent if and only if the diffusion tensor is fully isotropic.

          The generalized FA (gFA), is analogous to the conventional FA, but unlike FA, gFA uses information from the diffusion orientation distribution function (dODF) derived from DKI using both the full diffusion and kurtosis tensors. The dODF is calculated by taking the radial projection of the diffusion displacement probability density function (dPDF) and has a weighting factor to increase sensitivity to longer diffusion displacements.

          More information regarding this topic is laid out in great detail in Glenn, G. R., Helpern, J. A., Tabesh, A., & Jensen, J. H. (2015). Quantitative Assessment of Diffusional Kurtosis Anisotropy. NMR in Biomedicine, 28(4), 448–459. http://doi.org/10.1002/nbm.3271.

          Thanks for the question!

          -Hunter

  • Feb 5, 2018  03:02 PM | Live Eikenes
    bvec files
    Hi,

    I have a dataset with b0, b1000 and b2000 that has been acquired with two averages. So the data is saved as follows:

    First the b0 image, then 20 directions with b1000, then 20 directions with b2000, then next average with b0, 20 x b1000 and finally 20 x b2000. Can I use the data as is, or do I have to average the two acquisitions?

    Thanks,
    Live

    • Feb 5, 2018  03:02 PM | Corinne McGill - MUSC
      RE: bvec files
      Hello Live,

      DKE will average the two acquisitions if your input images are in dicom format.

      Thanks for using DKE!
      Corinne

      • Feb 5, 2018  05:02 PM | Live Eikenes
        RE: bvec files
        Hi Corinne,

        Thanks for your fast reply. 

        But how will the bvec.dat files look like then? When making the bvec.dat files the 0 for the b0 is not supposed to be in the .dat file, but then I will have to have a 0 in the .dat file?

        Best,
        Live

        • Feb 12, 2018  04:02 PM | Corinne McGill - MUSC
          RE: bvec files
          Hi Live,

          The following excerpt from the DKE User Manual should help answer your question.

          Gradient Vectors
          Select the gradient table from a list of available tables or specify a custom table. A custom table
          can be a '.dat' or '.txt' file. Each row corresponds to a gradient vector [Gx, Gy, Gz]. When
          specifying a custom table, remove gradients that could correspond to the B0 image [0, 0, 0].
          When using a 4D NIfTi, make sure that the 4D order corresponds to the order of the gradient
          table. If a DICOM set is used, DKE will order the images according to the information stored in
          the DICOM tag-(0018, 0024) 'SequenceName'.

          Thanks,
          Corinne

  • Jan 26, 2018  01:01 AM | Meg Spriggs - University of Auckland
    Tensor fit and registration
    Hello,

    I am currently trying to set up my first diffusion kurtosis imaging pipeline using DKE and DKE_FT (thank you to the creators for these awesome tools!) and I have two questions.

    Firstly, looking at the output from DKE, there is a bit of noise left in my data. I have included denoising and Gibbs ringing correction in my preprocessing as well as FSLs eddy and top up. I am thinking about using the robust tensor fit option in DKE (i.e., RESTORE) to hopefully address remaining outliers, but am wondering what I should do with the other tensor fit options if I do this. i.e., should I continue using the default weighted constrained linear least squares method if I also include the robust option? Do you think that this is a good option for cleaning up the data, or should I include a different method of outlier detection somewhere else in my analysis? 

    Secondly, After putting my preprocessed images through DKE, I am hoping to do 2 things: run the FA/kurtosis images through TBSS, and run tractography. For TBSS, the images are registered to standard space within FSL's TBSS functions, which is great. But my question is whether I should also be registering the images to standard space before I run DKE_FT, and what tool you would recommend for doing this. 

    I apologise if these is a silly questions and appreciate any advice you may have. 

    Thank you for your help! 

    Kindest Regards,
    Meg

    • Jan 30, 2018  04:01 PM | Corinne McGill - MUSC
      RE: Tensor fit and registration
      Hello Meg,

      Thank you for using DKE! 

      I am not familiar with your data, but I normally would not recommend using the robust tensor fit option. Would you mind sending me your dke parameters text file?

      In regard to your second question, you should not register images to standard space before running DKE and DKE_FT.

      Thanks,
      Corinne McGill

      • Jan 31, 2018  05:01 AM | Meg Spriggs - University of Auckland
        RE: Tensor fit and registration
        Hello Corinne, 

        Thank you for your reply. 

        Okay great. So I have separate parameter files for each participant so that the b-matrix is correctly rotated for tractography. But I have attached an example. I am currently using the weighted constrained linear least squares method for tensor fit.  

        Kindest regards,
        Meg

        • Feb 1, 2018  02:02 PM | Emilie McKinnon - MUSC
          RE: Tensor fit and registration
          Hi Meg, 

          It looks like you have lots separate gradient direction files (with a low number of directions). Seeing that you use denoising and Gaussian smoothing and still have bad fits, I suspect that your gradient directions might be too dependent on one another for accurate fitting. The best way to test this is to look at the condition number of the matrix used for the weighted linear least squares ( if this matrix is ill-conditioned, things will go wrong). I understand that this is not a straightforward thing to do without the source code. However, we are working on that!

          Just to make sure. Can you send an example image with "bad voxels" that you are trying to get rid of?  

          I hope this helps,
          Emilie

          • Feb 1, 2018  10:02 PM | Meg Spriggs - University of Auckland
            RE: Tensor fit and registration
            Hello Emilie, 

            Yes the b values vary around 0, 1000, and 2000 because they account for the imaging gradient. I thought it would be better to include this in the model, but would I be better to just use 0, 1000 and 2000? 

            Sorry for the potentially silly questions, but is there a way to test the model fit? Like a goodness-of-fit measure? 


            Thank you, 

            Meg

  • Jan 10, 2018  10:01 AM | Chrystelle Po - ICube
    message error
    Hello,

    Happy new years everyone!

    I would like process preclinical data which are pre-prcessing with FSL. Data was acquired using 30 directions, different 5 bvalues and one b=0. I get this message error in DKEGUI.exe:
    "error using ==
    Matrix dimensions must agree.


    Error in dke_estimate


    Error in dke


    MATLAB:dimagree"

    Someone met the same problem? Could you help me?
    Do you need more informations?

    Cheers

  • Nov 21, 2017  02:11 AM | marcmarquez
    Range of mean, axial and radial diffusivity?
    Hi DKE experts,
        Sorry to interrupt you for the a problems I met, when using DKE software.
        Why the range of the mean, axial and radial diffusivity (both DTI-derived and DKI-derived) calculated by DKE software is [0, 3]? The example dataset in DKE homepage also has the same range of the DKI-derived mean, axial and radial diffusivity. Theoretically, the range of the mean, axial and radial diffusivity is [0, 3e-3] mm2/s.  When I used PANDA toolbox to calculate the DTI-derived mean, axial and radial diffusivity, the range is [0, 3e-3] mm2/s. Does DKE software scale the output of diffusivity maps?


        thanks for your reading.

                                         yours

    • Nov 21, 2017  01:11 PM | Emilie McKinnon - MUSC
      RE: Range of mean, axial and radial diffusity
      Dear Marc, 

      Indeed, the diffusivities are expressed in um2/ms.

      Best,
      Emilie

  • Oct 21, 2016  02:10 PM | N Senn
    MAC OSX Installation
    Dear All,

    I am attempting to install DKE on OSX. I have downloaded the required MCR. At this point I am stuck and I cannot find any instructions in the install package or online. 

    Please can anyone provide a link to any instructions on how to install the DKE from the point of downloading the OSX install package or provide me with some instruction. 

    Many thanks, 

    Nick

    • Nov 21, 2016  02:11 PM | Emilie McKinnon - MUSC
      RE: MAC OSX Installation
      Dear Nick, 

      Open a terminal cd to the folder that contains the executable dke. Run dke with ./run_dke.sh

      I added an example DKE_parameters file to get you started. Let me know if you are interested in outputting the tensors, this is currently not possible with the mac version.

      I apologize in the tardiness of this response.

      Best, 
      Emilie

      Sep 11, 2017  02:09 AM | Meg Spriggs - University of Auckland
      RE: MAC OSX Installation
      Hello,

      To follow up on this question, I am also having problems getting DKE to run on my Mac. 
      I have installed the compiler (R2013b) and have run the command you suggested. 
      If I click on the dke application, it starts to open but then promptly shuts itself down. Is there anything else I need to do? 

      Thanks for your help, 

      Kindest Regards,
      Meg

      • Sep 11, 2017  05:09 PM | Kirk Feindel - University of Western Australia
        RE: MAC OSX Installation
        Hi Meg,

        As an example, you can execute run_dke.sh on a mac like this:

        ~/Desktop/DKE/run_dke.sh /Applications/MATLAB/MATLAB_Compiler_Runtime/v82 ./DKEParameters.dat

        In this case the DKE folder is just sitting on the Desktop, and usually I keep the dataset-specific parameters file with the dataset, and execute from the dataset directory, hence the "./DKEParameters.dat"

        Cheers,

        Kirk

        • Sep 11, 2017  08:09 PM | Meg Spriggs - University of Auckland
          RE: MAC OSX Installation
          Hello Kirk,

          Thank you for your reply.
          Sorry I was being silly and was expecting a GUI to open. But I understand that you don't have a GUI for Mac or Linux, is that correct?
          Thanks for your help,
          Regards,
          Meg

        Nov 14, 2017  07:11 PM | Luis Alvarado - University of Louisville
        RE: MAC OSX Installation
        Hi all,

        I am having the same issue with the GUI. 
        Originally posted by Meg Spriggs:
        Hello,

        To follow up on this question, I am also having problems getting DKE to run on my Mac. 
        I have installed the compiler (R2013b) and have run the command you suggested. 
        If I click on the dke application, it starts to open but then promptly shuts itself down. Is there anything else I need to do? 

        Thanks for your help, 

        Kindest Regards,
        Meg

        • Nov 14, 2017  07:11 PM | Corinne McGill - MUSC
          RE: MAC OSX Installation
          Hello Luis and Meg,

          The Mac version of DKE does not have a GUI. You will need to open a terminal and cd to the folder that contains the executables. Run dke with ./run_dke.sh.

          I hope this helps!
          -Corinne
          Originally posted by Luis Alvarado:
          Hi all,

          I am having the same issue with the GUI. 
          Originally posted by Meg Spriggs:
          Hello,

          To follow up on this question, I am also having problems getting DKE to run on my Mac. 
          I have installed the compiler (R2013b) and have run the command you suggested. 
          If I click on the dke application, it starts to open but then promptly shuts itself down. Is there anything else I need to do? 

          Thanks for your help, 

          Kindest Regards,
          Meg

  • Oct 18, 2017  03:10 PM | Clementine Lesbats - University of Liverpool
    slice number in the DKI maps
    Hi all,

    After using DKE on a few data sets, I noticed a slice is missing at the end of all of my parametric maps (37 slices instead of 38 in the input data set).
    Has anyone noticed this before, or did I just simply a mistake in my parameter file that would do that?

    Cheers,
    Clementine

    • Oct 19, 2017  04:10 PM | Corinne McGill - MUSC
      RE: slice number in the DKI maps
      Hi Clementine,

      Will you send your DKE parameters text file please?

      Thank you,
      Corinne MCGill

      • Oct 19, 2017  04:10 PM | Clementine Lesbats - University of Liverpool
        RE: slice number in the DKI maps
        Hi Corinne,
        I attached the parameters file. Thanks for having a look.
        Clémentine
        Attachment: DKEParameters.dat

        • Oct 19, 2017  06:10 PM | Corinne McGill - MUSC
          RE: slice number in the DKI maps
          Hi Clementine,

          Try setting "map_interpolation_method.flag = 0;". Let me know if this fixes your problem.

          Corinne

          • Oct 23, 2017  10:10 AM | Clementine Lesbats - University of Liverpool
            RE: slice number in the DKI maps
            Thank you Corinne,

            it did indeed fix the problem.
            What is it doing/not doing when we uncheck that map interpolation? (Sorry if this is a basic maths question...)

            Clémentine

  • Oct 6, 2017  02:10 PM | Michael Firbank - Newcastle University
    Siemens 30-direction
    Hello

    Thank you for making this tool available. I have tried it, and it seems to run fine.
    However, I wanted to try running on the example dataset to compare my results against the output provided. For the diffusion vectors, the download page just says
    "Gradient Vectors: Use Siemens 30-direction"

    Is it possible to get hold of this direction file? (we don't have a Siemens scanner). Or have I missed it somewhere.

    Many thanks

    Michael

  • Sep 29, 2017  02:09 PM | Zhang Yue - SCNU
    5-bval DKI images with anisotropic resolution
    Hi DKE experts,
        Sorry to interrupt you for the a problems I met, when using DKE software.
        I have DKI data with 5 non-bval (500, 1000, 1500, 2000, 2500) accompanied by 15 directions. But the voxel size is 0.94*0.94*4, which seems not good enough. And I do not konw which fwhm is suitable for my data. Reading from the manual book of DKE, the reconmanded fwhm is 1.25*voxel size. However, it is too large to set [1.25 1.25 6]. So what can I do to make it more standard. Does resample the data to be isotropic is better before averaging b0 images and correcting eddy induced distortion? Or any other suggestions?
        thanks for your reading.



                                                                                                                                                                                                                         yours

    • Sep 29, 2017  07:09 PM | Corinne McGill - MUSC
      RE: 5-bval DKI images with anisotropic resolu
      Hello Zhang,

      Thank you for your question! Since your slice thickness is already relatively large, I would recommend only smoothing the xy-plane, making your FWHM [1.25 1.25 1]. I would also recommend turning interpolation off. I hope this helps. 

      Thank you for using DKE!

      Corinne

      • Sep 30, 2017  07:09 AM | Zhang Yue - SCNU
        RE: 5-bval DKI images with anisotropic resolu
        Thanks for your suggestions a lot!

        Oct 1, 2017  06:10 AM | Zhang Yue - SCNU
        RE: 5-bval DKI images with anisotropic resolu
        Hi, I have another question for DTI parameters derived from DKI images.
          You see that the DKI iamge has 5 b-vals, and I am comfused about the DTI part of DKEparameters.dat. It is better to set dti_method.b_value = {500 1000 1500 2000 2500}; dti_method.directions = {1:15, 1:15, 1:15, 1:15, 1:15}; Or I just use the single b-val to estimate the DTI parameters?
          For my idea, it is better to use the 5-vals, because of my single b-val having only 15 directions. But I do not be sure for that.
          Thanks!

  • Sep 20, 2017  09:09 AM | mukesh kumar
    fn_gradients "gradient vector table"

    Hello everyone
    I am trying to run my nifti data set using DKE in batch mode.
    my dataset bval = [0 500 1000 1500 2000];
    ndir = 30;
    fn_gradients = '/media/poonamrana/Mukesh_Seagate/PhD_data_DKI/Control_DKI/Hema/gradient.txt';
    idx_gradients = {1:30 1:30 1:30 1:30};
    The DKE processing done without error,

    but my question is,

    • when we convert dicom DKI data into nifti using dcm2nii then we get subject.nii, subject.bval, subject.bvec, This subject.bvec file i used as a gradient table "gradient.txt" its is OK or not

    • how to select individual subject "gradient.txt" file in batch mode analysis in "fn_gradients = '/media/poonamrana/Mukesh_Seagate/PhD_data_DKI/Control_DKI/ subject1/ gradient.txt';" Because i have total 50 subject and every subject have individual gradient.txt file. Here i attached one subject gradient.txt table.
    Attachment: gradient.txt

    • Sep 20, 2017  11:09 AM | Emilie McKinnon - MUSC
      RE: fn_gradients "gradient vector table"
      Hi Kumar,

      Thank you for your question! 

      Before you can use the .bvec file as a gradient table in DKE you will need to transpose its content and also remove any lines that match up with your b0 image (0 0 0). Additionally,  if you specify in ndir that you have 30 gradient directions, the program will only use the first 30 lines of your gradient.txt. If you want to use a different gradient table for each diffusion weighting, you can make 4 different txt files for each bval and write fn_gradients as follows: fn_gradients={ 'your path/gradient_500.txt','your path/gradient_1000.txt','your path/gradient_1500.txt' ,'your path/gradient_2000.txt'}.  

      Your second question is a little harder to answer. Currently, DKE does not support batch scripting with different gradient tables. Remember, if you are not interested in tractography but only in the diffusion metrics, you can use the gradient table of the scanner as these metrics are rotationally invariant. If you are interested in tractography, you will need to use the gradient tables that are calculated by dcm2nii. That said, a common solution to your problem is to make a dke_parameters file for each subject, with their respective gradient table, and write a script that will loop over all of them executing DKE separately for each subject (either in matlab or in any terminal window). If you would like we could provide a short script for you that would do this! 

      I hope this makes sense.
      Good luck! 
      Emilie

      • Sep 20, 2017  11:09 AM | mukesh kumar
        RE: fn_gradients "gradient vector table"
        Hi Emilie McKinnon
        Thank your factual suggestion
        But i not proper interpret this line "use the gradient table of the scanner as these metrics are rotationally invariant.". Please can explain little more me. It is great help for me.

        Thank you in advance

        • Sep 20, 2017  11:09 AM | Emilie McKinnon - MUSC
          RE: fn_gradients "gradient vector table"
          Hi Kumar,

          I apologize for being unclear. Let me try again!

          The majority of people will run the standard diffusion weighted sequences that are provided with your MRI scanner. For example, on our Siemens Prisma scanner we have the build in options of using either 30, 64 or 256 gradient directions for DKI.  This gradient table will be the same for every patient and you should be able to ask your MRI tech for this table.

          The problem that arises is as follows. This gradient table is defined in the coordinate system of the scanner (which is stationary), but the coordinate system of the subject will be different every time (as you are not able to exactly position your subject in the scanner the same way).  The nice thing about coordinate systems is that there is a simple linear transformation between your subject's image coordinate system and the coordinate system of the scanner. This transformation is provided in the dicom header and this is actually what dcm2nii uses to calculate the gradient tables in image space (this is why they are different for every subject).  The nice thing about using only the diffusion metrics is that they do not "care" about which coordinate system they are calculated in, they will be the same in both coordinate systems. This is the definition of rotationally invariant. Hence, if you are only interested in calculating MD,MK,FA go ahead and use the gradient table you can find on the scanner! Although if you are interested in tractography, this would be an incorrect approach and you need to use the gradient table defined in image space (as calculated by dcm2nii).

          I hope this made more sense!
          Thanks,
          Emilie

          • Sep 20, 2017  01:09 PM | Russell Glenn - Medical University of South Carolina
            RE: fn_gradients "gradient vector table"
            Hi Kumar,

            I agree with Emilie, if you are not doing tractography you do not necessarily need to update the parameter's files for each subject.

            If you have matlab, and feel comfortable with a little bit of coding, I've attached a script that can help you batch process this and update the parameters for each subject automatically. I've also included a few lines of code where I've used this in the past (you will have to modify this and define your own variables to make this work... it's just included as an example).

            Best,

            Russell



            file_paths.dke = '~/Documents/DKE_2.6'; %Directory with dke executable file

            new_params = {'studydir',sprintf('''%s''',file_paths.output),'subject_list','{''''}',...
            'fn_gradients',sprintf('''%s''',file_paths.dki_grad),...
            'fwhm_img',sprintf('1.25*[%d %d %d]',vox(1),vox(2),vox(3)),'preprocess_options.format','''nifti''',...
            'preprocess_options.fn_nii','''dki_4D''','ndir',sprintf('%d',ndir),...
            'T',sprintf('%d',dke_mask_threshold),'idx_gradients',idx_gt_str,'bval',bt_str,'median_filter_method','0'};

            updateParametersFile(file_paths.dke_params_template,file_paths.dke_params_new,new_params);

            %Run DKE
            cd(file_paths.dke)
            if isunix; eval(sprintf('!./dke ''%s''',file_paths.dke_params_new))
            elseif ispc; eval(sprintf('!dke %s',file_paths.dke_params_new))
            end

  • Oct 22, 2015  02:10 AM | Ehsan Misaghi - University of Alberta
    Noisy images
    Hi everyone,

    So, I have a DKI dataset with 30 directions (for each of the b-values) and 2 b-values (the directions are identical for both of the b-values). I have used DKE to extract the maps. The b=0 threshold has been set to 0 (I tested this with 50 and 100 as well), "DWI Spatial Smoothing", "co-register scans" and "interpolate" unchecked and Median Filtering set to No filtering. The maps I get are very noisy and it takes almost 7 hours for DKE to process the data and spit out the maps. I have attached an screenshot of one of the FA maps for your reference. Could anyone help me figure out where the problem lies.

    Thanks a lot in advance,
    Ehsan
    Attachment: fa.jpg

    • Oct 22, 2015  03:10 PM | Russell Glenn - Medical University of South Carolina
      RE: Noisy images
      Hi Ehsan,

      DKE should definitely not take 7 hours to run. Masking in some way can reduce this time significantly since so much of the image is background, where the fitting algorithms won't work well and may run extra slow. DKE uses a simple connected components analysis for masking, but if this doesn't work for you, you can use the brain extraction tool from fsl, which can be manually applied to your images before running DKE.

      However, your FA image does look fairly noisy within the brain volume. What voxel dimensions and b-values are you using? If everything is set up and it is still taking a long time to run, my guess is that your highest b-value images may have a very low SNR. Have you looked at these? If the SNR drops, DKE's fitting algorithms also might run slowly and the parameter estimates can even become biased.

      First things to check are resolution, b-values, head coil, coil combine mode (something like adaptive combined opposed to sum of squares!), parallel imaging acceleration factors, etc. 

      Spatial smoothing can also help with some of this. We typically recommend a Gaussian smoothing kernel of 1.25*voxel dimensions. However, there are a myriad of different ways to incorporate noise correction and artifact removal (such as Gibbs ringing) into DKE fitting routines. These can all affect the quality of the parameter estimates.

      Best,

      Russell

      • Nov 2, 2015  10:11 PM | Ehsan Misaghi - University of Alberta
        RE: Noisy images
        Hi Russell,

        Thanks a lot for your response. I ran DKE with another b=0 threshold. It didn't take as long, though it still took longer than what I expected (I am expecting less than 20 mins!) and the images don't look as noisy. The problem is that the maps still have the skull and scalp. I tried using ExploreDTI and it took about 78 seconds to convert the NIfTI file to a .mat file readable by ExploreDTI and about 1 min to extract the FA map. I suspect the same thing applies to the other maps using this program. So, my two questions are:
        1. Why do you think the two software packages are this much different in terms of the processing time?
        2. What is your recommendation for the b=0 threshold so that the scalp and skull get masked out? I don't have problems with using FSL's BET, but honestly, I don't feel good about adding another program into the pipeline!

        Thanks,
        Ehsan

        P.S: Our b-values are 0, 998 and 2994 and the resolution is 1*1*2.

        • Nov 2, 2015  11:11 PM | Russell Glenn - Medical University of South Carolina
          RE: Noisy images
          Hi Ehsan,

          20 mins is very reasonable. The DKE scripts are 'parallelized' using MATLAB parallel computing toolbox, so it will run faster if you run it on a CPU with more cores or over a cluster... maybe one day we'll have a GPU implementation, but right now the optimization script won't work down there...

          1. DTI fitting is super easy. You just have to solve x = (H'*W*H)^-1*H'*W*y; which is purely linear number crunching, which computers are great at and it's easy to run through an entire image volume in less than 1 min, even in Matlab. The basic linear estimation problem is the same in DKI but we utilize higher order signal model with higher order terms in the b-value and more unknowns. Consequently, the pure linear fit is often noisier than desired. There's a whole host of literature on DKI fitting (including a bunch of non-linear techniques and Gibbs ringing removal in the preprocessing where the linear estimation is better). Our algorithms use a constrained linear least squares which just applies some physical constraints on the solution to the linear technique. This requires more computational time, and when the images are noisier it takes even longer. This is what I suspect may be contributing to your image processing times. On top of that, DKI's source code is written in Matlab, which is inherently slow. I don't know what ExploreDTI is written in by C-based languages, for example are typically much faster.

          2. FSL's BET is an excellent masking tool. DKE just applies a simple connected components analysis which is not as robust as BET's approach. If you're comfortable utilizing this, then I would recommend it :) You can mask the DKI images prior to running DKE. I've often used semi-automated approaches. The masking doesn't affect the data though, so if you're analyzing stuff inside the brain, you can always just ignore the skull stuff...

          Hope that helps,

          Russell

          • Nov 5, 2015  11:11 PM | Ehsan Misaghi - University of Alberta
            RE: Noisy images
            Hi Russell,

            Just so you know, I tried feeding in the same image with the same parameters once without doing BET and once after brain extraction. It took about 40 mins to process the extracted version and about one and a half hour to process the original image. I think 40 mins is also what you would expect to be reasonable, is that right?

            Also, I'm trying to find out which of DSI Studio and TrackVis to use for tract extraction. The fact that TrackVis has 3D ROIs is tempting, but there is a major limitation in TrackVis and that is that it cannot show the glyphs, which I would assume to be a great way to know if one has extracted the right tract or the processing steps have gone the right way. What would be your suggestion on this?

            Thanks again,
            Ehsan

            • Nov 6, 2015  12:11 PM | Russell Glenn - Medical University of South Carolina
              RE: Noisy images
              Hi Ehsan,

              40 minutes is reasonable though this will depend on the size of your data set and computational platform. I do hope we can continue to improve the processing times in the future.

              I would definitely recommend DSI Studio as a more versatile tool for analyzing your data; however, TrackVis is not with out merit. For example, they do have different ROI tools, and TrackVis can be very useful in visualizing the data and selecting certain subsets, etc.

              DSI Studio does have ROI options too, and I haven't explored them to their full extent but they can also be loaded in, or manually drawn to select certain tracts, so there are a lot of options. I find that visually assessing the ODF glyphs and orientation estimates is crucial for making sure everything is lined up. I've attached an example from a clinical study with 30 gradient directions as a reference. You can also do things in DSI Studio like overlaying a t1 image which is also useful / cool for visualization. Hopefully in the future we can also provide more analysis tools :)

              One last point about the two software platforms. I thought that we had corrected all orientation issues in making the .trk files compatible with both, however, much to my chagrin sometimes they will overlay correctly in one but not the other. I am biased towards working in DSI studio and if you load an image in there or use their pre-processing scripts, they put the image and gradient table in LPS, so in making the .fib file, I did the same. However, this may cause the tracts processed with DKE or DSI Studio to not overlay with an image correctly in TrackVis. This can be overcome by changing the ImageOrientationPatient field in the .trk header but I wish there was a better solution :/

              In future versions we will also output a vox_to_ras transformation which will help with programs that expect the tracts to be in MNI space...

              Best,

              Russell

              • Nov 6, 2015  11:11 PM | Ehsan Misaghi - University of Alberta
                RE: Noisy images
                Awesome. I'll try DSI Studio and will get back to you with my feedback!

                Thanks,
                Ehsan

                Sep 1, 2017  10:09 PM | sevim sahin - Kocaeli University
                RE: Noisy images
                Hi,

                I still have the same problem. Due to the low SNR, we re-scanned  a test patient using the philips dki protocol provided by the experienced users and yet I have this noise problem.

                I tried to run the software with different b=0 value, filtering, noise tolerance value??

                Any more recommendation?

                Thanks in advance
                Attachment: test-patient.jpg

                • Sep 5, 2017  12:09 PM | Emilie McKinnon - MUSC
                  RE: Noisy images
                  Hi Sevim Sahin, 

                  Can you walk me through your way of processing the DKI images (e.g. do you use .dcm or .nii / GUI or .exe / what are your settings). 
                  The screenshot you attached looks indeed very noisy, although I have a suspicion your gradient directions might not be matched accurately with your images resulting in some very poor fitting. 

                  Could you attach your DKEParameters file as well? 

                  Best, 
                  Emilie

  • Aug 14, 2017  01:08 PM | Clementine Lesbats - University of Liverpool
    'error using dke (line 47)' with Bruker files
    Hi,

    I just started using DKE on a windows computer. I am using Bruker files so I am using the cmd prompt (I am not very familiar with that as well).
    I edited the DKE_parameters.dat but I seem to not do it correctly as the command is returning:
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Error using dke (line 47)
    Error: The input character is not valid in MATLAB statements or expressions.

    MATLAB:m_illegal_character

    I didn't know whether the program is using DICOM or Bruker data files so I put all of them in one folder.

    Any idea on the source of the error?
    Thank you for your help.
    Attachment: dke_parameters.dat

    • Aug 15, 2017  08:08 AM | Kirk Feindel - University of Western Australia
      RE: 'error using dke (line 47)' with Bruker f
      Hi Clementine,

      Unfortunately the error codes are pretty non-specific!

      Have you looked at the FAQ section:

      http://academicdepartments.musc.edu/cbi/...

      and the previous posts in this forum regarding Bruker data?  There are a few changes to the parameters file that need to be made, and the Bruker method file needs to be copied forward to the same folder containing the 2dseq file (I think).

      Otherwise, all I can suggest is providing a copy of your dataset in the native Bruker folder structure, and we can try to run it through DKE.

      Usually, I open my 2dseq using DSI Studio, save the 4D nifti and bvecs it generates, and then use those to generate the input for DKE.  The bvecs from DSI Studio will be reordered (as per the images) according to increasing b-value, so you need to then chop up the bvecs into e.g, b1000 and b2000 for input into DKE.

      Cheers,

      Kirk

      • Aug 15, 2017  03:08 PM | Clementine Lesbats - University of Liverpool
        RE: 'error using dke (line 47)' with Bruker f
        Yes I had read the FAQ and all forum threads related to Bruker/2dseq data before.
        For some reason, I can't manage to find where I am not changing parameters accordingly.
        And now I changed a few little things, I get a different MATLAB error:

          Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
        Error using dke (line 47)
        Error: Unexpected MATLAB expression.

        MATLAB:m_missing_operator

      Aug 22, 2017  12:08 PM | Clementine Lesbats - University of Liverpool
      RE: 'error using dke (line 47)' with Bruker f
      OK- it appeared I didn't have the admin rights on the drive I was using, it is now running on 2dseq files.

      But now I managed to start the program through the command line, I end up with various error messages, which I tried to fix one after each other. But I can't manage to troubleshoot that last one:

      M:\>"C:\Program Files\DKE\dke.exe" "M:\Documents\RAT_2\DKI\pdata\1\DKEParameters.dat"
      Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
      Start date and time: August 22, 2017 13:38:18
      Diffusional Kurtosis Estimator (DKE) version 2.6.0
      Converting input Bruker images to NIfTI... complete.
      Averaging images... complete.
      Reading input images... complete
      Error using ./
      Matrix dimensions must agree.

      Error in dke_estimate>read_gradients (line 702)
      Error in dke_estimate (line 196)
      Error in dke (line 182)
      MATLAB:dimagree

      Do you think this is somehow related to my bvecs matrix size?

      Clementine

      Aug 29, 2017  08:08 AM | Clementine Lesbats - University of Liverpool
      RE: 'error using dke (line 47)' with Bruker f
      Hi everyone,

      Does anyone have an idea of what may occur to me?
      I have been trying multiple times since, changing some parameters, and still have the same error message.
      I would be very grateful if someone could have a look at it?

      Clementine

      • Aug 30, 2017  12:08 AM | Kirk Feindel - University of Western Australia
        RE: 'error using dke (line 47)' with Bruker f
        Hi Clementine,

        Without having a copy of your current parameter file, bvecs, and example dataset, etc., providing advice to you will be difficult.

        Remember that you don't need a bvecs line for b0, and that you would be using the save bvecs for each b-weighting, so bvecs should have the number of lines equal to your number of directions.  

        According to your original parameter file, I presume you have used 30 directions.

        I note that you only specify bval = [0 1000] which means you can't reconstruct the kurtosis tensor, only the diffusion tensor.  Did you do two non-zero b-values?

        The following won't affect whether DKE runs, but I would:

        (a) change fwhm_img to match your acquisition resolution (currently you have 2.7 mm isotropic).

        (b) change map_interpolation_method.resolution=1 (which is in mm, so should also be adjusted, or turned off with the flag two lines above.

        If you attach an example dataset, etc. I will see if I can get DKE to finish on my machine.

        Cheers,

        Kirk

      Aug 30, 2017  09:08 AM | Clementine Lesbats - University of Liverpool
      RE: 'error using dke (line 47)' with Bruker f
      Dear Kirt,

      Thanks for your answer. I made several mistakes in my first post here, sorry for that, this is my fault. I corrected them since when.
      I am using 15 directions, 2 non-zero b-values.
      I did not include the b0 to my table, and I have 15 lines, 3 columns in it.

      When I look at the created Nifti files, the images for 15 directions and each b-value are there, in the 'combined' folder. But they are the last images that are created before the error occurs.
      I attached my data in the native structure, with the DKEParameters.dat and bvecs.txt files in there.

      Clementine
      Attachment: DKE_CL.zip

      • Aug 31, 2017  05:08 AM | Kirk Feindel - University of Western Australia
        RE: 'error using dke (line 47)' with Bruker f
        Hi Clementine,

        So - I managed to get the dataset to run through DKE, HOWEVER . . . as I will explain the process is not straight forward.

        I completely forgot to ask which version of ParaVision you are using, and I see it's PV6.0.1 (which is good and bad).  It's good because Bruker adjusted how the actual b-values were being calculated compared to PV6.0 (so the requested b-value is closer to actual).  But, it's bad because DKE doesn't handle the 2dseq import from PV6 properly (works fine with PV5). Maybe the next version of DKE Emilie ???

        The good news is there is a work-around using DSI Studio to import your 2dseq and save a 4D NifTI and the reordered bvecs (note: DSI Studio orders the image volumes according to increasing b-value).

        1) Download and install DSI Studio
        http://dsi-studio.labsolver.org/dsi-stud...

        2) Open DSI Studio --> "Open Source Images" --> select your 2dseq (note: DSI Studio requires the files in the native Bruker hierarchy, i.e., the "method" file needs to be located alongside the "pdata" folder).  When you click "ok" you will see the B-table pop up as acquired.  Click "ok" and DSI Studio will create it's SRC file.

        3) Under the File name column you should see "2dseq.src.gz" (located in your original study directory).  Double click on this file in DSI Studio and the "Reconstruction" window will open.  

        4) From the top tool bar, choose "File" --> "Save 4D NifTI" (make sure to change the default ".nii.gz" to ".nii" because DKE doesn't work with compressed NifTI), then "Save bvecs".  The 4D NifTI will have one b0 volume, so your dataset will have a fourth dimension size of 31.  

        4a) (optional) I would recommend you do a brain extraction at this stage in another software package. This can save a lot of time as only the brain voxels are fit versus relying on the threshold flag. If you need guidance in the brain extraction, send me an email.  

        5) Now, if you look at the bvecs file it will have 31 entries.  Copy the file to, e.g., bvecs1000 and bvecs2000.  Edit bvecs1000 such that the first line for b0 is removed and then keep the first 15 lines that will correspond to your ~b1000 weighted images as reordered by DSI Studio.  Similarly, edit the bvecs2000 to keep only the last 15 lines.

        6) You will see that I've edited your DKEparameters.dat file such that we are now reading in NifTI (not Bruker), and I've specified the two different bvecs files, and after looking at the b0 images, I set the intensity threshold to 1000.

        7) Then finally run DKE as per usual.

        Caveats:
        1) DKE does not yet support a different b-value for each direction, and you will note that in PV6.0.1 every direction has a slightly different b-value.  The difference seems to consistently be under 3%, but nonetheless ultimately we should be properly accounting for this (hopefully in a future DKE release Emilie??? :)

        2) In this pipeline we haven't done any motion correction and I'm not sure if DSI Studio does this properly.  This could be completed in FSL or SPM.

        Other advice:
        I don't think your parameter maps look quite right (perhaps too high res/too low SNR?). After looking at your methods file, I have some other advice regarding acquisition parameters (e.g., you should use repetitions, not averaging so you can do motion correction), but if you're interested, perhaps best to send me an email so we don't clog up the DKE forum!
        Attachment: Clem_test.zip

        • Aug 31, 2017  09:08 AM | Clementine Lesbats - University of Liverpool
          RE: 'error using dke (line 47)' with Bruker f
          Amazing! Thank you so much Kirk. Very detailed step-by-step explanation, hopefully it will be useful for others too.
          I could get the maps successfully! :)

          Clementine

  • Aug 7, 2017  06:08 AM | han
    breast dki
    Hi,

    Has anyone used this software for post processing of breast dki sequences (5 b values but only 3 directions)?


    Thanks

    • Aug 7, 2017  11:08 AM | Russell Glenn - Medical University of South Carolina
      RE: breast dki
      Hi Han,

      This software will not work for that data. To estimate the diffusion and kurtosis tensors, you would need at least 21 unique diffusion weighted images. For your data, you could estimate the directional diffusion and kurtosis by fitting the log signal to a quadratic. The tensors are particularly useful for white matter because of the structural anisotropy, but I assume in other tissue, such as breast, the directional values are what you would want.

      Hope that helps,

      Russell Glenn

  • Jun 28, 2017  07:06 PM | wafaa sweidan
    Index exceed matrix dimensions
    Hello, 

    I  have (neurite orientation dispersion and density imaging) NODDI data with following b-values:
    b=0 (9 averages), b=711 (30 averages) and b=2855 (60), total of 99 gradient vector. 

    I generated the 4d Nifti for the diffusion image and when I try to fit it using DKE with following parameters (B=0 threshold=50, weak median filtering, tensor constrained linear weighted fitting, gradient vectors: user defined and I upload the bvec file (and i made sure to remove gradients for b0) it gives me the following error:
    index exceed matrix dimensions
    Error in dke estimate line 188
    Error in dke line 182
    I think the problem arises from the user defined gradient vectors, but I have to insert my gradient vectors
    Can anyone please inform me on the problem and try to help in figuring the solution out?

    Regards, 
    Wafaa

    • Jun 29, 2017  01:06 AM | Kirk Feindel - University of Western Australia
      RE: Index exceed matrix dimensions
      Hi Wafaa,

      I think there may be a couple of issues.

      1) Did you average your 9 B0 images so that there is only one at the beginning of the 4D Nifti?
      2) I can't remember 100% if you can use a different number of directions for each b value, but if you can, I think you'll need two separate gradient vector files since you use 30 directions and then 60 directions. (Look at previous posts in this forum - I think this query has been addressed previously).

      Also, if you attach your parameters file, 4D Nifti, and bvecs files people can try to debug it for you.

      Cheers,

      Kirk

      • Jun 29, 2017  02:06 PM | wafaa sweidan
        RE: Index exceed matrix dimensions
        Dear Krik, 

        Thank you so much for your reply,

        I am a beginner in using this software, so I will be really grateful if you assist me additionally.

        I understand we have to do averaging of B0 (which I did not do before), however, concerning the different number of directions, I created 2 separate txt files each corresponding to a b-value gradient, and then I opened a command line to insert my parameters (the ndir, indexes, bvals from my DKE_paramters file) but nothing is defined in the cmd.exe, is this the right way to run dke from command line?

        The problem now is that even with another set of data (1 B0, 20 directions b=1000, and 20 directions B=2000), the program is assuming that I have 40 direction for each b-value (as you can see in the SAM_DKE_parameters), so I do not know how to solve this issue. I am simply inserting the bvec file (which have 20 directions for b1000 and 20 for b2000) into the user-defined gradient vectors. 

        I attached the parameters, 4d nifti and bvecs for the dki data set (1b0, 20 dir b=1000, and 20 dir b=2000) and data for noddi which I am using to estimate kurtosis (9b0, 30 b=711, and 60 b=2855). 

        Thank you so much in advance, 
        Regards, 
        Wafaa
        Attachment: dki and noddi.zip

        • Jun 29, 2017  07:06 PM | wafaa sweidan
          RE: Index exceed matrix dimensions
          Hello Krik, 

          It worked through the terminal!

          One more thing I would like to ask you about is that how we view the colored map?
          in FSL, vector files are usually generated for DTI maps and we use them to view FA colored map for example. 

          Someone suggested ImageJ, but still DKE gives only maps and doesnt give the principle vectors. So how can we view the colored maps?

          Thanks, 
          Wafaa

          • Jun 30, 2017  02:06 AM | Kirk Feindel - University of Western Australia
            RE: Index exceed matrix dimensions
            Hi Wafaa,

            Yes, you get parameter maps from DKE, which can be viewed in ImageJ and you can choose whatever color lookup table you like.  In FSL, the vector maps you get are after running BEDPOSTX for the tractography?  DKE doesn't do fiber tracking - you need to use their Fiber Tracking module and from that output you can look at orientation distribution functions, etc.

            If you want to do quick fiber tracking with your data (not making use of the non-Gaussian information), you can also use DSI Studio.

            Cheers,

            Kirk

  • Jun 29, 2017  05:06 PM | wafaa sweidan
    Running DKE through a terminal
    Hello, 

    Can anyone who used DKE through a terminal (like when we have to have 2 separate txt files for each b value and we have modified the DKE_parameters file) share a sample of how we start it?
    Its suggested in the manual to use cmd.exe but I do not know the exact steps and where to start from?

    Thank you so much in advance, 
    Regards, 
    Wafaa

  • Jun 28, 2017  03:06 PM | wafaa sweidan
    brain extraction of diffusion images
    Hello, 

    I did eddy current correction for the 4D.nii nifti image of my diffusion weighted images, but when I do brain extraction, the image will be 3d.nii, which I cant use in the dke software. so is skull removal prior to kurtosis estimation a necessity or does not have an effect on results?

    • Jun 28, 2017  08:06 PM | Riccardo De Feo
      RE: brain extraction of diffusion images
      Hello Wafaa
      I take you are talking about FLS for the eddy correction and brain extraction? If I understand what you want to do, you need to generate a mask when you use the brain extraction function, then you can use fslmaths to multiply that mask for every volume in the 4D nifty.

      • Jun 29, 2017  01:06 PM | wafaa sweidan
        RE: brain extraction of diffusion images
        Hello Ricardo, 

        Thank you so much for your reply, it helped !

        Regards, 
        Wafaa

  • Jun 22, 2017  04:06 PM | Riccardo De Feo
    Unexpected MATLAB expression error
    Hello,

    I recently downloaded the kurtosis estimator and I'm experiencing a problem with the command line dke tool on Linux: whenever I try to run "./dke dke_parameters.dat" an error is returned:


    Diffusional Kurtosis Estimator (DKE) version 2.6.0, November 2014
    Error using dke (line 47)
    Error: Unexpected MATLAB expression.

    MATLAB:m_missing_operator


    I'm trying to process nifty 4D volumes with the attached parameters file, while the gradient vectors file is a list of rows in the form of tab separated x y z coordinates. Following the b0 volume my diffusion data has 8 non-zero b-values and 15 directions for each b-value. I tried to tweak my parameters but I failed to see what I'm missing, so I would really appreciate if someone could help me figure out the cause of this issue.

    Thank you

    RDF
    Attachment: dke_parameters.dat

    • Jun 26, 2017  03:06 AM | Kirk Feindel - University of Western Australia
      RE: Unexpected MATLAB expression error
      Running from a linux terminal is a bit different:

      Open a terminal cd to the folder that contains the executables. Run dke with ./run_dke.sh path_to_matlab_compiler DKEParameters.dat

      • Jun 26, 2017  11:06 AM | Riccardo De Feo
        RE: Unexpected MATLAB expression error
        Thank you for your response. I tried to use that script but regardless of that I keep running into the same error. These are the exact commands I tried:

        ./run_dke.sh ~/MATLABcomp/v717 dke_parameters.dat

        And I tried setting up the LD_LIBRARY_PATH environment variable manually (still using bash) as

        export LD_LIBRARY_PATH=~/MATLABcomp/v717/runtime/glnxa64:~/MATLABcomp/v717/bin/glnxa64:~/MATLABcomp/v717/sys/os/glnxa64:~/MATLABcomp/v717/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:~/MATLABcomp/v717/sys/java/jre/glnxa64/jre/lib/amd64/server:~/MATLABcomp/v717/sys/java/jre/glnxa64/jre/lib/amd64
        export XAPPLRESDIR=~/MATLABcomp/v717/X11/app-defaults

        then

        ./dke dke_parameters.dat

        But in both cases I get:

        Diffusional Kurtosis Estimator (DKE) version 2.6.0, November 2014
        Error using dke (line 47)
        Error: Unexpected MATLAB expression.

        MATLAB:m_missing_operator

        I don't think there is a problem with the MCR path, or I would simply get a "cannot open shared object file: No such file or directory" error, as if I simply misspelled it.

      Jun 26, 2017  02:06 PM | Kirk Feindel - University of Western Australia
      RE: Unexpected MATLAB expression error
      If you can attach your 4D nifti and gradient vecs then I can try running on my computer.  Sometimes there are character issues in the parameter file when switching between windows/mac/linux platforms.

      • Jun 26, 2017  03:06 PM | Russell Glenn - Medical University of South Carolina
        RE: Unexpected MATLAB expression error
        Totally agree Kirk. In this case it is in the DTI fitting method parameters:

        dti_method.b_value = 200 400 600 800 1000 1500;
         
        should be written as

        dti_method.b_value = [200 400 600 800 1000 1500];

        Super minor. Hopefully it will work with this change.

        Best,

        Russell

  • Aug 28, 2015  08:08 PM | Christina Gancayco
    Reconstructing fa.nii from DT.mat and KT.mat
    Hello,

    I was wondering how one would reconstruct the FA map from the diffusion and kurtosis tensor MAT files? I ran the DKE for several subjects but left the map interpolation on, and I was hoping reconstructing fa.nii would be faster than running the DKE again without map interpolation.

    Thanks!
    Christina

    • Aug 29, 2015  06:08 PM | Russell Glenn - Medical University of South Carolina
      RE: Reconstructing fa.nii from DT.mat and KT.mat
      Hi Christina,

      You just need to calculate the fa parameter for each column of the DT.mat matrix and then reconstruct the image. One potential solution if you have MATLAB is to download spm8 and then run the script below. Alternatively, you may reconstruct the diffusion tensor for each voxel; dt = [DT(1,i) DT(4,i) DT(5,i);DT(4,i) DT(2,i) DT(6,i);DT(5,i) DT(6,i) DT(3,i)];, and then get the eigenvalues and solve the conventional equation. Hope that helps...

      Best,

      Russell

      %fn_img: file path 'template' image (.nii) (eg b0 3D or 4D)
      %fn_dt: file path to DT.mat (.mat)
      %fn_fa: file path to new fa image to write (.nii)

      hdr = spm_vol(fn_img);
      load(fn_dt)
      idx = sqrt(sum(DT.^2))>0;
      fa = zeros(1,prod(hdr(1).dim(1:3)));
      fa(idx) = sqrt(3.*sum([DT(1:3,idx)-repmat(sum(DT(1:3,idx))./3,3,1);repmat(DT(4:6,idx),2,1)].^2)./...
      sum([DT(1:3,idx);repmat(DT(4:6,idx),2,1)].^2)./2);
      hdr(1).fname = fn_fa;
      hdr(1).dt = [16 0];
      spm_write_vol(hdr(1),reshape(fa,hdr(1).dim(1:3)));

      • Sep 8, 2015  07:09 PM | Christina Gancayco
        RE: Reconstructing fa.nii from DT.mat and KT.mat
        Worked like a charm. Thanks!

        May 23, 2017  06:05 PM | westkl
        RE: Reconstructing fa.nii from DT.mat and KT.mat
        Can you provide matrix definition similar to dt = [DT(1,i) DT(4,i) DT(5,i);DT(4,i) DT(2,i) DT(6,i);DT(5,i) DT(6,i) DT(3,i)];, for the kurtosis tensor (KT)? 

        Thanks!
        Kathryn

        • May 23, 2017  07:05 PM | Russell Glenn
          RE: Reconstructing fa.nii from DT.mat and KT.mat
          Hi Kathryn,
           
          Sure.  Each column is given by
           
          W(:,i) =  [W1111, W2222, W3333, W1112, W1113, W1222, W1333, W2223,W2333, W1122, W1133, W2233, W1123, W1223, W1233]^T, where W is the kurtosis tensor for the ith voxel.
           
          Best,
           
          Russell

  • Apr 28, 2017  01:04 PM | Colleen Buckless
    Different dimensions for output
    Hi All,
    The output I received from DKE had different dimensions for each subject in which each subject had it's own unique dimensions. All the subjects went into DKE as nifti and all had the same dimensions, and I am confused on what could have caused the dimensions to change. I used the default settings for the parameters. Does anyone know what could have happened to cause this?
    Thanks,
    Colleen

    • May 1, 2017  12:05 AM | Emilie McKinnon - MUSC
      RE: Different dimensions for output
      Hi Colleen, 

      Try turning off the interpolation option. 

      Ps: Happy to see Kirk helped resolve the other problem.

      Best, 
      Emilie

  • Apr 6, 2017  08:04 PM | Colleen Buckless
    problem with eddy corrected data
    Hi All,
    I am having problems using data that has been eddy corrected using FSL. When I run DKE on the raw nifti files, DKE works fine, but when I try using the eddy corrected version, I get an error message  saying:
    "Reading input images... Undefined function or variable 'niftifile'.
    Error in read_nii (line 52)
    Error in dke_estimate>read_img_set_nii (line 1824)
    Error in dke_estimate (line 157)
    Error in dke (line 182)
    MATLAB:UndefinedFunction"
    Any ideas?
    Thanks,
    Colleen

    • Apr 7, 2017  11:04 AM | Emilie McKinnon - MUSC
      RE: problem with eddy corrected data
      Hi Colleen, 

      I am not familiar with how eddy correction changes the structure of the nifti file. Could you send me an example of the 4D nifti you are trying to use? 

      Best, 
      Emilie

      • Apr 7, 2017  12:04 PM | Colleen Buckless
        RE: problem with eddy corrected data
        Hi Emilie,
        I have attached an example of the 4D nifti file that has been eddy corrected in FSL.
        Thanks,
        Colleen
        Attachment: test_subject.nii.gz

        • Apr 10, 2017  02:04 PM | Colleen Buckless
          RE: problem with eddy corrected data
          Hi Emilie,
          Were you able to download and test the eddy corrected 4D nifti file I sent?
          Thanks,
          Colleen

          • Apr 10, 2017  03:04 PM | Emilie McKinnon - MUSC
            RE: problem with eddy corrected data
            Yes! Can you send your dke_parameters file as well and your gradient table? This will allow me to run DKE in debug mode from this side so I can see what is going on.
             
            Thanks,
            Emilie

            • Apr 10, 2017  04:04 PM | Colleen Buckless
              RE: problem with eddy corrected data
              Here is the gradient table. This data was acquired on a Phillips 3T.

              • Apr 10, 2017  04:04 PM | Colleen Buckless
                RE: problem with eddy corrected data
                Here is the dke_parameters file.
                Thank you for your help!
                Colleen
                Attachment: DKEParameters.dat

                • Apr 11, 2017  05:04 PM | Colleen Buckless
                  RE: problem with eddy corrected data
                  Hi Emilie,
                  Were you able to get the files I sent? Any luck with trying to figure out the problem with my data?
                  Thanks,
                  Colleen

                  • Apr 13, 2017  05:04 PM | Colleen Buckless
                    RE: problem with eddy corrected data
                    He Emilie,
                    I haven't heard from you in a while. Have you had a chance to test my data?
                    Thanks,
                    Colleen

                    • Apr 13, 2017  06:04 PM | Emilie McKinnon - MUSC
                      RE: problem with eddy corrected data
                      Hi Colleen! 

                      I haven't had the chance to run your data just yet, I will let you know as soon as I ran it. 

                      Emilie

                      • Apr 28, 2017  05:04 AM | Kirk Feindel - University of Western Australia
                        RE: problem with eddy corrected data
                        Hi Colleen,

                        I just processed your data. I think the problem was that you were trying to feed in a compressed nifti (i.e., nii.gz).  You just need to change the file type like this:

                        fslchfiletype NIFTI input.nii.gz

                        I also noticed a few other things:

                        (1) your data is non-isotropic, but you apply isotropic smoothing with fwhm_img= [3.375 3.375 3.375]

                        (2)  if you plan to coregister to an atlas after DKE I think you should turn off map_interpolation

                        (3) the default setting for median_filter_method is quite strict and I think you should trying changing from strong (2) to weak (1)

                        Cheers,

                        Kirk

  • Apr 10, 2017  10:04 PM | sevim sahin - Kocaeli University
    Mean Kurtosis value seems wrong.
    Dear all,

    I have a problem with ROI analysis using MIPAV. The mean kurtosis value is more than 3.  Should I try backround correction? Any idea?

    Thanks inadvance.

  • Apr 3, 2017  09:04 PM | Colleen Buckless
    Preprocessing for DKI
    Hi All,
    I am new to processing DKI data and looking to develop a pipeline for our data. From what I have read about DKE, it appears that DKE doesn't perform corrections for motion, distortions, and eddy currents. Is this true? If so, how would you recommend correcting for them? Also, is it necessary to perform these corrections for DKI data?
    Thanks,
    Colleen

    • Apr 3, 2017  11:04 PM | Emilie McKinnon - MUSC
      RE: Preprocessing for DKI
      Hi Colleen, 

      DKE accepts two different formats as input: Dicom or 4D nifti. 

      When using DKE starting from Dicoms, motion correction will be performed using basic rigid registration algorithms. If you would like more advanced preprocessing techniques, I would suggest using FSL's toolboxes and running DKE with a 4D nifti that is preprocessed. 

      All diffusion sequences are sensitive to distortion, so this will not be any different for DKI data. Our lab does not tend to correct for eddy currents as we use a twice refocused sequence where these effects are minimized. 

      Best, 
      Emilie

  • Jul 22, 2015  02:07 AM | Tang LF
    Gradient vectors
    Dear,
    We are exploring the kurtosis imaiging. We got DKI data for a protocol with 15 gradient direction. We use dcm2nii to find the gradient table, which is a .bvec file with a matrix of the size[30x
    3]. Then my question is how to transpose this file to the matrix[15x3] that every row corespons to a Gx, Gy,Gz?

    Best regards.
    Tang

    • Jul 24, 2015  12:07 PM | Emilie McKinnon - MUSC
      RE: Gradient vectors
      Dear Tang,

      You can use any numerical computing environment such as matlab, but you can even do it with a program such as excel.

      Best,
      Emilie

      Mar 31, 2017  08:03 AM | liu xiaojing
      RE: Gradient vectors
      Hi Tang,
                I get our DKI data from 3 T GE-750 , 2 b-values of 1000 and 2000 (15 directions) . But when I use the dim. software, I only found 1 b-value of 2000, so it makes me confused. I cannot process it in DKE. Please give me some suggestion about it, I will be appreciated deeply. 
      Best regards,
      jing

      • Mar 31, 2017  12:03 PM | Emilie McKinnon - MUSC
        RE: Gradient vectors
        Hi Tang, 

        Have you tried using dcm2nii to convert your images? 

        Best,
        Emilie

  • Mar 10, 2017  11:03 PM | Samantha Cunningham
    Incorrect DKE Error: idx_gradients
    Hello,
    I am trying to run my nifti data set using DKE for the first time (using the GUI in Windows) and am encountering the following error:

    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: March 10, 2017 17:53:46
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Error using dke_estimate (line 134)
    Number of elements of idx_gradients must match the number of nonzero b-values
    in bval!

    Error in dke (line 182)

    However, the idx_gradients error is incorrect. I am using the bvals below (which includes 42 total nonzero values). Since there are also 42 elements in my "idx_gradients", I don't understand where this error is coming from. Could it be because the 0 bvals are dispersed throughout the bvals file?

    Thank you for your help!
    Sam

    Full error script:

    *** user-defined gradient set ***
    reading C:/DKE Analysis/R01881620/20151123_132350DTI22mm45dirsAPs018a1001.bvecs
    % Fri Mar 10 05:53:34 PM
    studydir = 'C:/DKE Analysis/R01881620/';
    subject_list = {''};
    preprocess_options.format = 'nifti';
    preprocess_options.fn_nii = '20151123_132350DTI22mm45dirsAPs018a1001.nii.gz';
    fn_img_prefix = 'rdki';
    bval = [0 200 200 200 200 200 200 0 500 500 500 500 500 500 0 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100];
    ndir = 45;
    idx_1st_img = 1;
    Kmin = 0;
    NKmax = 3;
    Kmin_final = 0;
    Kmax_final = 3;
    T = 50;
    find_brain_mask_flag = 1;
    dki_method.no_tensor = 0;
    dki_method.linear_weighting = 1;
    dki_method.linear_constrained = 1;
    dki_method.nonlinear = 0;
    dki_method.linear_violations = 0;
    dki_method.robust_option = 0;
    dki_method.noise_tolerance = 0.09;
    dti_method.dti_flag = 0;
    dti_method.dti_only = 0;
    dti_method.no_tensor = 0;
    dti_method.linear_weighting = 1;
    dti_method.b_value = 1e+003;
    dti_method.directions{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    dti_method.robust_option = 0;
    dti_method.noise_tolerance = 0.09;
    fn_noise = '';
    fwhm_img = [3.375 3.375 3.375];
    fwhm_noise = [0 0 0];
    median_filter_method = 2;
    map_interpolation_method.flag = 1;
    map_interpolation_method.order = 1;
    map_interpolation_method.resolution = 1;
    fn_gradients = 'C:/DKE Analysis/R01881620/20151123_132350DTI22mm45dirsAPs018a1001.bvecs';
    idx_gradients{1} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{2} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{3} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{4} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{5} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{6} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{7} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{8} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{9} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{10} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{11} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{12} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{13} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{14} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{15} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{16} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{17} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{18} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{19} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{20} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{21} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{22} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{23} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{24} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{25} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{26} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{27} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{28} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{29} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{30} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{31} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{32} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{33} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{34} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{35} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{36} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{37} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{38} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{39} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{40} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{41} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];
    idx_gradients{42} = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45];

    command line: dke DKEParameters.dat
    Diffusional Kurtosis Estimator (DKE) version 2.6.0, February 2015
    Start date and time: March 10, 2017 17:53:46
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Error using dke_estimate (line 134)
    Number of elements of idx_gradients must match the number of nonzero b-values
    in bval!
    Error in dke (line 182)

    • Mar 13, 2017  12:03 PM | Emilie McKinnon - MUSC
      RE: Incorrect DKE Error: idx_gradients
      Hi Samantha, 

      Couple of things: 

      - DKE currently does not support interleaved b0 images. You will have to manually average those ( or using matlab) and put this average up front in your 4D nifti.
      - It looks like each b value has a different number of gradient directions. In this scenario you need to make a gradient table text file for each (excluding b0) 
      fn_gradients = {'C:/DKE Analysis/R01881620/b200.txt','C:/DKE Analysis/R01881620/b500.txt','C:/DKE Analysis/R01881620/b1100.txt'} ;
      - Additionally you will need to change ndir to ndir=[6 6 33];  and bval=[200 500 1100]. 
      - Lastly idx will need to look like the following: 
      idx_gradients{1}=[1:6];
      idx_gradients{2}=[1:6];
      idx_gradients{3}=[1:33];

      The only way to make these changes is to run DKE through the terminal. 
      The reason why it is a little more complicated, is because traditionally most data has the same amount of gradients for each bvalue, so the way it is currently set up in your data set, DKE thinks you have 45 gradient directions for each b value which in your case is 42 times ( if you write bval that way).

      Does that make sense? 
      Best,
      Emilie

  • Jan 24, 2017  09:01 AM | Shi Li
    2 b values for DKI
    dear all:
    I want to know is't possible for DKE to process DKI data with only two b-values[0,2000].the data was accured with GE and 15 directions.while the .bval file I get from dcm2niigui have 1B0 and 30 non-B0(2000),and the .bvec file have 30 different grident vectors,which made me confused.I run the DKE with the .bvec(user-defined) and b values[0 2000].and the process of runing is ok,but the processed maps have some problems.can anybody give me a help with this issue.

    thanks for reading the question.

    • Jan 24, 2017  09:01 AM | Shi Li
      RE: 2 b values for DKI
      here is my .bval and .bvec files from dcm2niigui,and the KM map with problem.
      Attachment: DKI.rar

      Jan 25, 2017  02:01 PM | Emilie McKinnon - MUSC
      RE: 2 b values for DKI
      Dear Shi Li,

      You will not be able to do DKI processing with a only 1 diffusion weighted image (b2000), there is a minimum of two. You could use your data in a standard DTI processing pipeline, although I would not recommend this, as your b-value is relatively high (you could do this with DKE but there are some other programs that might are build for this type of processing, such as diffusion toolkit or MRtrix). If you are trying to do tractography, I would suggest you look into CSD ( Constrained spherical deconvolution) to process data with only one B-value (using mrtrix).
      Hope this helps,
      Emilie

  • Oct 8, 2016  10:10 AM | Ho-Joon Lee
    Abnormal results
    Hi. I'm trying to process a diffusion data, from an rat brain acquired from a Bruker scanner. 
    I have manually changed the file order, B0, B1000, and B1600 as mentioned in the FAQ and documentations. 
    I split the files, removed 4 of the 5 B0 images, and re-ordered them in a way that matches the provided sample image. 
    I have a 30 direction gradient vector, which makes the process run without problem. 

    However, the processed maps, they have some problems. 
    Can anybody help me with this issue, or does anyone similar experiences and have manage to get the things going right? 

    Thanks for the time spent reading this question.
    Attachment: dmean.nii

    • Nov 21, 2016  02:11 PM | Emilie McKinnon - MUSC
      RE: Abnormal results
      Dear Ho-Joon, 

      I apologize for the delay in answering this question. How high is your background threshold T?

      T = 50; % background threshold (default: 50); voxels with b = 0 intensity values above this threshold (after optional connected component analysis) are processed

      Voxels with an intensity value above this threshold T will be removed and result in a value of zero.  Additionally, in stead of removing 4 of the 5 B0 images, it is more common to create an image that is an average of all 5 images. 

      If the background threshold is not what is causing your problem, please respond with your dkeparameters file, this will help me in finding another possible cause for your problem. 

      Best, 
      Emilie

      Jan 24, 2017  08:01 AM | Shi Li
      RE: Abnormal results
      Hi,I am facing the same problems,do you now have some ideas about how to resolve it?I think there may be soming wrong with the grident table,but I'm not sure.I receive the same result as you using my own gridents table(get from dcm2niigui),while it's ok when I use the grident table of DKE,only the quality of the image is very bad.
      if you have the right methods,please give me an response.I would be thankful for that.

      • Jan 25, 2017  02:01 PM | Emilie McKinnon - MUSC
        RE: Abnormal results
        Hi Shi Li, 

        If you used different gradient directions during aqcuisition than the ones incorporated in DKE (those are the standard Siemens Tim Trio tables), it is important you use your own gradient tables. After converting your data with dcm2nii you have to transpose your matrix before importing it in DKE. Specifically, dcm2nii outputs a table that is 3xN and DKE expects a table that is Nx3. If your problem persists, please provide us with your DKEparameters file and an example output map. 

        Best, 
        Emilie

  • Dec 7, 2016  09:12 AM | Ming-Liang Wang
    bruker DKI data processing
    I am a newer of bruker data postprocesing. Recently, I scaned a few rats in bruker 7.0T scanner. I wonder if I can process the bruker DKI data in the GUI. Actually, I got the DCM format DKI data exported from the scanner. I converted the DCM data to Nifti data and try to process the DKI data in the GUI. But the DCM data order seems to be different from the required order of DKE. Besides, we could not get the gradient bvctor file. If bruker data could not be processed in the GUI, how could I process the bruker data in command window. For example, what is the file format  exported from the bruker scanner? How to deal with the order of the images? I am not fammilar with the command. So, if anyone could tell me the detailed process. Thans a lot!

    • Dec 7, 2016  02:12 PM | Emilie McKinnon - MUSC
      RE: bruker DKI data processing
      Hello Ming-Liang,

      It is possible to run DKE with Bruker images. You will have to use the command window. Everything is explained in detail in our manual: http://www.nitrc.org/docman/view.php/652/1918/User%20Manual%202.6.pdf

      You can also find some information in our frequently asked questions section: 
      http://academicdepartments.musc.edu/cbi/...


      Let me know if you still run into problems.

      Thanks, 
      Emilie

      • Dec 16, 2016  07:12 AM | Ming-Liang Wang
        RE: bruker DKI data processing
        Dear Emilie,

        Sorry to trouble you again. I have come up with some new problems. As I finally could run DKE in command window with Dcotor Nie in MUSC, it could not run successfully. It sent an error text as follows.

        Start date and time: December 16, 2016 13:56:51
        Diffusional Kurtosis Estimator (DKE) version 2.6.0
        Converting input Bruker images to NIfTI... { Error using textread (line 167)
        File not found.
        Error in dke_preprocess_bruker>brukeracq (line 303)
        Error in dke_preprocess_bruker>bruker2nii (line 212)
        Error in dke_preprocess_bruker (line 64)
        Error in dke (line 176)
        }
        MATLAB:textread:FileNotFound

        Enclosed are the DKE parameter file. Could you spare some time to read these files to help me find the problem?
        Thank you very much! Looking forward to your reply as soon as possible.

        Best regards
        Ming-Liang Wang
        Attachment: dke_parameters.dat

        • Dec 16, 2016  03:12 PM | Emilie McKinnon - MUSC
          RE: bruker DKI data processing
          Hi Ming-Liang, 

          The problem is that Matlab can not locate your images because the path is incorrect or incomplete. 

          Try adding a slash after studydir = 'C:\Users\wangmingliang\Desktop\DKEprocessing\';  
          Also make sure your 2dseq and methods file are located in this folder DKEprocessing.

          Hope this helps,
          Emilie

          • Dec 17, 2016  03:12 AM | Ming-Liang Wang
            RE: bruker DKI data processing
            Dear Emilie,

            Thank you for your timely reply. You are right about the problem. After I complement the full studydir to ".../pdata/1", it began to run. After runing about 35 minutes, however, the DKE end up with a new error. The dke log erroe file is as follows:

            {Error using nifti/create>create_each (line 29)
            Unable to write header for
            "C:\Users\wangmingliang\Desktop\DKEprocessing\DKIdata\pdata\1\intermediate_processing\dki_avg2_nii\adki_500.nii".
            Error in nifti/create (line 15)
            Error in spm_create_vol>create_vol (line 162)
            Error in spm_create_vol (line 16)
            Error in spm_write_vol (line 82)
            Error in dke_preprocess_bruker>image_avg (line 294)
            Error in dke_preprocess_bruker (line 109)
            Error in dke (line 176)
            }

            I wonder if you could tell me the error of my DKI data processing. I am really grateful for all your kind help.

            Best regards
            Ming-Liang Wang
            Attachment: dke.log

  • Dec 5, 2016  07:12 PM | sevim sahin - Kocaeli University
    dke_ft error
    Hi all,
    I had the error on DKE_ft, so I couldnt run it. 

    C:\Users\kagan>C:\Users\kagan\Desktop\fibert\dke_ft.exe ft_parameters.txt
    Error using textscan
    Invalid file identifier. Use fopen to generate a valid file identifier.

    Error in readvariables (line 7)
    Error in dke_ft (line 18)

    any help would be appreciated.


    and the ft_parameters file; 


    %--------------------------------------------------------------------------
    %USER OPTIONS
    %--------------------------------------------------------------------------
    studydir = 'C:\Users\kagan\Desktop\test/'; %Full path to directory containing DT.mat, KT.mat, and fa.nii files.
    subject_list = {''}; %Specify subject numbers (i.e. {'Subject01','Subject02','Subject03',...}).

    %ODF Optimizatinon
    odf_optimization = 1; %Analyze the kurtosis dODF (1) or skip odf optimization (0). This step must be performed prior to tractography.
    sd = 4; %[3,4, or 5] Sampling distribution to use. See sphericalgrid3(4,5).m documentation for more info.
    quasiNewton = 1; %Apply non-linear optimization to increase accuracy of peak detection (1) or use orientations directly from the pre-defined sampling distribution (0).
    radial_weight = 4; %Radial weighting power.Recommended radial_weight = 4.
    release_memory = 0; %Do not release memory (0), release memory after each subject (1), or release memory more frequently (2). See User's Guide for additional info.
    wrt_flg = 1; %Write outputs (1) or don't write outputs (0).
    pre_name = ''; %String to append to the beginning of output names.
    post_name = ''; %String to append to the end of output names.
    %Tractography
    tractography_flg = 1; %Perform tractography (1) or don't perform tractography (0).
    fa_threshold = 0.1; %FA threshold.
    angle_threshold = 35; %Angle threshold in degrees.
    trk_length = 20; %Minimum tract length in mm.
    step_size = 1; %Step size in mm (0 defaults to half of the voxel length).
    trk_mask = ''; %Path to tracking mask to apply in addition to other tract termination criteria defined above. Should be in the same orientation as the fa.nii image.
    seednum = 1E5; %Number of random seed points in the tracking mask.
    shift = 0.5; %Shift applied to voxel coordinates in .trk file.
    output_DTI_trks = 1; %Include tractography performed from just the diffusion tensor (1) or don't (0).
    image_orientation = 'LAS'; %Orientation of input image volumes. By convention, spm writes images in 'LAS.'
    odf_orientation = 'LAS'; %Orientation of the gradient table used to estimate the diffusion and kurtosis tensors. If SPM is used to estimate the gradient tables, this should be 'LAS.'
    %Make DSI Studio .fib file
    make_fib_file = 1; %Make .fib file to read in DSI Studio (1) or skip this step (0).
    save_odfs = 1; %Save dODFS in .fib file (1) or not (0). This only affects visualization as orientations are still saved for tractography.
    scale_odf = 0.5; %Affects overall size of odfs in .fib file. This only affects visualization.
    odf_size = 20000; %Size of odf_n variables. Reduce this if there are issues with RAM.
    odf_res = 'low'; %{'low' or 'high'}; Number of points saved in ODFs ~ only affects visualization. Use 'low' to reduce memory requirements and use 'high' for the smoothest dODF surface renderings.

    • Dec 7, 2016  02:12 PM | Emilie McKinnon - MUSC
      RE: dke_ft error
      Hi Sevim,

      This error occurs when DKE_FT can not read your text files. Check all your paths. Is ft_parameters.txt stored in C:\Users\kagan? Otherwise you need to provide the full path length. Also, I believe you need to be consistent with your slashes in your studydir. 

      Best, 
      Emilie

      • Dec 7, 2016  06:12 PM | sevim sahin - Kocaeli University
        RE: dke_ft error
        Dear Emilie,

        Yes you are right and I fixed it.

        thank you!

        Best,
        Sevim

  • Aug 1, 2016  05:08 PM | Batil Alonazi
    Value MK in DKI
    I try to extract MK value for my Data I found some subjects have negative value more than 1 is that okay in MK_DKI?
    for example some value -19 what I know the FA value between 0-1 ? what the range of MK if there is Range ?
    thx

    • Aug 26, 2016  12:08 PM | Emilie McKinnon - MUSC
      RE: Value MK in DKI
      Where are these voxels located? Normally Mean kurtosis values range between 0-3. We don't expect kurtosis to be negative, but it happens sometimes because of noise in the data that results in poor fitting results. Can you send me your dke parameters file?

      Best,
      Emilie

      Oct 2, 2016  01:10 AM | Batil Alonazi
      RE: Value MK in DKI
      Hi pls send me your email.

  • Feb 17, 2016  11:02 PM | Shaheen Ahmed
    obtain colored map
    I was able to obtain the Kurtosis and Diffusivities map. Now how should I make it color?

    • Aug 26, 2016  12:08 PM | Emilie McKinnon - MUSC
      RE: obtain colored map
      Look into the programs MRIcron or imageJ to do post processing. 

      Best,
      Emilie

  • Aug 17, 2016  03:08 PM | Chrystelle Po - ICube
    impossible to run DKE :(
    Hi,

    I would like process some data with DKE which was working on my computer few month ago.
    Now, I have the following message in "DKEGUI.exe" window:
    "Start date and time: August 17, 2016 14:10:47
    Diffusional Kurtosis Estimator (DKE) version 2.6.0
    Reading input images... complete
    Filtering input images... complete.
    Processing voxels... {Error using matlabpool (line 144)
    Failed to open matlabpool. (For information in addition to the causing error,
    validate the profile 'local' in the Cluster Profile Manager.)

    Error in dke_estimate (line 403)
    Error in dke (line 182)
    Caused by:
    Error using
    distcomp.interactiveclient/pGetSockets>iThrowIfBadParallelJobStatus (line
    114)
    The interactive parallel job finished without any messages.
    }
    parallel:cluster:MatlabpoolRunValidation"

    I reinstalled DKE and Matlab compiler runtime. No change :(

    Could you help me?

    Cordially,
    Chrystelle

    • Aug 26, 2016  12:08 PM | Emilie McKinnon - MUSC
      RE: impossible to run DKE :(
      Dear Chrystelle,

      Did you download the same MCR version 7.17?

      Best,
      Emilie

  • May 7, 2016  02:05 PM | Chenxi Zhao - Beijing Normal University
    DKE installation on linux
    hi,
    I am trying to install DKE on ubuntu 14.0. I wonder if there is a GUI on this OS, or I have install DKE in a wrong way?
    Looking forward to your reply!

    • May 7, 2016  06:05 PM | Emilie McKinnon - MUSC
      RE: DKE installation on linux
      HI,

      I am sorry we only have a gui for windows, only command line for linux and mac!

      Let me know if you have any other questions.
      Emilie

      • Jul 18, 2016  07:07 AM | Chenxi Zhao - Beijing Normal University
        RE: DKE installation on linux
        Thanks for your reply. When I use the fiber tracking module and I am confused with the "shift" option. If the voxel size of my image is isotropic 2mm then how would I choose this parameter? Should I set the "shift" option to 1?

        Regards!

        • Jul 18, 2016  09:07 AM | Russell Glenn - Medical University of South Carolina
          RE: DKE installation on linux
          Hi Chenxi,

          Thanks for your question. The shift option specifies where the origin is in voxel space which does not depend on voxel dimensions, ie the voxel index is used to identify the location in the coordinate system. When this was written, the middle of each voxel was defined as the voxel index, so the middle of voxel (1,1,1) would be located at coordinate (1,1,1) and voxel (30,40,50) would be located at coordinate (30,40,50) etc. However, when we made this program compatible with other programs we noticed a small half-voxel shift in the location of the tracts because other programs defined the 'bottom' corner of the image volume to be located at (0,0,0). So for example the middle of voxel (1,1,1) was at (0.5,0.5,0.5) and voxel (30,40,50) was at (29.5,39.5,49.5), etc. So the shift parameter just converts between these two coordinates. This does not depend on your voxel dimensions in real space, ie when the coordinates are scaled to represent a real length in mm. So you should not have to change this parameter unless you feel that your tracts are shifted in some program, as the origins may not be standardized.

          I hope that helps,

          Russell

          • Jul 19, 2016  02:07 AM | Chenxi Zhao - Beijing Normal University
            RE: DKE installation on linux
            Hi,

            Thanks for your answer and it helps a lot. I have another unclear question about how to defined the gradient vector and the b-value and b-vector is attached. And if I want to use these image in dicom format, should I modify the SeriesDescription manually, cause all the images have the same SeriesDescription.
            Attachment: DKI.rar

            • Jul 20, 2016  05:07 AM | Russell Glenn - Medical University of South Carolina
              RE: DKE installation on linux
              Hi Chenxi,

              I am not exactly sure, but I think you would have to modify the SeriesDescription in each of the extra b0 images manually for DKE's preprocessing to recognize them. Perhaps someone else can answer?

              Alternatively, it looks like you've used the dcm2nii gui from MRIcron to generate the .bval and .bvec files. In this case you can use the dki_preprocessing script attached which will coregister and average nifti images in a folder with the .bval and .bvec files and generate outputs for DKE including a 4D nifti and a gradient table for DKE. The coregistration uses SPM, so you would add these scripts and SPM to the matlab path for everything to run. 

              I hope that helps,

              Russell

              • Jul 21, 2016  07:07 AM | Chenxi Zhao - Beijing Normal University
                RE: DKE installation on linux
                Hi,

                Thanks for your instant reply! I have noticed that the DKE applied  co-registration between the diffusion weighted images for a single subject. But in general, the gradient direction of each DWI volume will also be rotated according to the transformations in the co-registration to guarantee the precious result. I want to know if these problem really matters in the DKI processing?
                By the way, I found it is troublesome to identify the correct odf orientation. Is there any efficient way to work this out rather than to try all the possible orientation combinations?

                Best regards and many thanks again!

                • Jul 21, 2016  02:07 PM | Russell Glenn - Medical University of South Carolina
                  RE: DKE installation on linux
                  Hi,
                   
                  Hi Chenxi,
                   
                  You're correct that whenever you rotate the images during co-registration, the gradient tables should also be rotated, and with the coreg_DKI.m script you can get the applied affine transformation as output. If you want to apply this, just discard the translation and dilation / contraction parts of the matrix so you're just rotating the corresponding gradient vectors. I should probably add this to the preprocessing as default if you choose not to do signal averaging... 
                   
                  It is currently a little cumbersome to do this in DKE. The best way to accommodate this is to keep all of the DWIs separate during the tensor estimation, instead of signal averaging. By design, DKE assumes signal averaging of the b0 and repeat DWIs. If you feel that rotating the gradients is necessary, you can rearrange your data so it's average b0 followed by all b1000 and then all b2500 (without averaging the DWIs) and then make a 128 direction table after rotating the last half of the gradient vectors (this works because your b0s are not interleaved). Alternatively, you can opt not to co-register the DWIs. However, I have done a post-hoc analysis on some of my datasets and found the rotation applied during co-registration to result in a maximum angular deviation of only like a degree so I stopped worrying about it, but if there is a lot of motion during your scan then this could be more. The bigger concern for me is corrections from the image_orientation_patient field because these can be quite large and result in huge deviations of the gradient tables. Hopefully in the future, we will have a format to just supply the gradient vector for each image volume in the 4D nifty, with out the 'block' gradient table expectation, which will make these sort of changes much easier.
                   
                  My strategy for figuring out the orientation of the gradient tables has almost always been trial and error! which is why I didn't try to do anything automated for figuring it out (it is just supplied as a text file of numbers). In my experience, if you get the tables directly from the dicoms of from DSI studio, then the table will be in LPS, whereas if you get it from mricron, the table will be in LAS, but it can also be RAS in some animal data I have seen. It's just super confusing, especially when you have data coming from different places or use different programs to extract the tables. Fortunately, you should only have to figure it out once :)
                   
                  Best,
                   
                  Russell

                  • Jul 23, 2016  05:07 AM | Chenxi Zhao - Beijing Normal University
                    RE: DKE installation on linux
                    Thanks for your detailed answer and hope the future version of DKE to be even more powerful!

  • Mar 11, 2016  08:03 PM | Eric Miller
    Unusual FT output
    Hi everyone
    I am new to the DKE software and after trying the demo data, I am not getting expected results. I am trying to output the .fib data to use in DSI Studio. Once I load the fib file, my tracking is very unusual. For instance, seeding the post. limb of the internal capsule yields ~6 fibers in bizarre orientations despite any logical adjustments to the tracking parameters.

    I was hoping someone with experience using this combo of programs could offer some advice on the processing pipeline. When using DKE on the provided sample data set, I have left DWI Spatial smoothing on at 3.375 x 3 and strong filtering; DKI fitting is Tensor: constrained linear weighted and interpolate is off.

    My ft_parameters file is as follows:

    %--------------------------------------------------------------------------
    %USER OPTIONS
    %--------------------------------------------------------------------------
    studydir = 'C:\Users\Erik\Desktop\dki_example_dicom'; %Full path to directory containing DT.mat, KT.mat, and fa.nii files.
    subject_list = {''}; %Specify subject numbers (i.e. {'Subject01','Subject02','Subject03',...}).

    %ODF Optimizatinon

    odf_optimization = 1; %Analyze the kurtosis dODF (1) or skip odf optimization (0). This step must be performed prior to tractography.
    sd = 4; %[3,4, or 5] Sampling distribution to use. See sphericalgrid3(4,5).m documentation for more info.
    quasiNewton = 1; %Apply non-linear optimization to increase accuracy of peak detection (1) or use orientations directly from the pre-defined sampling distribution (0).
    radial_weight = 4; %Radial weighting power.Recommended radial_weight = 4.
    release_memory = 0; %Do not release memory (0), release memory after each subject (1), or release memory more frequently (2). See User's Guide for additional info.
    wrt_flg = 1; %Write outputs (1) or don't write outputs (0).
    pre_name = ''; %String to append to the beginning of output names.
    post_name = ''; %String to append to the end of output names.

    %Tractography

    tractography_flg = 0; %Perform tractography (1) or don't perform tractography (0).
    fa_threshold = 0.1; %FA threshold.
    angle_threshold = 35; %Angle threshold in degrees.
    trk_length = 20; %Minimum tract length in mm.
    step_size = 1; %Step size in mm (0 defaults to half of the voxel length).
    trk_mask = ''; %Path to tracking mask to apply in addition to other tract termination criteria defined above. Should be in the same orientation as the fa.nii image.
    seednum = 1E5; %Number of random seed points in the tracking mask.
    shift = 0.5; %Shift applied to voxel coordinates in .trk file.
    output_DTI_trks = 1; %Include tractography performed from just the diffusion tensor (1) or don't (0).
    image_orientation = 'LAS'; %Orientation of input image volumes. By convention, spm writes images in 'LAS.'
    odf_orientation = 'LAS'; %Orientation of the gradient table used to estimate the diffusion and kurtosis tensors. If SPM is used to estimate the gradient tables, this should be 'LAS.'


    %Make DSI Studio .fib file

    make_fib_file = 1; %Make .fib file to read in DSI Studio (1) or skip this step (0).
    save_odfs = 1; %Save dODFS in .fib file (1) or not (0). This only affects visualization as orientations are still saved for tractography.
    scale_odf = 0.5; %Affects overall size of odfs in .fib file. This only affects visualization.
    odf_size = 20000; %Size of odf_n variables. Reduce this if there are issues with RAM.
    odf_res = 'low'; %{'low' or 'high'}; Number of points saved in ODFs ~ only affects visualization. Use 'low' to reduce memory requirements and use 'high' for the smoothest dODF surface renderings.


    Thank you in advance!

    • Mar 12, 2016  02:03 PM | Russell Glenn - Medical University of South Carolina
      RE: Unusual FT output
      Hi Eric,

      Do output images from DKE look okay, eg FA and MK? If so, I think this is probably the result of your gradient table orientation. This can be assessed visually by the orientation vectors in the Region Window in DSI Studio. This is the most common problem. 

      Things to check:
      1. Where are your gradient tables coming from?
          Dicom header / DSI Studio: LPS
          SPM / MRIcron: LAS
          Fixed table: Likely LPS, but I've also seen LAI
          Other programs: lots of people like RAS

      2. Are your gradients rotated to the image volume? Most programs will correct for this, but if you are using the gradients from the dicom header or a fixed table, you will need to check / correct for this . The rotation information can be found in the dicom header ImageOrientationPatient. If this field is anything other than [1 0 0 0 1 0], then the image volume has been rotated in the reference frame and corrections need to be applied (linear rotation). This rotation can be quite large, and in general is not fixed for any study protocol... It is defined on the console with the operator / mri tech selects the image volume.

      If this is not the case and the orientations are fine, then there are some fiber tracking options in DSI Studio that can cause funny seeding issues.

      In the Tracking Parameters Option, try selecting:
          Seed Orientation: Primary
          Seed Position: Subvoxel
          Randomize Seeding On
          Terminate if: Seeds / Number of Seeds

      I hope that helps,

      Russell

      • Mar 15, 2016  01:03 PM | Eric Miller
        RE: Unusual FT output
        Thank you so much, Russell. It appears to be working now and the preliminary data is impressive!



        For other who may have a similar problem, I found that using the gradient direction table built into the software did not work correctly (perhaps related to changes in the B19 Siemens software?). Also, even though the ImageOrientationPatient was [1 0 0 0 1 0], they DICOM header orientations did not appear to work correctly. After just building a manual table it worked like a charm! Perhaps this is just a nuance of my data, but it is worth a try if anyone else experiences similar issues.

        Thanks again! I sincerely appreciate your help!

        • Mar 16, 2016  10:03 PM | Russell Glenn - Medical University of South Carolina
          RE: Unusual FT output
          Hi Eric,

          Great! I am happy that you were able to find a solution and it is working well for you now! I agree that this is a super confusing issue and others will likely run into similar problems. Hopefully in the future we can provide more tools to help with this in the preprocessing to ensure the correct orientations. Thanks again for your post!

          Russell

  • Mar 1, 2016  07:03 PM | Elizabeth Hutchinson - NICHD/NIH
    weighting function for DKE?
    Hi,
    I have a quick question about the fitting algorithm.  I am using the Linux version of dke and would like to know the weighting function used in the linear LS fit (i.e. when dki_method.linear_weighting=1, the default).  I looked in the Tabesh, 2011 paper, but didn't find it (my apologies if I have missed this somewhere!).  If you can let me know the algorithm for weighting that would be great.
    Thanks!
    Beth

    • Mar 1, 2016  08:03 PM | Russell Glenn - Medical University of South Carolina
      RE: weighting function for DKE?
      Hi Beth,

      Sure. DKE uses a coventional weighted linear least squares algorithm, x = (H'WH)^-1*H'Wy, to estimate the tensors. The weight factors are the same as those defined in Basser, 1994 (Ref 1) to account for the heteroscedasticity of the noise variance across log-transformed measurements. The constrained fitting algorithm uses the same weights and constraints described in the Tabesh, 2011 paper and is implemented with the lsei algoithm from the slatec fortran library (Ref 2).

      Hope that helps,

      Russell

      Ref 1: Basser PJ, Mattiello J, LeHihan D. Estimation of the effective self-diffusion tensor from the NMR spin echo. J Magn Reson. 1994;103:247-54.
      Ref 2: Richard J. Hanson and Karen H. Haskell. Algorithm 587: Two Algorithms for the Linearly Constrained Least Squares Problem. ACM Trans. Math. Softw. 1982;8;323-33.

  • Feb 16, 2016  02:02 AM | Shawn Tan
    handling of b0
    Dear all, 

    I am acquiring DKI using a Siemens 3T scanner running it as a b0, followed by a b1000(x30 directions), b2000(x30 directions) and 2 b0s at the end. 
    When post-processing, should the b0 be combined? or should one be chosen? 
    I am wondering if DKE recognises it in the above arrangement.

    best regards,

    Shawn

    • Feb 16, 2016  01:02 PM | Emilie McKinnon - MUSC
      RE: handling of b0
      Hi Shawn,

      If you are processing dicoms DKE can work with this format. You will just have to choose which series discription belongs to the extra b0s.
      When working with niftis you need to combine them to 1 single B0.

      Best,
      Emilie

  • Jan 8, 2016  12:01 PM | Chli Li
    undefined function or variable 'fn_noise'
    Dear,
       I have two questions about this software:
       1) As my data format is "Bruker", so i think i have to run it using command. When I run the DKE using command prompt, an error "undefined function or variable "fn_noise" was always showed. Can you tell me the reason about it?
    Does it affect the DKI analysis if i use Matalb 2013a version and MCR7.17?
       2) Another concern is the "preprocess_options.navg = 2". What does it mean about number of DKI series? Does it mean how many times we scanned for one subject or how many b-weighted values we have?
    Many thanks for your help!
    Best,
    Changhong

    • Jan 8, 2016  02:01 PM | Emilie McKinnon - MUSC
      RE: undefined function or variable 'fn_noise'
      Hi Changhong,

      - In DKE you have the option to add an user-supplied map of Rician noise level (default: '' (i.e., none)); noise subtraction is based on the method of McGibney and Smith (1993); estimated signal s_hat at each voxel is obtained as s_hat = (s^2 - n^2)^0.5, where s is the measured signal and n is the noise level at that voxel.
      In your DKEparameters file you should have a line that specifies this, if you do not have a noise map you need a line that says fn_noise = ''; 

      - as long as you use MCR 7.17 DKE should run fine!

      - the number of averages is the amount of times you scan the animal.

      Hope this helps!

      Best,
      Emilie

      • Jan 8, 2016  03:01 PM | Chli Li
        RE: undefined function or variable 'fn_noise'
        Dear Emilie,
           Many thanks for your help. It works in my data. And about the "idx_gradients" option, how can I fill it if I have 7 different non-B0 values (each of them has 20 diffusion directions) for one scan. Should I fill it using [1:140] or 7 times [1:20]?
        Best,
        Changhong

        • Jan 8, 2016  03:01 PM | Emilie McKinnon - MUSC
          RE: undefined function or variable 'fn_noise'
          Hi Changhong,

          In general for 2 non zero b values I write it as follows : idx_gradients = {1:ndir 1:ndir}; % indices of gradient directions to be used for DKI map estimation; unacceptable diffusion-weighted images (e.g., those affected by motion- or patient table vibration-induced diffusion signal loss) can be excluded here; there must be as many cells as there are nonzero b-values, with each cell corresponding to a nonzero b-value.

          So for you this would be 7 times, make sure you use {} as dke expects a cell type.

          Best,
          Emilie

          • Jan 8, 2016  03:01 PM | Chli Li
            RE: undefined function or variable 'fn_noise'
            Dear Emilie,
            Many thanks for your answer. 
            Best,
            Changhong

            Jan 18, 2016  11:01 AM | Chli Li
            RE: undefined function or variable 'fn_noise'
            Dear Emilie,
             Sorry to interrupt you again. I have three scans for 7BO and 20 b-values (seven b-values) and I have merged them into one nifti file. The diffusion gradient table were directly used from method file (Bruker data). But something is wrong after getting FA maps. Please refer to the attchment file.
             Any suggestion would be greatly appreciated!
            Best,
            Changhong
            Attachment: FA.png

            • Jan 19, 2016  12:01 AM | Emilie McKinnon - MUSC
              RE: undefined function or variable 'fn_noise'
              Hi Changhong,

              Could you provide me with the gradient table that you used? Also you will need to take the average of your B0 images before putting it into a nifti file.  The expected 4d nifty is 1b0 - all b1's - all b2's etc

              If you use the terminal window to run DKE, DKE is able to process images straight from the bruker format.

              Hope this helps,
              Emilie

              • Jan 19, 2016  08:01 AM | Chli Li
                RE: undefined function or variable 'fn_noise'
                Dear Emilie,
                   Many thanks for your answer. This three scans have same B0 and b-values with three different 20 directions. That is, we have 60 directions for each b-value in our experiment.
                And we have converted bruker into nifti file and reordered them as B0, 60B1, 60B2....60B7. But the results seem always wrong as showed in last question. I added the directions in the attachment.
                Best,
                Changhong
                Attachment: gradientable.txt

                • Jan 20, 2016  04:01 PM | Russell Glenn - Medical University of South Carolina
                  RE: undefined function or variable 'fn_noise'
                  Hi Changhong,

                  I believe your problem could be a mismatch between the gradient table and the DWIs. Can you please clarify more about your sequence?

                  You say in a previous post that your sequence has 7 different non-B0 values an each one has 20 diffusion directions. In this case the gradient table should represent those 20 directions. However, in the most recent post, you say there are three scans with 3 different 20 directions. The gradient table you supplied looks like a standard 60-direction table and it is hard to imagine how this would have been separated into 3 different 20-direction scans.

                  Can you please clarify:
                  1. Where is the 20 direction table used for each scan coming from?
                  2. What does each of the 3 scans represent?

                  Sincerely,

                  Russell

                  • Jan 21, 2016  09:01 AM | Chli Li
                    RE: undefined function or variable 'fn_noise'
                    Dear Dr. Russell,
                        Many thanks for your answer. 
                    1. Where is the 20 direction table used for each scan coming from?
                    For each scan, there are 20 directions for each b-value (we have 7 b-values in total). In this case, we have 7*B0 + 7*20 volumes using 3*20 gradient table.
                    2. What does each of the 3 scans represent?
                    The main difference among these 3 scans is the 20 directions we used. Other sequence parameters are same without any adjustments. 
                    Thus, as you said, if I merge 3 scans into one nifti, we can get 60 directions for each b-values. In the end, we get the nifti file that has 21*B0+60B1+60B2+...+60B7. And we run the data use command using 3*60 gradient table.
                     And do the voxel size, image origin or affine transformation will affect our results? I added a  'method' file in case my unclear explaination.
                    Sorry for my many questions.
                    Best,
                    Changhong
                    Attachment: method

                    Jan 21, 2016  03:01 PM | Chli Li
                    RE: undefined function or variable 'fn_noise'
                    Dear Dr. Russell,
                        I got the DKI results again, but I am not sure whether it is corrected.
                    Can you help me to check it? Many thanks in advance!
                    Best,
                    Changhong
                    Attachment: kfa.nii

                    • Jan 21, 2016  05:01 PM | Emilie McKinnon - MUSC
                      RE: undefined function or variable 'fn_noise'
                      Dear Changhong,

                      The kfa values in the brain look reasonable to me. The background looks interesting though. Did you perhaps turn off the masking (by setting the b=0 threshold to zero)?

                      best,

                      Emilie

  • Jan 4, 2016  02:01 AM | Miho Ota
    Auser-defined gradient vectors table
    Glad to see you.
     
     I am recently interested in the DKI and found the "Diffusion Kurtosis Estimator". We are trying to gather DKI data using with Philips 3T MRI Achieva scanner. Then, we have to use the DKE with user-defined gradient vectors table. At the beginning, we calculate the sample 4D Nifty DKI data downloaded from website http://academicdepartments.musc.edu/cbi/... using with attached self-made gradient vectors table, which gradient vectors are those of Siemens 30-direction. Howevwe,  DKE showed the error messabe below, and we can't estimate the mean kurtosis.
     
    dke_estimate>read_gradient (line 701)
    error dke_estimate (line 196)
    error dke (line 182)
    MATLAB:load:numColumnsNotSame
     
     
    On the other hand, when we checked the gradient vectors "Siemens VB13-17 30-direction", we got the mean kurtosis.
    Please teach me how to make user-defined gradient vectors table. If it is not an imposition, please give me the sample user-defined gradient vectors table (.txt)
     
    Thank you for time in advance.
     
    Attachment: GradientTable.txt

    • Jan 4, 2016  04:01 PM | Emilie McKinnon - MUSC
      RE: Auser-defined gradient vectors table
      Dear Miho Ota,

      Your gradient table looks correct to me. I tried processing the 4D Nifty DKI data example set on my computer with your gradient table which works fine.
      Could you send me the DKEParameters.dat file that is created after running DKE?

      Thank you for contacting us,
      Best
      Emilie

      • Jan 7, 2016  01:01 AM | Miho Ota
        RE: Auser-defined gradient vectors table
        Sorry, but my DKE start up well.
        Thank you.
         
         
        Miho Ota

  • Jan 5, 2016  07:01 PM | He Naying
    an error when writing the resultant parameter
    I am running DKE on a linux cluster and received an error when writing the resultant parameter maps. Calculation of the parameter maps works.
    The error is
    "undefined function or variable 'fn'. Error in write_nii (line 15)
    Error in dki_estimate>write_img (line 1982)
    Error in dke_estimate (line 588)
    Error in dke (line 183)

    A screenshot of the error is attached. Any insights as to how to fix this error are appreciated.
    Attachment: Capture.PNG

    • Jan 5, 2016  09:01 PM | Emilie McKinnon - MUSC
      RE: an error when writing the resultant parameter
      Dear Naying,

      I suspect that there is an error in the subject_list = {''}; parameter of the DKE parameter file. Would you mind sharing this file with us?

      Kind regards,
      Emilie

      • Jan 6, 2016  06:01 PM | He Naying
        RE: an error when writing the resultant parameter
        Originally posted by Emilie McKinnon:
        Dear Naying,

        I suspect that there is an error in the subject_list = {''}; parameter of the DKE parameter file. Would you mind sharing this file with us?

        Kind regards,
        Emilie
        Hi Emilie, 

        Thank you for your help. 
        There was an error in my DKE_parameter file. Following your suggestion of removing the forward slashed (/) in the subject_list, we can run the command successfully now. 
        This is the old scripts with a wrong subject_list.
        subject_list ={'NC_02_Sub028/DWI/dke','NC_02_Sub032/DWI/dke','NC_02_Sub035/DWI/dke','NC_02_Sub036/DWI/dke','NC_02_Sub040/DWI/dke','NC_02_Sub041/DWI/dke','NC_02_Sub042/DWI/dke','NC_02_Sub043/DWI/dke','NC_02_Sub044/DWI/dke','NC_02_Sub045/DWI/dke'};
        The correct one should be like this:
        subject_list = {'NC_02_Sub028, 'NC_02_Sub032','NC_02_Sub035','NC_02_Sub036','NC_02_Sub040','NC_02_Sub041','NC_02_Sub042','NC_02_Sub043','NC_02_Sub044/','NC_02_Sub045'};

        Best,
        Naying

  • Nov 18, 2015  05:11 PM | Yi-Fen Yen
    Orientation of the DKE maps
    Dear all, 

    How do I keep the resulting parametric maps in the same orientation as the input nifty file? 

    Thank you.

    Yi-Fen

    • Nov 18, 2015  09:11 PM | Russell Glenn - Medical University of South Carolina
      RE: Orientation of the DKE maps
      Hi Yi-Fen,

      If you supply nifti as inputs the orientation of the parameter maps shouldn't change. Is this occurring? If you supply dicoms then they they will be converted to LAS by spm dcm2nii functions. If you do tractography after calculating the parameter maps then the tracts will be converted to LPS. This is because DSI studio expects LPS and the .fib file has no orientation info other than dimension and voxel size. Consequently if you try to load in other images like t1 or any of the parameter maps, it puts them in LPS. I realize this may be frustrating for other applications. In the future we will add an option not to do this.

      Sincerely,

      Russell

      • Nov 19, 2015  05:11 PM | Yi-Fen Yen
        RE: Orientation of the DKE maps
        Hi Russell,

        Thank you very much for getting back to me.

        I do supply nifty as inputs and I only run dke, not dke_ft. My understanding is that by running dke, I am not doing tractography. Is that right?

        My output files consist of dax.nii, dmean.nii, drad.nii, DT.mat, fa.nii, kax.nii, kfa.nii, kmean.nii, krad.nii, KT.mat, and mkt.nii. When I view these nii output files in fsl, I only load these output files and no other images. Comparing to the input file (which I named dki.nii), the output files are all flipped in the A-P direction and also there is a tilt in saggital view (as if the slices were acquired at an oblique angle but in fact, they were axial).

        Is there anything that I can check in the nifty header to see if there is a "flag" that is somehow accidentally set in the header and causes confusion to the dke code? Does it help if I provide you my dke_parameters.dat file?

        Thank you!

        Yi-Fen

        • Nov 19, 2015  06:11 PM | Russell Glenn - Medical University of South Carolina
          RE: Orientation of the DKE maps
          Hi Yi-Fen,

          Correct, by running dke you are not doing anything with tractography, just estimating the tensors and the tensor-derived parameters.

          Ok, that makes sense, This is occurring from spm's dcm2nii functions, I believe. Dicom images are stored in LPS, but when they're converted to nifti the data is saved in LAS with information in the header (hdr.mat, hdr.private.mat, and hdr.private.mat0) which specifies a voxel to RAS (in mm space) transformation. I believe viewers like fsl use the RAS mm representation, which will look flipped in the A-P orientation and often rotated obliquely compared to what is in the dicoms (the rotation comes from the ImageOrientationPatient field in the dicom header, I believe, but can also be modified by other programs (like spm to set the anterior-posterior commissure coordinates ~ confusing right?!).

          However, DKE should output a set of nifti images in the exact same space as all of the parameters, like b0.nii. These should overlay correctly in any nifti viewer and have the same general header information. If not, I am unsure what could be the problem. 

          If you load these images into matlab; ie hdr = spm_vol(file_name.nii); img = spm_read_vols(hdr); the images should not look rotated obliquely, but they will likely still look flipped in the A-P direction compared to the dicoms; ie img = dicomread(file_name.dcm);

          I hope that helps,

          Russell

          • Nov 30, 2015  08:11 PM | Yi-Fen Yen
            RE: Orientation of the DKE maps
            Hi Russell,

            Thank you for the reply. It was helpful. I think I figured out why my output parametric images are in different orientation from my input dki.nii file. It was because I allowed parametric map interpolation. When I turned that off (map_interpolation_method.flag = 0), the input and output files overlay correctly and the header information for orientation is kept the same. 

            I thought the interpretation only re-sample the images. But it looks like it also interprets images to a different orientation (flipping and tilting). Is it possible to ask the program to only re-sample but no change in orientation?

            Best regards,
            Yi-Fen

            • Dec 2, 2015  06:12 PM | Russell Glenn - Medical University of South Carolina
              RE: Orientation of the DKE maps
              Hi Yi-Fen,

              That is very interesting. I would have thought the interpolation only re-sampled as well. I did have a chance to look at the source code, and the interpolation does change the vox_to_ras transformation in the .nii header which may cause it to not overlay properly in a program which uses this information. Right now there is not an option to change this, although by default we should keep this information the same.

              I checked an example dataset that I have and found I could overlay the images correctly in mricro but I have not checked in FSL. 

              Sorry for the confusion.

              Best,

              Russell

              • Dec 16, 2015  11:12 PM | Ehsan Misaghi - University of Alberta
                RE: Orientation of the DKE maps
                Hello everyone,

                Based on Russell's answer to another question of mine before, I know that if the mat field in the header of the nifti file (after being imported into Matlab using SPM) has positive diagonal values, the image is in the RAS orientation. So, my question is what will the matrix look like if the image is in another orientation?

                Thanks,
                Ehsan

  • Nov 24, 2015  01:11 AM | Kirk Feindel - University of Western Australia
    "Reference to a cleared variable fn_array"
    Hi Folks,

    For those of you using DKE 2.6.0 for Linux with Bruker data and more than one b0 image, you'll likely encounter this error:

    "Converting input Bruker images to NIfTI . . .  complete.
    Averaging images . . . Reference to a cleared variable fn_array.

    Error in dke_preprocess_bruker (line 184)

    Error in dke (line 177)

    MATLB:refClearedVar"

    Emilie tracked it down to a case-sensitive coding typo, and there is a work around until the next compile of DKE for linux:

    WORKAROUND:
    After the crash, in the "intermediate_processing" folder you will find a folder "dki_b0_coreg" - copy the contents of that folder into a new folder "DKI_B0_coreg" and restart DKE.

    • Nov 30, 2015  07:11 PM | Emilie McKinnon - MUSC
      RE: "Reference to a cleared variable fn_array"
      Thanks for putting this information on here Kirk !

  • Nov 29, 2015  12:11 AM | Ehsan Misaghi - University of Alberta
    ODF Visualization in DSI Studio
    Hi everyone,

    I have done fiber tractography using DKE_FT and I'm trying to visualize the ODFs using DSI Studio, but the attached image shows the type of visualization I see in DSI Studio. I asked this in the DSI Studio forum and Frank thought that the ODFs are corrupt. I tried the same pipeline for the example dataset supplied along with DKE and the image I'm going to attach to the next post is the result of that. I would appreciate if someone can help me figure out the cause of the problem.

    Thanks a lot,
    Ehsan
    Attachment: ODFs_axial.PNG

    • Nov 29, 2015  12:11 AM | Ehsan Misaghi - University of Alberta
      RE: ODF Visualization in DSI Studio
      And attached is the screenshot of the example dataset ODF visualization in DSI Studio.

      Nov 29, 2015  01:11 PM | Russell Glenn - Medical University of South Carolina
      RE: ODF Visualization in DSI Studio
      Hi Ehsan,

      I agree with Frank that the ODF's are 'corrupt,' though I'm not sure why they are rendering like they are, which is a DSI Studio question, as min-max normalization should scale these back to normal... From the DKI side, I believe this is occurring when the diffusion tenser is inverted in very noisy voxels with weird eigenvalues. Both of these rendering problems seem to be happening in the periphery, perhaps even skull where the diffusion signal may not be optimized. I believe we need to implement some regularization procedure, perhaps just on the minimum and maximum allowable eigenvalues to correct this. This could be performed just on DT. I will look into this and see if I can come up with a quick fix for this. Future versions of the software should also be able to overcome this rendering error.

      Best,

      Russell

      • Nov 30, 2015  01:11 AM | Ehsan Misaghi - University of Alberta
        RE: ODF Visualization in DSI Studio
        Hi Russell,

        Thanks a lot for your answer and thanks for looking into this further. There are two things, though: (1) the weird line going through one of the ODFs and stretching to both sides does actually start inside the brain and (2) I'm pretty sure that BET zeros out all of the periphery voxels (i.e. anything related to the skull is also gone), so why should we even have values for those areas of the image?

        And also, as I asked on the other topic, could you please share the txt file you used to look into the data I sent you.

        Cheers,
        Ehsan

        • Nov 30, 2015  07:11 PM | Emilie McKinnon - MUSC
          RE: ODF Visualization in DSI Studio
          Dear Ehsan,

          If your data is somewhat noisy, it is possible that some voxels inside the brain act in a way that is not physically possible. We will put it on our to do list to add some more check points in the dke_ft script, that will set these voxels to zero or something that is appropriate depending on why the situation is occurring.

          For the time being you can manually eliminate that specific voxel from the outputs. Also, i do not think it will affect the tractography results.

          Hope this helps,
          Best
          Emilie

  • Nov 10, 2015  11:11 AM | Riccardo Navarra - ITAB - Università G D'Annunzio, Chieti
    error on dke_ft start...
    Hi,
    when dke_ft starts I got thi error: 
    --------------------------------------------------------------
    Starting matlabpool using the 'local' profile ... connected to 2 labs.

    Start date and time: November 10, 2015 12:32:54
    Fiber Tractography with DKI version 1
    July 2015
    Optimizing kurtosis dODF ~ odf0 @ 0.00 min...Undefined function or variable "idx_fib".
    Error in dke_ft (line 217)
    MATLAB:UndefinedFunction
    ---------------------------------------------------------------

    dke works well, DT.mat and KT.mat were created. In (dafulat) ft_parameters.txt I set make_fib_file = 0;

    Thanks

    Riccardo

    • Nov 11, 2015  10:11 AM | Russell Glenn - Medical University of South Carolina
      RE: error on dke_ft start...
      Hi Riccardo,

      I apologize for the error! I reviewed the soruce code and the idx_fib variable is only called within blocks of the code specified by make_fib_file = 1. So I am unsure how this could be, but I will keep looking into this error and let you know if we can correct this.

      Have you tried running with make_fib_file = 1 and save_odfs = 0? The .fib file can be useful for visualizing and helping to analyze the output. 

      Best,

      Russell

      • Nov 11, 2015  02:11 PM | Riccardo Navarra - ITAB - Università G D'Annunzio, Chieti
        RE: error on dke_ft start...
        Not yet.
        At the moment dsi studio does not work with mint 17.2 (and ati card) but I try.
        Thank you.

        • Nov 11, 2015  09:11 PM | Russell Glenn - Medical University of South Carolina
          RE: error on dke_ft start...
          Ah, that makes since. Yeah, DSI Studio runs well for Windows but you have to compile it separately for the different linux distros and it can be a mess. Sorry again for the DKE bug. Hopefully this will be corrected in future releases.

          Best,

          Russell

          • Nov 12, 2015  10:11 AM | Riccardo Navarra - ITAB - Università G D'Annunzio, Chieti
            RE: error on dke_ft start...
            dke_ft works fine with "make_fib_file = 1" ;
            ...meanwhile I compiled dsi_studio on a couple of mint 17.2 amd64 with nvidia and ati cards...  Here is a brief note: http://1drv.ms/1O5h3Jx

            • Nov 12, 2015  01:11 PM | Russell Glenn - Medical University of South Carolina
              RE: error on dke_ft start...
              Congrats and great job! You should consider posting your notes on DSI Studio's page or let Frank know. He's super nice and helpful and you're notes look more straightforward than the ones that I used.

      Nov 16, 2015  09:11 PM | Ehsan Misaghi - University of Alberta
      RE: error on dke_ft start...
      Hello everyone,

      I'm having trouble with the fiber tractography. The DKE_FT runs for about 80 mins and I end up getting the following error message:

      Error using save
      Can't write file ...\dki_FT.fib.

      Error in dke_ft (line 337)
      }
      MATLAB:save:cantWriteFile

      Also, when the program starts, it gives a warning that:

      {Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.708888e-16.}
      {> In getODF_FCN at 27
      In dke_ft>(parfor body) at 227
      In parallel_function>make_general_channel/channel_general at 870
      In remoteParallelFunction at 31}

      Can anyone help me find out why these errors are thrown?

      Thanks,
      Ehsan

      • Nov 16, 2015  11:11 PM | Russell Glenn - Medical University of South Carolina
        RE: error on dke_ft start...
        Hi Ehsan,

        I apologize for the long processing times. Hopefully we will continue to improve the computational efficiency of DKE in the future. Right now we're limited because the source code is written in Matlab. I have gotten the processing times down to around 10 mins for many of my datasets, but this is both platform and dataset specific.

        I would disregard the second error. In computation of the kurtosis dODF, the diffusion tensor must be inverted, and this error occurs when the diffusion tensor is degenerate, which may occur in the image background and periphery of the image where the diffusion signal is largely noise. This should not happen within the brain volume.

        I am unsure what the cause of your first error could be. This could occur as the result of a permissions error in your local environment but I doubt this is the case. I am happy to take a look at your data if you like and see if I can diagnose this further. If this is ok with you you could upload the DT.mat, KT.mat, and fa.nii files somewhere? These files are fully anonymized and contain no identifiable info. Just an option...

        Best,

        Russell

      Nov 17, 2015  06:11 PM | Ehsan Misaghi - University of Alberta
      RE: error on dke_ft start...
      Hi Russell,

      Thanks a lot for your kind response. I'd appreciate if you can take a look at the files and let me know what you think about it. Here is the link to the zip file containing all three of the files you mentioned: https://www.dropbox.com/s/f4ga8fvazyodyx0/DT_KT_FA.zip?dl=0

      All the best,
      Ehsan

      • Nov 18, 2015  11:11 AM | Russell Glenn - Medical University of South Carolina
        RE: error on dke_ft start...
        Hi Ehsan,

        I took a look at your data and I found the image volume to be in the RAS orientation, the gradient table to be in LPS, and the voxel dimensions to be 1 x 1 x 2 mm^3. I was a little concerned that the voxel dimensions were anisotropic, but the tractography portion of the script within DKE works fine (attached), though the data is noisy, which is likely due to the high resolution of your scan. For our experiments, we typically don't go below about 2 x 2 x 2 mm^3 for human imaging at 3T since were are concerned about SNR. I would double check SNR.

        I also think this could be causing the error you experienced. I used the 'low' resolution option to try to visualize the ODFs but the output dki.fib file was almost 3GB! It was able to save, but this is a very large file, and I suspect a local memory issue was responsible for your error writing the outputs. I would suggest setting the save_odfs option to 0. In the future we will hopefully be able to reduce this file size further. I can also confirm the very long processing times for your data.

        I tried running fiber tracking in DSI Studio as well and the results looked kind of funny to me. I did not look into this further, but I would check with Frank or DSI Studio documentation to make sure it will work with the 1 x 1 x 2 mm^3 voxel dimensions.

        Best,

        Russell
        Attachment: FT.png

        • Nov 18, 2015  09:11 PM | Ehsan Misaghi - University of Alberta
          RE: error on dke_ft start...
          Hi Russell,

          Thanks a lot for your answer. I appreciate the time you've taken to look into this issue. The first thing I noticed is that I didn't change the image and gradient table orientation in the DKE_FT config file and thus I was actually getting the results in the wrong orientation, though I wasn't able to visually see it! This brings up my first question: How do you figure out the orientation of the image and the gradient table to be RAS and LPS, respectively (or any other orientation)? My second question is: How can I check the SNR in images and what is the SNR range for a normal image?

          Also, I used the 'high' resolution option for the ODFs, so that may be a reason for the large file size as well. The .fib file is actually being partially saved. The strange thing about this is that the drive I'm using is formatted using the NTFS method, which unlike the FAT32 format does not have the 4GB file size limit, but only the first 4GBs of the .fib file is being saved. So, this leaves me suspecting that maybe this is a limit in DKE_FT or Matlab. Can you somehow check this?

          If I change the 'save_odfs' to 0, is there another way to save the ODFs and visualize them separately later?

          Thanks a lot,
          Ehsan

          • Nov 18, 2015  10:11 PM | Ehsan Misaghi - University of Alberta
            RE: error on dke_ft start...
            I also forgot to mention that I actually changed the minimum track length to 10 mm, maybe another reason for the large file size.

            Nov 18, 2015  10:11 PM | Russell Glenn - Medical University of South Carolina
            RE: error on dke_ft start...
            Hi Ehsan,

            No worries. I was actually very interested in your dataset because I haven't actually run the FT scripts with anisotropic voxel dimensions. I wrote the scripts  to accommodate this but it was great to see that it didn't go on the fritz!

            Orientations are the worst! I've spent a long time trying to figure them out. The first thing I did was check the nifti header since I was curious about the voxel dimensions and image size. This also has an affine matrix which is a vox_to_ras transformation which you can often look at to tell the orientation. Since your's was a diagonal matrix with the diagonal elements being positive it means the image volume is already in ras (it only needs scaling and translation to get to ras in mm space). For the gradient table, it's purely a shot in the dark without more context... I tried LAS first since that's what spm things seem to use, then I tried RAS because that's what you're image is in, and then I tried LPS, which is how they are stored in the dicoms (confusing, right?!). After you have the odf_optimization complete you can just change these for the tractography so it doesn't take long, and it's not hard to tell when it's not correct on this level. Subtler changes occur with the rotations of the image volume, ie if the image has been rotated by some other program you also have to rotate the gradient tables. Since your nifti hdr.mat was diagonal this implies either another program has put it that way or the Image_Orientation_Patient field in your dicom header is [1 0 0 0 1 0], which you can potentially check with Matlab's dicominfo function. I really wish all of this was streamlined somehow within DKE but we stopped short of trying to do this, since e have collaborators with Siemen's, GE, and Philips scanners and depending on the software version used to build the dicoms the gradient info can be in completely different places within the file so it's been hard to make a general approach. I'm not sure how other programs tackle this...

            I know what you mean. The file size issue is very interesting. The .fib file is actually built dynamically as it goes to try to avoid this issue, but I am suspicious that something is cutting it off. I think the problem is arising because I use double precision floating point format to save all of the info in the .fib file, which is likely excessive. In the 'high' resolution option each voxel has 1281 vertices used to render the ODFs in DSI Studio and since there were over 800,000 voxels in your dataset that leads to about a billion data points. This still shouldn't require so much memory to store but it is a lot of data. I will keep looking into this and see if DSI Studio will work with a different format. I have made changes to the FT module and am hoping to do the same for DKE to make it faster so hopefully we will have another version soon.

            The odf_optimization script does save a data structure called odf_coeff which can be used to render the ODFs in matlab but it requires some scripting and matlab's visualization tools can't really handle rendering an entire image slice of these. I sometimes like using matlab for publications though because it gives me more control over some of the surface lighting and coloring options  which can help make things look nice. DSI Studio is still the best at this though; it's implemented in VTK, I believe which is way more suitable for this type of rendering... with everything as it is now, you may have to be creative. Both DKE and DSI Studio work in image space meaning they don't really care about the coordinate space defined by hdr.mat so you can just truncate your image and process a subset of your data?

            The way the DKE FT module is built performs the odf optimization to get the orientation estimates first and then the tractography after. I believe your problem to be in the odf_optimization step so I think whatever options you've used for the tractography should be fine unless you're seeding like 10 million points!

            Best,

            Russell

            • Nov 23, 2015  07:11 PM | Ehsan Misaghi - University of Alberta
              RE: error on dke_ft start...
              Hi Russell,

              Thanks a lot for your thorough response. I have a few other questions as well:

              1) So, I used the "Tools for NIfTI and ANALYZE image" toolbox to look into the header and the header loaded into Matlab actually had three structures. I couldn't quite figure out which matrix you were mentioning when you were talking about the affine matrix and the fact that the image is in the RAS orientation.

              2) Did you use glyphs to find out which orientation the gradient table was in after performing tractography?

              I think I'll have more questions in a bit, but I'd appreciate if you can address these for now! :)

              Thanks again and sorry for asking too many questions,
              Ehsan

              • Nov 24, 2015  07:11 PM | Russell Glenn - Medical University of South Carolina
                RE: error on dke_ft start...
                Hi Ehsan,

                No worries.1) I used SPM (http://www.fil.ion.ucl.ac.uk/spm/softwar...), and with SPM in the Matlab search path, you can do hdr = spm_vol(full_path_to_nii_image); hdr.mat and 2) I just used the orientation estimates, which are also saved in the .fib file... these just look like colored lines that point in one direction.

                Best,

                Russell

                • Nov 29, 2015  12:11 AM | Ehsan Misaghi - University of Alberta
                  RE: error on dke_ft start...
                  Hi Russell,

                  Thanks a lot for your answer again. As I have posted on the new topic, I'm having problems visualizing tracts and ODFs in DSI Studio. I tried an example .fib file from DSI Studio and there doesn't seem to be a problem with DSI Studio. Given that I saw an almost identical problem with the example dataset provided for DKE (again posted on the other topic in the forum), I am thinking that I am not using the same numbers as you when analyzing the data. Could you please share your DKE_FT_parameters.txt file with me that you used for the data I provided so that I can test it?

                  Thanks again,
                  Ehsan

  • Nov 14, 2015  11:11 PM | Joong Kim - Washington University in St. Louis
    the command window batch processing
    To whom it may concern,
    Recently, I've downloaded the Kurtosis estimator and now am trying to get the Kurtosis results. The DKE provides two ways to get Kurtosis, GUI and command window batch processing. Using GUI, I got the Kutosis results sucessfully regardless my raw diffusion data quality. And I've noticed that the command window batch processing is more flexible to get Kurtosis results with various diffusion schemes. But due to my limited knowledge and experience on programming, I've encountered some problems.
    I wonder if some one could look over my dke_parameters_dat file.
    When I run DKE with my current dke_parameters_dat file, I have the following error message.
     
    ###############################
    Error using dke (line 47)
    Error: Unexpected MATLAB operator.
    MATLAB:m_missing_variable_or_function.
    ###############################
     
    My diffusion data have three non-zero b-values with b0, [0 1300 2600 3900] in s/mm^2 unit. There are 21 diffusion directions per each b-value shell.
    Current diffusion scheme is collinear type. And I wonder if I can use non-collinear type diffusion scheme to get kurtosis. That's why I'm testing the command window batch processing. I've attached my dke_paremeters_dat file.
    If anyone could look over the files and correct errors, it will be really great for my future  work.
     
    Thanks in advance for your time and work
     

    • Nov 15, 2015  08:11 PM | Russell Glenn - Medical University of South Carolina
      RE: the command window batch processing
      Hi Joong Kim,

      I believe this may be an error from the preprocess_options.fn_nii variable. I would suggest unzipping the file and supplying 'semsdw' as the file name. I don't believe DKE currently works with gzipped nifti images, though hopefully we can add options to accommodate this in the future.

      Also, if I may make a few suggestions:
      1. The masking threshold of 500 may be high, although these are in arbitrary units so maybe not. Just check with your data.
      2. We typically recommend using Gaussian smoothing. This is to help with Gibbs ringing artifacts among other things. A few alternative approaches have also been proposed recently (Veraart et al. Magn Reson Med. 2015 and Perrone et al. Neuroimage. 2015) which may also help and can be performed outside of DKE.
      3. b = 3900 s/mm^2 may be a little high for the DKI fitting method as higher order diffusion dynamics start to become more significant with higher diffusion weighting (see Jensen and Helpern. NMR in biomed 2010 Figure 2 for example).
      4. I am personally not a fan of the strong median filtering method and in future releases this will likely not be the default option. I would suggest setting this to 1 or 0 initially.

      Best wishes,

      Russell Glenn

      • Nov 17, 2015  05:11 PM | Joong Kim - Washington University in St. Louis
        RE: the command window batch processing
        Thanks for your help and time.
        Indeed the commnad processing only takes unzipped file.
         
         

      Nov 17, 2015  03:11 AM | Kirk Feindel - University of Western Australia
      RE: the command window batch processing
      Hi Joong Kim,

      The only thing I noticed other than the compressed nifti is a couple of typos in your fn_gradients line.  I think each filename should be surrounded by single quotes and your last two filenames are missing the leading single quote.

      Cheers,

      Kirk

      • Nov 17, 2015  05:11 PM | Joong Kim - Washington University in St. Louis
        RE: the command window batch processing
        Thanks very much for your time.
        Now I can run DKE in command mode.
         

  • Oct 4, 2015  09:10 PM | Ehsan Misaghi - University of Alberta
    Loading a 4D NIfTI image
    Hello everyone,

    I've recently joined the DKE users' group, YAY! So, I have a few DKI datasets that I want to analyze using DKE and I have a few questions. I'd appreciate if people here address my questions:

    1. The DKE manual says that the 4D NIfTI images should be organized in the following order: 1 b=0 image, all b1 images and all b2 images (assuming that we have only 3 b-values). My dataset includes 10 b=0 images at first and then alternates between b1 and b2 (30 images/directions each). I can use FSL and/or MATLAB to rearrange the b1 and b2 images (unless there is a way to do it in DKE that I'm not aware of). But, I don't know what I have to do for b=0 images. Do I have to take an average of the 10 images or choose one based on visual inspection? What do people normally do with more than 1 b=0 image? I know that for the DICOM images, the manual says that you have to put all of the extra b=0 images into another folder, but it doesn't say anything about the NIfTI files.

    2. Speaking of the DICOM part in the manual, does DKE take the extra b=0 images' folder into consideration? If yes, how?

    Thanks a lot for your help in advance,
    Ehsan

    • Oct 5, 2015  01:10 AM | Russell Glenn - Medical University of South Carolina
      RE: Loading a 4D NIfTI image
      Hi Ehsan,

      Welcome to the DKE users' group! DKE preprocessing just co-registers b0 images and averages things to help improve SNR if you have multiple DKI acquisitions. This can also be accomplished outside of DKE using MATLAB, SPM, etc. If you feel comfortable working with nifti images you can just average all of the b0 images your self and then sort the dataset so that it goes b0, b1_1,b1_2,b1_3... b2_1,b2_2,b2_3... in a 4D nifti. If you specify the data type as nifti and then give it the name of this image within the subject folder, then this is what it will look up and use.

      It is advisable to acquire multiple b0 images and average them because DKE performs signal fitting on ln (S / S0) so a good estimate of S0 is desired.

      I hope that helps,

      Russell

      • Oct 5, 2015  02:10 AM | Ehsan Misaghi - University of Alberta
        RE: Loading a 4D NIfTI image
        Hi Russell,

        Thanks a lot for your thorough answer. This actually rises another question: Since there are possibilities of motion and other artifacts in the b0 images, would you suggest aligning all of the b0 images to the first one (or maybe visually inspect them and see which one is the best and align to that) and then average them?

        Thanks,
        Ehsan

      Oct 5, 2015  02:10 AM | Russell Glenn - Medical University of South Carolina
      RE: Loading a 4D NIfTI image
      Hi Ehsan

      No problem! In our DKI protocols There is typically a DKI sequence which acquires one b0 image along with all of the DWIs and then an additional sequence that just gets the extra b0s, so I typically align everything to the b0 image in the first full DKI sequence (if there are multiples) so all of the extra b0 images are co-registered independently to the b0 image closest in time to the first full DKI sequence. However if the extra b0 images are all acquired at the beginning of the sequence there typically isn't too much motion, since these images can be acquired relatively quickly, so they may just be averaged. But, If it is not a problem to co-register them all, then I would suggest just going ahead and doing it. If the extra b0 images are taken after the full DKI dataset, then they should definitely all be co-registered to the first one. 

      Some people also recommend co-registereing each of the DWIs to the b0 image to help correct for subject motion that can accumulate during the duration of the scan. This is fine to do as well, but you have to be careful to also rotate all of the gradients in the gradient table by the respective transformation. I personally have mixed feelings about this, because you can look at the pitch, roll, yaw, translations, etc for each DWI and the higher b-value images tend to have pretty 'noisy' trends which suggests to me that co-registration error could be causing more changes than the subject motion, but it's just a thought. I think either way is fine.

      Best,

      Russell

      • Oct 5, 2015  02:10 AM | Ehsan Misaghi - University of Alberta
        RE: Loading a 4D NIfTI image
        Hi Russell,

        Thanks again for your response. I still have more questions!

        1. Which specific programs do you normally use for co-registration/motion correction/averaging? (I want to be as compatible as possible with DKE - of course I think fslmath can do the averaging very easily, but I still want to have your input on it)

        2. I still have the previous question that in the manual for dcm files, it says that you can put the extra b0 files into another folder. Does DKE make use of those extra b0 images at all? If yes, does it average them all or what does it do with them?

        Cheers,
        Ehsan

        • Oct 5, 2015  03:10 AM | Russell Glenn - Medical University of South Carolina
          RE: Loading a 4D NIfTI image
          No worries!

          I typically do everything I can in Matlab so I don't have much experience outside of that, which can be a problem sometimes :/ Anyways, SMP has a series of open source matlab scripts which I'll typically just play with and adapt to whatever I'm doing. DKE preprocessing will sort through your data and convert dcm to nii but its ultimately a wrapper to SPM as well so it will eventually utilize SPMs co-registration. This can equivalently be accomplished with SPM's Matlab GUI, though it can be tedious, for example if you have 20 b0s you have to co-register independently for a whole bunch of patients. I've always been happy with SPM's affine co-registrations, though it is not always 100 % awesome with the non-linear transformations. I know of other programs that have similar preprocessing configurations where they do some stuff and then call SPM. However if you have a setup that utilizes FSL I wouldn't see any problem with that at all.

          If I remember correctly, DKEs preprocessing anticipates dicom images in folders like Extra_B0, DKI1, DKI2,... etc and then you tell it that there are extra b0s and how many DKI datasets in the parameters.dat file. I don't remember the specifics but it will average all of the corresponding images and create a combined folder... you'll know when it is co-registering things because output will display in the command prompt. Perhaps someone else can answer more specifically?!

          A couple of other things...

          I like to use MRIcron to convert dcm2nii and extract the gradient table. However, if you're dataset goes b1_1, b2_1, b1_2, b2_2, ... then it may be a little tedious to get the gradient table the way DKE expects it. Just double check.

          Finally I'm not a huge fan of the median filtering option, so it can be beneficial to drop it down to 0 or 1... just another thought.

          Best,

          Russell

      Oct 5, 2015  11:10 AM | Emilie McKinnon - MUSC
      RE: Loading a 4D NIfTI image
      Hi Ehsan,

      Welcome to DKE!

      I like using DCMs when working with DKE, because it will take care of everything!
      All of your images need to be in the same folder, even the extra Bo's.
      The only thing that DKE will look at is the series description.
      So if you run DKE through the GUI and click on load dicoms, choose that folder with all the images.
      A window will pop up that asks which series discription is from the extra B0 and which
      Is the regular dki series. After that DKE will do all the coregistering and averaging automatically.

      Ps: I agree with Russel, turn median filtering to weak and also turn of interpolating!

      Good luck,
      Emilie

      • Oct 15, 2015  05:10 PM | Ehsan Misaghi - University of Alberta
        RE: Loading a 4D NIfTI image
        Hi Emilie and Russell,

        Thanks a lot for your answers and sorry for my late reply. I could reorganize the directions in the 4D NIfTI file. But, I have another problem now! DKE needs the gradient table. Since I have the final .nii files from the scanner rather than the .dcm files, I can't use MRIcron to extract the table. But, I have a text file besides the images and a part of it says "gradient table", but I'm not sure if that is the accurate gradient table or not. Is there a way to check that and make sure if it is the file DKE wants?

        Thanks a lot,
        Ehsan

        • Oct 15, 2015  05:10 PM | Emilie McKinnon - MUSC
          RE: Loading a 4D NIfTI image
          Hi Ehsan,

          You should try and talk to your MRI tech and ask if you can have the raw dicoms or if that is not possible you should be able to talk to him about the gradient table.
          What type of scanner are you using? If you are not interested in fiber tracking and you are using a siemens scanner, you can just use the gradient tables that are build into DKE.

          The only way to check if this is the correct gradient table is to compare it with the information that is provided in the header of the dicoms. you can try running DKE and see if the results look normal? Usually if the gradient table is off, the FA values will be too low for example.

          Ps: DKE expects the gradient table to be in the following format: Nx3 with N the number of gradient directions.

          Hope this helps, 
          Emilie

          • Oct 15, 2015  05:10 PM | Ehsan Misaghi - University of Alberta
            RE: Loading a 4D NIfTI image
            Hi Emilie,

            Thanks a lot for your prompt response. I'll talk to him about the possibility of that. The table I mentioned before is actually a Nx3 table, so I'll probably use it and see if the results look normal. The scanner we are using is a 4.7T Varian, so none of the built-in tables would work for us.

            Thanks again,
            Ehsan

            Oct 21, 2015  12:10 AM | Jerome Maller
            RE: Loading a 4D NIfTI image
            Hi DKE Experts,
            I have acquired multishell diffusion data with 140 directions and 8 interleaved b=0 volumes. The first b-value is for the first 25 directions, the second b-value is for 40 directions, and the third b-value is for the last 75 directions. Am I able to process my data with DKE, or do each of the 3 non-zero b-values have to have the exact same number of directions?
            Thankyou!
            Jerome

            • Oct 22, 2015  02:10 PM | Russell Glenn - Medical University of South Carolina
              RE: Loading a 4D NIfTI image
              Hi Jerome,

              You can still use DKE to process your data, provided the highest b-value is not too large (typically less than about 3000 s/mm^2). Right now to get this to work, you have to set up a different gradient table for each b-value, and then when you set up your parameters file you should add things like:

              ndir = [25,40,75];
              bval = [0, bval1, bval2, bval3];
              idx_gradients = {1:25,1:40,1:75};
              fn_gradients = {'fn_gradient1.txt', 'fn_gradient2.txt', 'gradient3.txt'};

              Hopefully in the future we will have an option to just add a complete b-values table and gradient table.

              Best,

              Russell

  • Jun 29, 2014  12:06 AM | Robert Welsh
    DKE Crashes
    Hi,

    I'm trying to use DKE with dki data taken on a Philips system.

    I've the 4D nifti file and a bvec file and a bval file. Each row of bvec is the gradient direction (unit norm'd vector) and there is a corresponding row in the bval. I acquired a single b=0 image, 32 b=1000, and 32 b=2000 images.

    I'm running the 64 bit version 251 on windows 8.1.

    I can choose my bvec.dat file, but then b-values field in the DKE parameter window defaults to [0 1000 2000] should I change that to be [0 1000 ... 1000 2000 ... 2000] (there there are 32 total repeats of 1000 and 32 total repeats of 2000)?

    When I tried that the software crashed.

    When I leave the b-values to be [0 1000 2000] I get the error: "Processing failed with message: No error" in the GUI and "bad subscript" error in the command window.

    I'm attaching screen shots.

    My NII file is:

    fslinfo 20140617_102324IM_0001WIPDKI32DIRSENSEs1001a1010
    data_type INT16
    dim1 96
    dim2 96
    dim3 55
    dim4 65
    datatype 4
    pixdim1 2.7083332539
    pixdim2 2.7083332539
    pixdim3 2.7000000477
    pixdim4 7.8000011444
    cal_max 0.0000
    cal_min 0.0000
    file_type NIFTI-1+

    And I'm attaching the bvec.dat file.

    -Robert Welsh

    • Nov 5, 2014  08:11 PM | Emilie McKinnon - MUSC
      RE: DKE Crashes
      Dear Robert,

      First of all my apologies for the late reply and I hope you have resolved the issue and are satisfied with DKE.

      Just in case I will give you some suggestions!

      - What is the structure of the gradients in your .dat file?  If it is the standard output .bvec of dcm2nii the matrix is most likely a 3x65 matrix (in your case).

      First of all you will have to remove the first column (0,0,0), which corresponds to the B0 image. DKE only needs the 'real' gradient values.
      For a 32 gradient protocol, DKE will expect a gradient file with a matrix of the size (32x3). As in most cases the same gradients are used for multiple B-values. This should not be an issue.

      We are working on a new release, where you will be able to submit the gradient values in a different manner. For example a 64x3 matrix.

      Watch out: Some Philips scanners create an average image after all gradient images. This image should be removed before doing the analysis. Normally dcm2nii will do this for you, but just so you make sure every image is lined up with the correct gradient value.

      Making these adjustments should resolve the issue.
      Please let me know if you have any further concerns.
      Kindest Regards,
      Emilie McKinnon

      Nov 5, 2014  08:11 PM | Emilie McKinnon - MUSC
      RE: DKE Crashes
      Actually, if you would really like two different set of 32 gradient directions. There is one way around this in the current version.
      Create 2 separate text files with in each respectively a 32x3 matrix.  Then run DKE from the command window with an adjusted DKEParamaters.dat file.
      I have attached an example of how the .dat file should look like. Most important fields to pay attention to, are fn_gradients, idx_gradients{1}, idx_gradients{2} and ndir.

      Hope this helps! 
      All the best,
      Emilie

      Oct 15, 2015  06:10 PM | Ehsan Misaghi - University of Alberta
      RE: DKE Crashes
      Dear all,

      I'm having almost the same problem. I loaded the gradient table (60x3, since I have a DKI dataset with 30 directions with a b-value of 1000 and 30 directions with a b-value of 2000) and DKE actually shows the gradient table after I load it, so I guess it can read it correctly. I then load the 4D NIfTI file, which consists of a b0 image at the beginning, followed by 60 directions (30 b=1000 and 30 b=2000). I start the processing procedure, but it crashes with the error: "Index exceeds matrix dimensions. Error in dke_estimate (line 188). Error in dke (line 182). MATLAB:badsubscript". Is there anything I'm doing wrong here?

      Any help would be appreciated.

      Thanks,
      Ehsan

      • Oct 15, 2015  06:10 PM | Emilie McKinnon - MUSC
        RE: DKE Crashes
        Hi Ehsan,

        Did you read my response above?
        DKE expects a gradient file that it 30x3 if you have a 30 direction protocol.

        best,
        Emilie

        • Oct 15, 2015  07:10 PM | Ehsan Misaghi - University of Alberta
          RE: DKE Crashes
          Hi Emilie,

          Yes, I read your response. But, I have 60 directions, not 30. The directions for b=1000 are different from the directions used for b=2000. So, I guess I need a 60x3 matrix, right?

          Thanks,
          Ehsan

          • Oct 15, 2015  07:10 PM | Emilie McKinnon - MUSC
            RE: DKE Crashes
            Dear Ehsan,

            Look at my response :

            Actually, if you would really like two different set of 32 gradient directions. There is one way around this in the current version.
            Create 2 separate text files with in each respectively a 32x3 matrix. Then run DKE from the command window with an adjusted DKEParamaters.dat file.
            I have attached an example of how the .dat file should look like. Most important fields to pay attention to, are fn_gradients, idx_gradients{1}, idx_gradients{2} and ndir.

            Hope this helps!
            All the best,
            Emilie
            Attachment: differentgradientvalues.PNG

            So you will need to run DKE in the terminal and change the DKE parameter file, more specifically the fn_gradients and add 2 different gradient text files here as a cell. ( like in the image attached in my previous post).

            You will find more information on how to run DKE in the terminal in our manual.

            Emilie