Brain mask from dMRI data to be used for machine learning model

Hi all,

Could you guys provide any suggestions for preparation of a brain mask from a dMRI files like .nii, bvals and bvecs. (I am aware of FSL where one command can transform the image into a mask but it had some issues with shape not matching)

I intend to use the brain mask in running a deep learning algorithm for tractography. When I used FSL it gave a mask but the problem was that there was a mismatch in shape.