Tensor fitting with voxel-wise bmatrices

Submitted by ywu94@hawk.iit.edu on Tue, 03/28/2023 - 21:47

Dear TORTOISE experts, 

I wonder if it is possible to nonlinearly transform DWI and bmatrix file to a target space and then estimate diffusion tensor in said target space. To achieve this, I have already taken the following steps:

1. Preprocessed the DWI using DIFFPREP, obtaining the files filename_DMC.nii.gz and filename_DMC.bmtxt which were used in the following steps.

2. Used the command "CreateVoxelwiseBmatricesFromDeformationField" to transform the filename_DMC.bmtxt file into voxel-wise Bmatrices in Nifti format.

3. Nonlinearly transformed the DWI by treating it as a series of scalar images.

Currently, I am attempting to run the "EstimateTensorNLLSRESTORE" command with the "--use_voxelwise_bmat" option, but am unsure of the correct procedure. As this command requires an input listfile, should I provide the original filename_DMC.list or modify this listfile accordingly? Specifically, should I provide the DWI and voxel-wise Bmatrices after nonlinear transformation in the listfile under the tag of <!-- The 4D NIFTI image containing the b=0 volumes and the DWIs --> and <!-- NAME OF BMATRIX FILE --> respectively? Finally, is it necessary to also transform the filename_DMC_noise.nii?

I would greatly appreciate any guidance you can offer. 





Submitted by irfanogl on Fri, 04/14/2023 - 14:00


hello Yingjuan,

Apologies for the delay. I have been away for some time and just got back.


First let me ask a question.

Why would you like to do this?  I understand that if you want to fix anything besides a tensor that is exactly what you have to do. but if you are only fitting a tensor, I would just compute the tensor in native space (DMC space) and warp it with ApplyTransformationToTensor.

That would be much easier.

However if you want to do it the way you described or if you want to fit another model:


1) Kind of yes kind of no to your question. . After warping the DWIs, you should have a corresponding listfile (you can manually create this), a bmtxt file (just copy the original, it will not be used but has to be present).   the list file has the contain the tag:


The filename for vbmat should just be the filename not the fullpath.

If this tag and the corresponding file are present while fitting the tensor, if you request it with "-v 1"  then the textfile BMTXT will not be used but the voxelwise Bmatrices will instead.

2) Honestly, I dont tink I ever fit Voxelwise RESTORE. I generally do it with NLLS.   Normally I would not suggest to transform the noise file but for RESTORE it might be needed.   


Hope this helps.