Iam working with CTA volume having dimensions 512*512*304. How I can convert the volume into isotropic form having axial size of 256*256.I have gone through Converting non-isotropic to isotropic voxel but it didnt help me .
Iam not sure how to proceed but still i have read necessary parameters (may be required for above problem)from dicom including spacing between slices=0.45 AND pixel spacing is 0.4 for both x & y.
One more question I want to ask is about transformation into world coordinates. When I am working with original volume(512*512*304), The extracted tube is identical in shape to the reference data , but in terms of coordinates position, it shows a notable difference. My colleague asked me that reference data is in world coordinate.
Many thanks in advance;
It sounds like you are trying to redefine your coordinate grid to one with isotropic (ie cube, ie equal height, width, length) voxels.
Perhaps something like this would do it: (I'm using matlabs sample mri data for an example)
load mri D
D=double(squeeze(D)); % Remove singleton dimension and convert from int to double
szD_a=size(D); % calculate size of original image stack
vox_a = [.4,.4,.45]; % define original voxel size
vox_b = [.25,.25,.25]; % set target voxel size
szD_b=ceil((szD_a-1).*vox_a./vox_b)+1; % calculate size of target image stack
% plus and minus 1 account for
% pixel (1,1,1) being at coordinate [0,0,0]
% Get x,y,z coordinates of each voxel 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 x,y,z coordinates of each voxel in target 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));
% interpolate imagestack from original to target coordinates
D_target=interp3(Xa,Ya,Za,double(D),Xb,Yb,Zb);
figure
subplot(1,2,1)
imagesc(D(:,:,1))
subplot(1,2,2)
imagesc(D_target(:,:,1))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.