53 lines
2.0 KiB
53 lines
2.0 KiB
1 year ago
|
function symmetryCheck()
|
||
|
load voxel_afterSmooth40.mat voxel
|
||
|
resolution=40;
|
||
|
|
||
|
nx=60;ny=1;nz=20;
|
||
|
unsym_vol = zeros(nx,ny,nz,3);
|
||
|
unsym_fac = zeros(nx,ny,nz,3);
|
||
|
for ix=1:nx
|
||
|
for iy=1:ny
|
||
|
for iz=1:nz
|
||
|
VOXEL_ele = voxel((iy-1)*resolution+1:iy*resolution,...
|
||
|
(ix-1)*resolution+1:ix*resolution,...
|
||
|
(iz-1)*resolution+1:iz*resolution);
|
||
|
unsym_vol(ix,iy,iz,:)=[sum(abs(VOXEL_ele(1:20,:,:)-VOXEL_ele(40:-1:21,:,:)),'all'),...
|
||
|
sum(abs(VOXEL_ele(:,1:20,:)-VOXEL_ele(:,40:-1:21,:)),'all'),...
|
||
|
sum(abs(VOXEL_ele(:,:,1:20)-VOXEL_ele(:,:,40:-1:21)),'all')]./(40^2*20);
|
||
|
|
||
|
unsym_fac(ix,iy,iz,:)=[sum(abs(VOXEL_ele(1,:,:)-VOXEL_ele(40,:,:)),'all'),...
|
||
|
sum(abs(VOXEL_ele(:,1,:)-VOXEL_ele(:,40,:)),'all'),...
|
||
|
sum(abs(VOXEL_ele(:,:,1)-VOXEL_ele(:,:,40)),'all')]./40^2;
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
% save symmetryCheck.mat unsym_vol unsym_fac
|
||
|
% figure()
|
||
|
% subplot(311)
|
||
|
% imagesc(squeeze(unsym_vol(:,1,:,2)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
% set(gca,'YDir','normal')
|
||
|
% subplot(312)
|
||
|
% imagesc(squeeze(unsym_vol(:,1,:,3)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
% set(gca,'YDir','normal')
|
||
|
% subplot(313)
|
||
|
% imagesc(squeeze(unsym_vol(:,1,:,1)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
% set(gca,'YDir','normal')
|
||
|
%
|
||
|
% figure()
|
||
|
% imagesc(squeeze(unsym_vol(:,1,:,2)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
% set(gca,'YDir','normal')
|
||
|
% figure()
|
||
|
% imagesc(squeeze(unsym_vol(:,1,:,3)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
% set(gca,'YDir','normal')
|
||
|
figure()
|
||
|
imagesc(squeeze(unsym_fac(:,1,:,1)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
set(gca,'YDir','normal')
|
||
|
figure()
|
||
|
imagesc(squeeze(unsym_fac(:,1,:,2)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
set(gca,'YDir','normal')
|
||
|
mean(squeeze(unsym_fac(:,1,:,2)),'all')
|
||
|
figure()
|
||
|
imagesc(squeeze(unsym_fac(:,1,:,3)).'); axis equal; axis tight; axis off;colorbar;%caxis([0.5,2])
|
||
|
set(gca,'YDir','normal')
|
||
|
mean(squeeze(unsym_fac(:,1,:,3)),'all')
|
||
|
end
|