dke-questions
dke-questions > RE: fn_gradients "gradient vector table"
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
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
Threaded View
Title | Author | Date |
---|---|---|
mukesh kumar | Sep 20, 2017 | |
Emilie McKinnon | Sep 20, 2017 | |
mukesh kumar | Sep 20, 2017 | |
Emilie McKinnon | Sep 20, 2017 | |
Russell Glenn | Sep 20, 2017 | |