Ask an expert. Trust the answer.

Your academic and career questions answered by verified experts

Converting non-isotropic to isotropic voxel

Date: 2023-01-14 14:36:27

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?

Answer:

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

 


Why Matlabhelpers ?

Our Matlab assignment helpers for online MATLAB assignment help service take utmost care of your assignments by keeping the codes simple yet of high-quality. We offer the most reliable MATLAB solutions to students pursuing their Computer Science course from the Monash University, the University of Sydney, the University of New South Wales, the University of Melbourne; to name a few. Approach us today for best Matlab solutions online!

whatsApp order on matlabhelpers.com

telegram order on matlabsolutions.com