Converting non-isotropic to isotropic voxel

痴心易碎 提交于 2019-12-10 18:23:43

问题


I am trying to register two brain image volumes (each includes 2D slices). The first volume (target or moving volume) has the slice thickness and spacing of 1.5 and [1.5 1.5] respectively. For the second one (reference volume), these values are 4 and [0.9375 0.9375]. Also the number of slices are different. First volume has 96 slices and second has 44 slices.

One of my friends, suggested to make the voxels isotropic, but I do not know how to do that. I can see that first volume is isotropic, but not the second one. I am wondering how I should do that?

Also, I will consider two slices of each volume and apply a feature extraction method on it. So, both of these slices should be related to the same layer of the brain (same scene). Considering the different number of slices, what should I do and how should I re-calculate new slices of the first volume to be the same as the second volume?


回答1:


If I understand your problem correctly, it's sounds like you want to take an image stack with voxels of a given size interpolate it so that you define a new coordinate system in which each voxel is isotropic (i.e. has equal height width and depth, i.e. cubic voxels). If so might the help:

(I'm using matlabs supplied mri data as an example)

load mri D
D=double(squeeze(D));   % remove singleton dimension, convert to double
szD_a=size(D);          % get size of original image stack
vox_a = [.4, .4, .45];  % define size of voxel in original image stack
vox_b = [.25, .25, .25];% define size of voxel in target image stack
szD_b = ceil((size(D)-1).*vox_a./vox_b)+1; % set size of target image stack

% define coordinates of voxels in original image stack
[Xa,Ya,Za]=meshgrid(...
    [0:szD_a(1)-1]*vox_a(1),...
    [0:szD_a(2)-1].*vox_a(2),...
    [0:szD_a(3)-1].*vox_a(3));

% define coordinates of voxels in original image stack
[Xb,Yb,Zb]=meshgrid(...
    [0:szD_b(1)-1]*vox_b(1),...
    [0:szD_b(2)-1].*vox_b(2),...
    [0:szD_b(3)-1].*vox_b(3));

D_target = interp3(Xa,Ya,Za,D,Xb,Yb,Zb);

figure
for t=0:vox_b(3):max(Zb(:))
    subplot(1,2,1)
    imagesc(D(:,:,floor(t/vox_a(3))+1))
    subplot(1,2,2)
    imagesc(D_target(:,:,floor(t/vox_b(3))+1))
    drawnow
    pause(0.1)
end


来源:https://stackoverflow.com/questions/32018133/converting-non-isotropic-to-isotropic-voxel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!