Skip to content

Commit

Permalink
resolved data file, created hard materials and recomputed images
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyakadu committed Jan 29, 2022
1 parent eb7960f commit 58e242a
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 35 deletions.
42 changes: 42 additions & 0 deletions data/MatrixTXrayHard100chan_93mat_20MinEn_119MaxEn.csv

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/example_Disk.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% Disk phantom of size 256 x 256
%%% 8 materials
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Full-view setting: 60 angles from 0 to 180
%
% Authors:
% Ajinkya Kadu,
Expand Down
6 changes: 3 additions & 3 deletions examples/example_MixedDisk.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% Mixed Disk phantom of size 128 x 128
%%% 5 materials
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Full-view setting: 60 angles from 0 to 180
%
% Authors:
% Ajinkya Kadu,
Expand Down
5 changes: 2 additions & 3 deletions examples/example_SheppLogan.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% 5 materials
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Full-view setting: 60 angles from 0 to 180
%
% Authors:
% Ajinkya Kadu,
Expand Down Expand Up @@ -86,4 +86,3 @@
%% plots and tables

strOut = computeResults(strProb,strRU,strUR,strJ,strD);

6 changes: 3 additions & 3 deletions examples/example_SheppLogan3D.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% 3D Shepp Logan phantom of size 128 x 128 x 128
%%% 3 materials
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Full-view setting: parallel beam geometry, 60 angles from 0 to 180
%
% Authors:
% Ajinkya Kadu,
Expand Down
4 changes: 2 additions & 2 deletions examples/example_SheppLogan_LimitedView.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% 5 materials
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Limited-view setting: parallel-beam 60 angles from 0 to 120 degrees
%
% Authors:
% Ajinkya Kadu,
Expand Down
2 changes: 1 addition & 1 deletion examples/example_SheppLogan_SparseAngle.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% 5 materials
%%% 100 channels
%%% Sparse-angle setting: 10 angles from 0 to 180
%
Expand Down
6 changes: 3 additions & 3 deletions examples/example_Thorax.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%%% Spectral Tomography
%%% Shepp Logan phantom of size 128 x 128
%%% 6 materials
%%% Thorax phantom of size 512 x 512
%%% 5 materials (3 soft + 2 hard)
%%% 100 channels
%%% Full-view setting: 360 angles from 0 to 360
%%% Full-view setting: 60 angles from 0 to 180 degrees
%
% Authors:
% Ajinkya Kadu,
Expand Down
Binary file modified images/comparison-maps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions mbin/ADJUST.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
end

epochs = getoptions(options,'iterMax',1e3); % maximum number of ALS iterations
epIter = getoptions(options,'innerIter',2); % inner-iterations
epIter = getoptions(options,'innerIter',5); % inner-iterations
qA = getoptions(options,'qA',1); % max-value for matrix A
resTol = getoptions(options,'resTol',1e-6); % tolerance for residual
relTol = getoptions(options,'relTol',1e-9); % tolerance for residual progress
Expand Down Expand Up @@ -271,7 +271,7 @@
if sum(x(:)) >= 1
for i=1:MAX_ITER

x1 = transpose(proj_simplex_q(x',1,1));
x1 = transpose(proj_simplex_q(0.5*(x+R)',1,1));
x = proj_simplex_q(x1,1,0);

if norm(x1-x,'fro') < 1e-6
Expand Down
32 changes: 21 additions & 11 deletions mbin/computeResults.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
% 4) ADJUST - proposed method
%
% Input:
% strProb -
% strRU -
% strUR -
% strJ -
% strD -
% strProb - problem structure containing A (spatial maps), F (spectral
% maps) and n (size of spatial images)
% strRU - numerical results of RU method that contains A and F
% strUR - numerical results of UR method that contains A and F
% strJ - numerical results of classical Joint method that contains A
% and F
% strD - numerical results of ADJUST method that contains A and F
%
% Output:
% sO - output structure containing sO.UR, sO.RU, sO.cJoint, sO.ADJUST
Expand Down Expand Up @@ -106,21 +108,29 @@
k = size(A,2);

if length(n) == 2
figure(100);
fig = figure(100);colormap hot;
for i=1:k
AtI = reshape(A(:,i),n);
AruI = reshape(Aurf(:,i),n);
AurI = reshape(Aurf(:,i),n);
AjI = reshape(Ajf(:,i),n);
AdI = reshape(Adf(:,i),n);

subplot(k,5,5*(i-1)+1);imshow(AtI);title(sprintf('True-%d',i));
subplot(k,5,5*(i-1)+2);imshow(AruI);title(sprintf('RU-%d',i));
subplot(k,5,5*(i-1)+3);imshow(AurI);title(sprintf('UR-%d',i));
subplot(k,5,5*(i-1)+4);imshow(AjI);title(sprintf('cJoint-%d',i));
subplot(k,5,5*(i-1)+5);imshow(AdI);title(sprintf('ADJUST-%d',i));
subplot(k,5,5*(i-1)+1);imagesc(AtI,[0 1]);title(sprintf('True-%d',i));
axis image;set(gca,'XTick',[],'YTick',[]);
subplot(k,5,5*(i-1)+2);imagesc(AruI,[0 1]);title(sprintf('RU-%d',i));
axis image;set(gca,'XTick',[],'YTick',[]);
subplot(k,5,5*(i-1)+3);imagesc(AurI,[0 1]);title(sprintf('UR-%d',i));
axis image;set(gca,'XTick',[],'YTick',[]);
subplot(k,5,5*(i-1)+4);imagesc(AjI,[0 1]);title(sprintf('cJoint-%d',i));
axis image;set(gca,'XTick',[],'YTick',[]);
subplot(k,5,5*(i-1)+5);imagesc(AdI,[0 1]);title(sprintf('ADJUST-%d',i));
axis image;set(gca,'XTick',[],'YTick',[]);
pause(1);
end
h = axes(fig,'visible','off');
colorbar(h,'Position',[0.93 0.168 0.022 0.7]);

elseif length(n) == 3
figure(100);
for i=1:k
Expand Down
8 changes: 4 additions & 4 deletions mbin/loadSpectralPhantom.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
switch phantomId
case 'SheppLogan'
A = spectralSheppLogan(n);
T = readmatrix('MatrixTXray100chan_93mat_20MinEn_119MaxEn.csv');
T = readmatrix('MatrixTXrayHard100chan_93mat_20MinEn_119MaxEn.csv');
F = T(0+(1:size(A,2)),:);
q = readmatrix('VectorIXrayMatMoEn100Min5Max35.csv');
case 'Disks'
k = 8;
A = spectralPhantomCircles(n,k);
T = readmatrix('MatrixTXray100chan_93mat_20MinEn_119MaxEn.csv');
T = readmatrix('MatrixTXrayHard100chan_93mat_20MinEn_119MaxEn.csv');
F = T(10+(1:size(A,2)),:);
q = readmatrix('VectorIXrayMatMoEn100Min5Max35.csv');
case 'Thorax'
Expand All @@ -33,12 +33,12 @@
case 'MixedDisk'
k = 5;
A = spectralPhantomCirclesMixed(n, k);
T = readmatrix('MatrixTXray100chan_93mat_20MinEn_119MaxEn.csv');
T = readmatrix('MatrixTXrayHard100chan_93mat_20MinEn_119MaxEn.csv');
F = T(0+(1:size(A,2)),:);
q = readmatrix('VectorIXrayMatMoEn100Min5Max35.csv');
case 'SheppLogan3D'
A = spectralSheppLogan3D(n);
T = readmatrix('MatrixTXray100chan_93mat_20MinEn_119MaxEn.csv');
T = readmatrix('MatrixTXrayHard100chan_93mat_20MinEn_119MaxEn.csv');
F = T(0+(1:size(A,2)),:);
q = readmatrix('VectorIXrayMatMoEn100Min5Max35.csv');
otherwise
Expand Down

0 comments on commit 58e242a

Please sign in to comment.