-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMAR.m
More file actions
executable file
·111 lines (86 loc) · 3.13 KB
/
Copy pathMAR.m
File metadata and controls
executable file
·111 lines (86 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
% function MAR
clear
close all
%dataDir = 'C:\Users\ndwork\Desktop\';
%dataDir = 'C:\Users\ndwork\Documents\My Stuff\My School\Data\ctMetalArtifact\';
%dataDir = 'C:\Users\Uzair\SkyDrive\Stanford Docs\EE 369C\Project\';
dataDir = '../data/';
dataFile=[dataDir,'/Siemens_FromEdBoas/precalc_Hep.bin'];
disp(['dataFile: ', dataFile]);
sliceIndx=5;
if numel( dataFile ) > 0
if( regexp(dataFile,'\.bin$') ) %Siemens data
data = readSiemensData( dataFile );
sSinoF = size( data.sino );
totFanAngle = data.fanIncr * sSinoF(2);
gammas = ( data.fanIncr * [1:sSinoF(2)] ) - data.fanIncr*sSinoF(2)/2;
dBeta = 2*pi/sSinoF(1);
maxBeta = 2*pi - dBeta;
betas = 0:dBeta:maxBeta;
dTheta = 2*dBeta;
oThetas = [0,dTheta,maxBeta];
thetas = 0:dTheta:maxBeta-dBeta;
dSize = 0.001;
delta = dSize;
oLines = [-0.3,dSize,0.3];
sid_m = data.SID / 1000;
sino = ctFan2Para( data.sino, gammas, betas, sid_m, ...
oThetas, oLines );
else
%GE Data
data = readGEData([dataDir,'\',files(i).name]);
sSinoF = size( data.sino );
totFanAngle = data.fanIncr * sSinoF(2);
gammas = ( data.fanIncr * [1:sSinoF(2)] ) - data.fanIncr*sSinoF(2)/2;
dBeta = 2*pi/sSinoF(1);
maxBeta = 2*pi - dBeta;
betas = 0:dBeta:maxBeta;
oThetas = [0,dBeta,maxBeta];
thetas=0:dBeta:maxBeta-dBeta;
dSize=0.001;
delta=dSize;
oLines = [-0.3,dSize,0.3];
sid_m = data.SID / 1000;
sinoF=squeeze(data.sino(:,:,sliceIndx));
sino = ctFan2para( sinoF, gammas, betas, sid_m, ...
oThetas, oLines );
end
else
% Simulated Data
delta=0.001;
NumDet=500;
dSize=delta;
dtheta=1*(pi/180);
thetas=0:dtheta:pi-dtheta;
phant=createPhantom(delta, [0, 0], 0.05 );
sino=ctRadon(phant.im,delta,NumDet,dSize,thetas);
end
sizeSino=size(sino);
%%
%[rubbedSino,sinoMask]=rubOutSino(sino,50,thetas,sizeSino(2),dSize, 0, 0, 512, 512, delta, delta, 'Hanning');
%reconRubbed=ctIRadon(rubbedSino, thetas, dSize, 0, 0, 512, 512, delta, delta, 'Hanning');
%%
%recon=ctIRadon(sino, thetas, dSize, 0, 0, 512, 512, delta, delta, 'Hanning');
%figure('name','ctIRadon recon'),imshow(recon,[])
%%
%reconNonMetal=ctIRadonMetal(sino,thetas,dSize,0,0,512,512,delta,delta,'Hanning');
%figure,imshow(reconNonMetal,[]);
%%
%marwavRecon=marWav(sino,thetas,sizeSino(2),dSize,0,0,512,512,delta,delta, 'Hanning');
%figure('name','marWav recon'), imshow( marwavRecon, [] );
%%
%marwavRadRecon=marWavRad(sino,thetas,sizeSino(2),dSize,0,0,512,512,delta,delta, 'Hanning');
%figure('name','marWavRad recon'), imshow( marwavRadRecon, [] );
%%
reconShearRad = marShearRad(sino,thetas,dSize,0,0,512,512,delta,delta, 'Hanning');
save( 'reconShearRad.mat', 'reconShearRad' );
%figure('name','marWavRad recon'), imshow( marwavRadRecon, [] );
%%
%ruboutRecon=rubOut(recon,21000);
%figure('name','rubOut recon'), imshow( ruboutRecon, [] );
%%
%reconMDTed=mdt(recon,50);
%%
%mardsRecon=marDS(sino,thetas,sizeSino(2),dSize,0,0,512,512,delta,delta,'Hanning');
%%
%mardsRecon=marCP(sino,thetas,sizeSino(2),dSize,0,0,512,512,delta,delta,'Hanning');