dke-questions > 'error using dke (line 47)' with Bruker files
Showing 1-9 of 9 posts
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.
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.
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
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
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
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
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
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
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
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!
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!
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
I could get the maps successfully! :)
Clementine