I am using image registration toolbox to register two 3D images. I register the moving image to the fixed image. I use "imregtform" to save tform.
tform = imregtform(moving,fixed,transformType,optimizer,metric)
for example this is my 'tform':
1.0235 0.0022 -0.0607 0
-0.0276 1.0002 0.0089 0
-0.0170 -0.0141 1.1685 0
12.8777 5.0311 -70.0325 1.0000
then I use 'Imwarp' to transfer moving image to the fixed image. In my code it is,
nii=load_untouch_nii(['mypath image.nii' ]);
I = nii.img;
dii=nii.hdr.dime.pixdim(2:4);
Rfixed=imref3d(size(I),dii(2),dii(1),dii(3));
timg= imwarp(I, Rfixed, tform, 'OutputView', Rfixed);
'timg' is transfered image of source image.I checked it and it is working fine, but I need control points or displacement field of this transformation now. In another word, I need to know each voxel(3d pixel) moved to which position. If I know this I can draw vector field. In deformable image registartion methods such as NiftyReg package, control point command is provided to make it easy for users but I do not know how to do it in simple 3d affine in Matlab. Any help will be appreciated too much