Dear Xi,
I usually use Matlab to create those kind of "warped grids". If you
are using fnirt you first need to convert the coefficient-file to a
field using fnirtfileutils (just type fnirtfileutils and it will tell
you how). That will give you a 4D niftii file where the three volumes
along the fourth dimension denotes displacements (in mm) in the x-, y-
and z-direction respectively. You then need to read this 4D image into
Matlab using e.g. the FSL or the SPM Matlab routines for doing that.
Let us say you have done that, and that you have your 4D displacements
in "field" and that your matrix size is in "dim" and your voxel size
in "vxs". Then do
slice=whatever % Pick a slice
ss = 2; % It will be too cluttered if you display each line
[x,y] = ndgrid(1:ss:dim(1),1:ss:dim(2));
wx = x + squeeze(field(1:ss:dim(1),1:ss:dim(2),slice,1)) / vxs(1);
wy = y + squeeze(field(1:ss:dim(1),1:ss:dim(2),slice,2)) / vxs(2);
fh = figure('Position',[100 100 300 300]);
colormap(gray);
hold on;
plot(wx,dim(2)+1-wy,'k','LineWidth',1.5); % Horisontal lines
plot(wx',dim(2)+1-wy','k','LineWidth',1.5); % Vertical lines
and then you can further pimp your figure to your liking. Please note
that any 2D warp-field like this doesn't fully capture what is going
on (since there will also be warps in and out of this slice) and
should be seen more as a caricature trying to explain the general
principle.
Good luck Jesper
|