Hello, I want to use dwi2tensor in an existing pipeline where dcm2niix was used to create NIfTI images as well as FSL format bval/bvec files. While dwipreproc supports -fslgrad, tools like dwi2tensor only supports the grad file format. Is the conversion still complex - the code suggests that FSL assumes a LHS coordinate system whereas MRtrix does not. My niave Matlab code (below) seems to work with my examples, but I am not sure if this is a universal solution. In brief, is there an easy way to convert FSL bvec/bval files to MRtrix when the images are in NIfTI format, and if not is there a chance that dwi2tensor could be upgraded to support the -fslgrad arguments?
%create MRTrix compatible grad file: size [ndwis, 4], format: [gx, gy, gx, b]
grad = [bvec; bval]’;
fid = fopen(grad_nam,‘w’);
for i = 1 : size(grad,1)
fprintf(fid, ‘%g %g %g %g\n’, grad(i,1), grad(i,2), grad(i,3), grad(i,4));