History of AFNI updates  

|
March 22, 2018 02:10PM
Hi Bob,
When using B0ref.nii as the base and B0vols.nii[0] as the source (all same resolution), I assumed that this would potentially mitigate any underlying issues of the 3dAllineate -nwarp bilinear warp field being created from different resolution datasets being off.

Interestingly, when I used 3dNwarpApply on the resulting warp field the image looked correct except that it was shifted in the Z direction by 1.5*(Zvox resolution). In my case since the voxel size in the Z direction is 2mm I used the following commands to fix the error:

1) Create the warpfield:
3dAllineate -base B0ref.nii.gz -source 'B0vols.nii[0]' -master BASE -prefix eddy_1.nii -1Dmatrix_save dwi_1.aff12.1D -1Dparam_save dwi_1.param.1D -nwarp_save warp_1.nii.gz -warp aff -nwarp bilinear

2) Extract the X and Y component of the warp field which seem correct:
3dcalc -a warp_1.nii.gz[0..1] -datum float -prefix warp_1a.nii.gz -expr 'a'

3) Fix the Z component of the warp field which is off by 3mm in this case (or generalized to 1.5*Zvoxsize)
3dcalc -a warp_1.nii.gz[2] -datum float -prefix warp_1b.nii.gz -expr 'a+3'

4) Concatenate the new field
3dTcat -prefix warp_2.nii.gz warp_1a.nii.gz warp_1b.nii.gz

5) Apply warp
3dNwarpApply -master B0ref.nii.gz -source B0vols.nii[0] -prefix 3dNwarp.nii -nwarp "warp_2.nii.gz"

The scaling is still an issue with different resolution between base/source, but when matched this seems to work....I am going to be running a few datasets with different resolutions in case the 1.5*Zvox was somehow a fluke and will follow up if this is not the case. Hope this helps.


Best,
Ajay
Subject Author Posted

Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK January 04, 2018 12:05PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK January 24, 2018 06:02PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

Bob Cox January 25, 2018 08:54AM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK March 21, 2018 04:58PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

RWCox March 21, 2018 05:26PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK March 21, 2018 05:53PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

RWCox March 22, 2018 05:51AM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK March 22, 2018 07:20AM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

Bob Cox March 22, 2018 01:20PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK March 22, 2018 02:10PM

Re: Combining transforms 3dAllineate -nwarp (bilinear) and 3dQwarp

AjaySK March 22, 2018 02:10PM