Contents
addpath src/utils
parameters
K = 4;
Km = 6;
block_dim = 10;
tol = 1e-3;
load image and compute temporal coefficients
recon = squeeze(readcfl('data-2016-01-03/recon'));
recon = squeeze(recon(:,:,1,:));
bas = squeeze(readcfl('data-2016-01-03/bas'));
[ny, nz, T] = size(recon);
Phi = bas(:,1:K);
alpha = temporal_adjoint(recon, Phi);
figure(1)
imshow(reshape(abs(alpha), ny, []), [])
ftitle('Temporal Coefficient Images');
Size: 1 260 240 1 2 80
Size: 1 1 1 1 1 80 80
Compute LLR singular values and degrees of freedom
[~, s_vals] = llr_thresh(alpha, 0, [block_dim, block_dim], false);
s_vals = imresize(s_vals, 10);
alpha_dof = sum(s_vals > tol * max(s_vals(:)), 3);
figure(2);
imshow(alpha_dof, []), colorbar;
ftitle('LLR Degrees of Freedom');
Classify with k-means clustering
IDX = kmeans(reshape(abs(alpha), [], K), Km);
alpha_classes = reshape(IDX, ny, nz);
figure(3);
imshow(alpha_classes, []), colormap('default'), colorbar;
ftitle('K-Means Clustering');