dke-questions > DKE Tractography Error
Showing 1-6 of 6 posts
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];
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
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
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
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:
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];
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.