diff --git a/MATLAB/Algorithms/AB_GMRES.m b/MATLAB/Algorithms/AB_GMRES.m index 97e317a0..80e6a42e 100644 --- a/MATLAB/Algorithms/AB_GMRES.m +++ b/MATLAB/Algorithms/AB_GMRES.m @@ -109,7 +109,7 @@ resL2(k)=im3Dnorm(proj-Ax(compute_res(x,w(:,1:k),y,geo,angles,backproject,gpuids),geo,angles,'Siddon','gpuids',gpuids),'L2'); if k>1 && resL2(k)>resL2(k-1) x=compute_res(x,w(:,1:end-1),y(1),geo,angles,backproject,gpuids); - disp(['Algorithm stoped in iteration ', num2str(k),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(k),' due to loss of orthogonality.']) return; end diff --git a/MATLAB/Algorithms/AwASD_POCS.m b/MATLAB/Algorithms/AwASD_POCS.m index 2489219c..6cac5e24 100644 --- a/MATLAB/Algorithms/AwASD_POCS.m +++ b/MATLAB/Algorithms/AwASD_POCS.m @@ -26,13 +26,13 @@ % 'TViter': Defines the amount of TV iterations performed per SART % iteration. Default is 20 % -% 'alpha': Defines the TV hyperparameter. default is 0.002 +% 'alpha': Defines the TV hyperparameter. Default is 0.002 % % 'alpha_red': Defines the reduction rate of the TV hyperparameter % -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 % 'maxL2err' Maximum L2 error to accept an image as valid. This % parameter is crucial for the algorithm, determines at % what point an image should not be updated further. diff --git a/MATLAB/Algorithms/BA_GMRES.m b/MATLAB/Algorithms/BA_GMRES.m index 0e8b8379..9e7f38bb 100644 --- a/MATLAB/Algorithms/BA_GMRES.m +++ b/MATLAB/Algorithms/BA_GMRES.m @@ -106,7 +106,7 @@ resL2(k)=im3Dnorm(aux,'L2'); if k>1 && resL2(k)>resL2(k-1) x=compute_res(x,w(:,1:k),y,geo); - disp(['Algorithm stoped in iteration ', num2str(k),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(k),' due to loss of orthogonality.']) return end diff --git a/MATLAB/Algorithms/B_ASD_POCS_beta.m b/MATLAB/Algorithms/B_ASD_POCS_beta.m index 9b9f17c0..dd580343 100644 --- a/MATLAB/Algorithms/B_ASD_POCS_beta.m +++ b/MATLAB/Algorithms/B_ASD_POCS_beta.m @@ -25,13 +25,13 @@ % 'TViter': Defines the amount of TV iterations performed per SART % iteration. Default is 20 % -% 'alpha': Defines the TV hyperparameter. default is 0.002 +% 'alpha': Defines the TV hyperparameter. Default is 0.002 % % 'alpha_red': Defines the reduction rate of the TV hyperparameter % -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 % 'maxL2err' Maximum L2 error to accept an image as valid. This % parameter is crucial for the algorithm, determines at % what point an image should not be updated further. diff --git a/MATLAB/Algorithms/CGLS.m b/MATLAB/Algorithms/CGLS.m index edf8d1e6..967b52e9 100644 --- a/MATLAB/Algorithms/CGLS.m +++ b/MATLAB/Algorithms/CGLS.m @@ -25,7 +25,7 @@ % are requested, to plot their change w.r.t. this known % data. % 'restart' true or false. By default the algorithm will restart when -% loss of ortogonality is found. +% loss of orthogonality is found. %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- % This file is part of the TIGRE Toolbox @@ -85,12 +85,12 @@ qualMeasOut(:,iter)=Measure_Quality(x0,x,QualMeasOpts); end - % The following should never happen, but the reallity is that if we use + % The following should never happen, but the reality is that if we use % the residual from the algorithm, it starts diverging from this explicit residual value. % This is an interesting fact that I believe may be caused either by % the mismatch of the backprojection w.r.t the real adjoint, or % numerical issues related to doing several order of magnitude - % difference operations on single precission numbers. + % difference operations on single precision numbers. aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); resL2(iter)=im3Dnorm(aux,'L2'); if iter>1 && resL2(iter)>resL2(iter-1) @@ -101,7 +101,7 @@ x=x-alpha*p; % if the restart didn't work. if remember==iter || ~restart - disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of orthogonality.']) return; end remember=iter; diff --git a/MATLAB/Algorithms/IRN_TV_CGLS.m b/MATLAB/Algorithms/IRN_TV_CGLS.m index 63bae159..f1bc7dd8 100644 --- a/MATLAB/Algorithms/IRN_TV_CGLS.m +++ b/MATLAB/Algorithms/IRN_TV_CGLS.m @@ -24,7 +24,7 @@ % are requested, to plot their change w.r.t. this known % data. % 'restart' true or false. By default the algorithm will restart when -% loss of ortogonality is found. +% loss of orthogonality is found. %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- % This file is part of the TIGRE Toolbox @@ -108,12 +108,12 @@ qualMeasOut(:,iter)=Measure_Quality(x_prev,x,QualMeasOpts); end - % The following should never happen, but the reallity is that if we use + % The following should never happen, but the reality is that if we use % the residual from the algorithm, it starts diverging from this explicit residual value. % This is an interesting fact that I believe may be caused either by % the mismatch of the backprojection w.r.t the real adjoint, or % numerical issues related to doing several order of magnitude - % difference operations on single precission numbers. + % difference operations on single precision numbers. aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); resL2(iter)=im3Dnorm(aux,'L2'); if mod(iter,niter_break)~=1 && resL2(iter)>resL2(iter-1) @@ -123,7 +123,7 @@ x=x-alpha*p; % if the restart didn't work. if remember==iter || ~restart - disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of orthogonality.']) return; end remember=iter; diff --git a/MATLAB/Algorithms/LSMR.m b/MATLAB/Algorithms/LSMR.m index 49e2dd7e..c61ccca2 100644 --- a/MATLAB/Algorithms/LSMR.m +++ b/MATLAB/Algorithms/LSMR.m @@ -24,7 +24,7 @@ % are requested, to plot their change w.r.t. this known % data. % 'restart' true or false. By default the algorithm will restart when -% loss of ortogonality is found. +% loss of orthogonality is found. %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- % This file is part of the TIGRE Toolbox @@ -167,7 +167,7 @@ % (11) Compute ||r_k|| d = d + betacheck^2; gamma_var = d + (betad - taud)^2 + betadd^2; - aux = sqrt(gamma_var); % this is the residual teh algorithm follows, but we lose ortogonality, so we compute it explicitly + aux = sqrt(gamma_var); % this is the residual the algorithm follows, but we lose orthogonality, so we compute it explicitly % ||A^T r_k || is just |zetabar| @@ -180,12 +180,12 @@ if measurequality qualMeasOut(:,iter)=Measure_Quality(x0,x,QualMeasOpts); end - % The following should never happen, but the reallity is that if we use + % The following should never happen, but the reality is that if we use % the residual from the algorithm, it starts diverging from this explicit residual value. % This is an interesting fact that I believe may be caused either by % the mismatch of the backprojection w.r.t the real adjoint, or % numerical issues related to doing several order of magnitude - % difference operations on single precission numbers. + % difference operations on single precision numbers. aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); resL2(iter)=im3Dnorm(aux,'L2'); if iter>1 && resL2(iter)>resL2(iter-1) @@ -196,7 +196,7 @@ x=x-(zeta / (rho*rhobar)) * hbar; % if the restart didn't work. if remember==iter || ~restart - disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of orthogonality.']) return; end remember=iter; diff --git a/MATLAB/Algorithms/LSQR.m b/MATLAB/Algorithms/LSQR.m index 92d27739..d278a17b 100644 --- a/MATLAB/Algorithms/LSQR.m +++ b/MATLAB/Algorithms/LSQR.m @@ -25,7 +25,7 @@ % are requested, to plot their change w.r.t. this known % data. % 'restart' true or false. By default the algorithm will restart when -% loss of ortogonality is found. +% loss of orthogonality is found. %-------------------------------------------------------------------------- %-------------------------------------------------------------------------- % This file is part of the TIGRE Toolbox @@ -129,12 +129,12 @@ qualMeasOut(:,iter)=Measure_Quality(x0,x,QualMeasOpts); end - % The following should never happen, but the reallity is that if we use + % The following should never happen, but the reality is that if we use % the residual from the algorithm, it starts diverging from this explicit residual value. % This is an interesting fact that I believe may be caused either by % the mismatch of the backprojection w.r.t the real adjoint, or % numerical issues related to doing several order of magnitude - % difference operations on single precission numbers. + % difference operations on single precision numbers. aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); resL2(iter)=im3Dnorm(aux,'L2'); if iter>1 && resL2(iter)>resL2(iter-1) @@ -145,7 +145,7 @@ x=x-(phi / rho) * (v-w)/((theta / rho)); % if the restart didn't work. if remember==iter || ~restart - disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(iter),' due to loss of orthogonality.']) return; end remember=iter; diff --git a/MATLAB/Algorithms/OS_ASD_POCS.m b/MATLAB/Algorithms/OS_ASD_POCS.m index c7d66158..a83a19f0 100644 --- a/MATLAB/Algorithms/OS_ASD_POCS.m +++ b/MATLAB/Algorithms/OS_ASD_POCS.m @@ -26,13 +26,13 @@ % 'TViter': Defines the amount of TV iterations performed per SART % iteration. Default is 20 % -% 'alpha': Defines the TV hyperparameter. default is 0.002 +% 'alpha': Defines the TV hyperparameter. Default is 0.002 % % 'alpha_red': Defines the reduction rate of the TV hyperparameter % -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 % 'maxL2err' Maximum L2 error to accept an image as valid. This % parameter is crucial for the algorithm, determines at % what point an image should not be updated further. diff --git a/MATLAB/Algorithms/OS_AwASD_POCS.m b/MATLAB/Algorithms/OS_AwASD_POCS.m index 79e953db..24b35908 100644 --- a/MATLAB/Algorithms/OS_AwASD_POCS.m +++ b/MATLAB/Algorithms/OS_AwASD_POCS.m @@ -25,13 +25,13 @@ % 'TViter': Defines the amount of TV iterations performed per SART % iteration. Default is 20 % -% 'alpha': Defines the TV hyperparameter. default is 0.002 +% 'alpha': Defines the TV hyperparameter. Default is 0.002 % % 'alpha_red': Defines the reduction rate of the TV hyperparameter % -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 % 'maxL2err' Maximum L2 error to accept an image as valid. This % parameter is crucial for the algorithm, determines at % what point an image should not be updated further. diff --git a/MATLAB/Algorithms/PICCS.m b/MATLAB/Algorithms/PICCS.m index 7b6e04f5..569f4aa7 100644 --- a/MATLAB/Algorithms/PICCS.m +++ b/MATLAB/Algorithms/PICCS.m @@ -23,13 +23,13 @@ % 'TViter': Defines the amount of TV iterations performed per SART % iteration. Default is 20 % -% 'alpha': Defines the TV hyperparameter. default is 0.002 +% 'alpha': Defines the TV hyperparameter. Default is 0.002 % % 'alpha_red': Defines the reduction rate of the TV hyperparameter % -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 % 'maxL2err' Maximum L2 error to accept an image as valid. This % parameter is crucial for the algorithm, determines at % what point an image should not be updated further. diff --git a/MATLAB/Algorithms/README.md b/MATLAB/Algorithms/README.md index f04274a4..32680f53 100644 --- a/MATLAB/Algorithms/README.md +++ b/MATLAB/Algorithms/README.md @@ -43,7 +43,7 @@ This assumes the noise and the data follows Poisson distribution, so mostly usef # Krylov Subspace algorithms -These are fast coverging iterative algorithms. The have some issues with regards of semiconvergence and loss of ortogonality, so in some cases they may not produce best results, +These are fast coverging iterative algorithms. The have some issues with regards of semiconvergence and loss of orthogonality, so in some cases they may not produce best results, but the main advantage is that few iterations should produce a good image. Non regularized: diff --git a/MATLAB/Algorithms/hybrid_LSQR.m b/MATLAB/Algorithms/hybrid_LSQR.m index 221bd3e9..77b2266f 100644 --- a/MATLAB/Algorithms/hybrid_LSQR.m +++ b/MATLAB/Algorithms/hybrid_LSQR.m @@ -179,7 +179,7 @@ aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); resL2(ii)=im3Dnorm(aux,'L2'); if ii>1 && resL2(ii)>resL2(ii-1) - disp(['Algorithm stoped in iteration ', num2str(ii),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(ii),' due to loss of orthogonality.']) return; end diff --git a/MATLAB/Algorithms/hybrid_fLSQR_TV.m b/MATLAB/Algorithms/hybrid_fLSQR_TV.m index 15d709b8..2597d060 100644 --- a/MATLAB/Algorithms/hybrid_fLSQR_TV.m +++ b/MATLAB/Algorithms/hybrid_fLSQR_TV.m @@ -217,7 +217,7 @@ aux=proj-Ax(x,geo,angles,'Siddon','gpuids',gpuids); errorL2(ii)=im3Dnorm(aux,'L2'); if ii>1 && resL2(ii)>resL2(ii-1) - disp(['Algorithm stoped in iteration ', num2str(ii),' due to loss of ortogonality.']) + disp(['Algorithm stoped in iteration ', num2str(ii),' due to loss of orthogonality.']) return; end if (ii==1 && verbose) diff --git a/MATLAB/Demos/d06_Algorithms01.m b/MATLAB/Demos/d06_Algorithms01.m index aafbf761..8ea2f464 100644 --- a/MATLAB/Demos/d06_Algorithms01.m +++ b/MATLAB/Demos/d06_Algorithms01.m @@ -46,12 +46,12 @@ % ANGLES : Propjection angles % And has a single optional argument: % FILTER: filter type applied to the projections. Possible options are -% 'ram-lal' (default) +% 'ram-lak' (default) % 'shepp-logan' % 'cosine' % 'hamming' % 'hann' -% The choice of filter will modify the noise and sopme discreatization +% The choice of filter will modify the noise and some discretization % errors, depending on which is chosen. % imgFDK1=FDK(noise_projections,geo,angles,'filter','hann'); @@ -62,5 +62,5 @@ plotImg([imgFDK1 imgFDK2],'Dim','Z'); % but it can be seen that one has bigger errors in the whole image, while -% hte other just in the boundaries +% the other just in the boundaries plotImg([abs(head-imgFDK1) abs(head-imgFDK2)],'Dim','Z'); diff --git a/MATLAB/Demos/d09_Algorithms04.m b/MATLAB/Demos/d09_Algorithms04.m index 9045c064..ea1eeacd 100644 --- a/MATLAB/Demos/d09_Algorithms04.m +++ b/MATLAB/Demos/d09_Algorithms04.m @@ -3,10 +3,10 @@ % % This demo presents the Total variation algorithms in TIGRE. Total % variation algorithms try to minimize the variation (gradient) of the -% image, assuming its piecewise smooth, as most things in nature are (i.e. +% image, assuming it's piecewise smooth, as most things in nature are (i.e. % human body). % -% This set of algorithms is specially good performing when the noise is +% This set of algorithms is especially well-performing when the noise is % very big or the number of projections is small, however, they require more % computational time and memory than the other algorithms to run. % @@ -69,7 +69,7 @@ % ASD-POCS has a variety of optional arguments, and some of them are crucial % to determine the behavior of the algorithm. The advantage of ASD-POCS is % the power to create good images from bad data, but it needs a lot of -% tunning. +% tuning. % % Optional parameters that are very relevant: % ---------------------------------------------- @@ -78,10 +78,10 @@ % what point an image should not be updated further. % Default is 20% of the FDK L2 norm. % -% its called epsilon in the paper +% it's called epsilon in the paper epsilon=im3Dnorm(Ax(FDK(noise_projections,geo,angles),geo,angles)-noise_projections,'L2')*0.15; -% 'alpha': Defines the TV hyperparameter. default is 0.002. -% However the paper mentions 0.2 as good choice +% 'alpha': Defines the TV hyperparameter. Default is 0.002. +% However the paper mentions 0.2 as a good choice alpha=0.002; % 'TViter': Defines the amount of TV iterations performed per SART @@ -104,9 +104,9 @@ % 'alpha_red': Defines the reduction rate of the TV hyperparameter alpha_red=0.95; -% 'Ratio': The maximum allowed image/TV update ration. If the TV +% 'Ratio': The maximum allowed image/TV update ratio. If the TV % update changes the image more than this, the parameter -% will be reduced.default is 0.95 +% will be reduced. Default is 0.95 ratio=0.94; % 'Verbose' 1 or 0. Default is 1. Gives information about the diff --git a/MATLAB/Demos/d11_PostProcessing.m b/MATLAB/Demos/d11_PostProcessing.m index 94bf03f5..ad2e13a1 100644 --- a/MATLAB/Demos/d11_PostProcessing.m +++ b/MATLAB/Demos/d11_PostProcessing.m @@ -31,7 +31,7 @@ head=headPhantom(geo.nVoxel); projections=Ax(head,geo,angles,'interpolated'); noise_projections=addCTnoise(projections); -%% Lets just use FDK +%% Let's just use FDK imgFDK=FDK(noise_projections,geo,angles); @@ -42,7 +42,7 @@ % % im3Ddenoise : Denoises a 3D image, using Total Variation denoising. % -% Argumetns are the hyperparameter and number of iterations (same as in +% Arguments are the hyperparameter and number of iterations (same as in % SART-TV) imgdenoised=im3DDenoise(imgFDK,'TV',100,15); @@ -55,7 +55,7 @@ %% plot results % denoised image is clearer plotImg([imgFDK imgdenoised imcroped],'Dim','Z') -% however, teh denoising has no knoledge of the original data (projections) +% however, the denoising has no knoledge of the original data (projections) % this it doesnt reduce the error. The error increases, specially in small % areas plotImg(abs([head-imgFDK head-imgdenoised head-imcroped]),'Dim','Z') diff --git a/MATLAB/Demos/d20_Algorithms05.m b/MATLAB/Demos/d20_Algorithms05.m index b9e3e835..d0b3a4e5 100644 --- a/MATLAB/Demos/d20_Algorithms05.m +++ b/MATLAB/Demos/d20_Algorithms05.m @@ -3,7 +3,7 @@ % % This demo presents the FISTA algorithm in TIGRE. using a total variation proximal. % Total variation algorithms try to minimize the variation (gradient) of the -% image, assuming its piecewise smooth, as most things in nature are (i.e. +% image, assuming it's piecewise smooth, as most things in nature are (i.e. % human body). FISTA attempts to perform this with much faster convergence % than standard gradient algorithms such as SIRT. % diff --git a/MATLAB/Utilities/cropCBCT.m b/MATLAB/Utilities/cropCBCT.m index 706918ac..afed820d 100644 --- a/MATLAB/Utilities/cropCBCT.m +++ b/MATLAB/Utilities/cropCBCT.m @@ -20,12 +20,12 @@ % Coded by: Ander Biguri %-------------------------------------------------------------------------- -% Tangent is equal, cropRadious: +% Tangent is equal, cropRadius: cropR=((geo.sDetector(1)/2+abs(geo.offDetector(1)))*geo.DSO)/geo.DSD; -%maximum distance from O +% maximum distance from O maxD=min(geo.nVoxel(1:2)-1)/2; -% Crop radious will be theminimum of them +% Crop radius will be the minimum of them cropR=min([cropR/geo.dVoxel(1) maxD]); [x,y]=meshgrid(1:size(img,1),1:size(img,2)); inM=(x-size(img,1)/2).^2+(y-size(img,2)/2).^2