|
1 | 1 | function [res,qualMeasOut]=MLEM(proj,geo,angles,niter,varargin)
|
2 |
| -%MLEM solves the tomographic problem by using Maximum Likelihood Expection |
3 |
| -% Maximitation algorithm. |
| 2 | +%MLEM solves the tomographic problem by using Maximum Likelihood Expectation |
| 3 | +% Maximisation algorithm. |
4 | 4 | %
|
5 | 5 | % MLEM(PROJ,GEO,ALPHA,NITER,opt) solves the reconstruction problem
|
6 | 6 | % using the projection data PROJ taken over ALPHA angles, corresponding
|
7 |
| -% to the geometry descrived in GEO, using NITER iterations. |
| 7 | +% to the geometry described in GEO, using NITER iterations. |
8 | 8 | %
|
9 |
| -% 'verbose': get feedback or not. Default: 1 |
| 9 | +% 'verbose': Get feedback or not. Default: 1 |
10 | 10 | %
|
11 |
| -% 'init': Describes diferent initialization techniques. |
| 11 | +% 'init': Describes different initialization techniques. |
12 | 12 | % • 'none' : Initializes the image to ones (default)
|
13 |
| -% • 'FDK' : intializes image to FDK reconstrucition |
| 13 | +% • 'FDK' : Initializes image to FDK reconstruction |
14 | 14 | %
|
15 |
| -% 'QualMeas' Asks the algorithm for a set of quality measurement |
| 15 | +% 'QualMeas': Asks the algorithm for a set of quality measurement |
16 | 16 | % parameters. Input should contain a cell array of desired
|
17 | 17 | % quality measurement names. Example: {'CC','RMSE','MSSIM'}
|
18 | 18 | % These will be computed in each iteration.
|
19 |
| -% 'groundTruth' an image as grounf truth, to be used if quality measures |
| 19 | +% |
| 20 | +% 'groundTruth': An image as ground truth, to be used if quality measures |
20 | 21 | % are requested, to plot their change w.r.t. this known
|
21 | 22 | % data.
|
22 | 23 | %--------------------------------------------------------------------------
|
|
43 | 44 | clear gt
|
44 | 45 | end
|
45 | 46 | if nargout<2 && measurequality
|
46 |
| - warning("Image metrics requested but none catched as output. Call the algorithm with 3 outputs to store them") |
| 47 | + warning("Image metrics requested but none caught as output. Call the algorithm with 3 outputs to store them") |
47 | 48 | measurequality=false;
|
48 | 49 | end
|
49 | 50 | qualMeasOut=zeros(length(QualMeasOpts),niter);
|
50 | 51 |
|
51 | 52 |
|
52 | 53 | res = max(res,0);
|
53 |
| -% Projection weight, W |
54 |
| -W=computeW(geo,angles,gpuids); |
| 54 | +% Back-projection weight, V |
| 55 | +V = Atb(ones(size(proj),'single'),geo,angles,'matched','gpuids',gpuids); |
| 56 | +V(V<=0.) = inf; |
55 | 57 |
|
56 | 58 | for ii=1:niter
|
57 | 59 | if measurequality && ~strcmp(QualMeasOpts,'error_norm')
|
58 |
| - res_prev = res; % only store if necesary |
| 60 | + res_prev = res; % only store if necessary |
59 | 61 | end
|
60 | 62 | if (ii==1);tic;end
|
61 | 63 |
|
62 | 64 | den = Ax(res,geo,angles,'gpuids',gpuids);
|
63 | 65 | den(den<=0.)=inf;
|
64 | 66 |
|
65 |
| - imgupdate = Atb(proj./den, geo,angles,'matched','gpuids',gpuids)./W; |
| 67 | + imgupdate = Atb(proj./den, geo,angles,'matched','gpuids',gpuids)./V; |
66 | 68 | res = max(res.*imgupdate,0.);
|
67 | 69 |
|
68 | 70 | if measurequality
|
|
87 | 89 | % Check inputs
|
88 | 90 | nVarargs = length(argin);
|
89 | 91 | if mod(nVarargs,2)
|
90 |
| - error('TIGRE:FISTA:InvalidInput','Invalid number of inputs') |
| 92 | + error('TIGRE:MLEM:InvalidInput','Invalid number of inputs') |
91 | 93 | end
|
92 | 94 |
|
93 | 95 | % check if option has been passed as input
|
|
103 | 105 | for ii=1:length(opts)
|
104 | 106 | opt=opts{ii};
|
105 | 107 | default=defaults(ii);
|
106 |
| - % if one option isnot default, then extranc value from input |
| 108 | + % if one option is not default, then extract value from input |
107 | 109 | if default==0
|
108 | 110 | ind=double.empty(0,1);jj=1;
|
109 | 111 | while isempty(ind)
|
|
0 commit comments