KCL-BMEIS / niftyreg

This project contains command line tools to perform rigid, affine and non-linear registration of nifti or analyse images as well as utilities
BSD 3-Clause "New" or "Revised" License
141 stars 42 forks source link

reg_f3d nrr_cpp.nii #94

Closed Rigel-X closed 1 year ago

Rigel-X commented 1 year ago

I guess nrr_cpp.nii, the output from reg_f3d, is the motion field? but how should I interpret it? show it as grid? vector? I checked its dimention -- likely control grid. but why is there a drift along x / y separately? neither (x,y) or x^2+y^2 made sense to me... image

Rigel-X commented 1 year ago

Or is there any built-in tool to visualize the nrr_cpp.nii?

BailiangJ commented 1 year ago

They are the cubic B-Spline parametrised grid. I use reg_transform to generate the flow field from it. Check (http://cmictig.cs.ucl.ac.uk/wiki/index.php/Reg_transform) .

Rigel-X commented 1 year ago

Thanks! reg_transform -ref ref.nii -def nrr_cpp.nii field.nii made it make more sense! I still have a question regarding the field.nii, which had the third dimension -- how should I combine them? image

Rigel-X commented 1 year ago

SORRY it's -disp not -def

Rigel-X commented 1 year ago

I found one: https://www.mathworks.com/matlabcentral/fileexchange/20057-b-spline-grid-image-and-point-based-registration Spacing = [5,5]; figure, for np = FloPhase Igrid=make_grid_image(Spacing,size(refimg)); O_trans = squeeze(Bgrid(:,:,:,np)); % Bgrid was nrr_cpp [Igrid,~]=bspline_transform(O_trans,Igrid,Spacing); imshow(1-Igrid,[]); title('grid'); end