📄 eml_check.m
字号:
function eml_check(yi, ci, ri, varargin)%function eml_check(yi, ci, ri [, 'os', nblock])% check the validity of emission data from Poisson transmission model% if 'os' option, then check that data is a 2d matrix, since only the% second index is subsetized. so for SPECT or 3D PET this means one must% reshape each projection view into a column, e.g., before calling OS recon do:% reshape(yi, [size(yi,1)*size(yi,2) size(yi,3)])% or just:% reshaper(yi, '2d') if nargin < 3, error(mfilename), endif iscell(yi)% if length(yi) ~= length(ci) for ii=1:length(yi) eml_check_data(yi{ii}, ci{ii}, ri{ii}); endreturnendeml_check_data(yi, ci, ri)is_fbp = 0;if nargin > 3 arg = varargin{1}; if streq(arg, 'fbp') is_fbp = 1; elseif streq(arg, 'os') if ndims(yi) ~= 2 error(['data must have 2 dimensions for OS. see ' mfilename]) end% if size(yi,2) ~= varargin{2}% end else error 'bug' endendif ndims(yi) > 2 & ~is_fbp error 'most routines need column yi(:), except OS routines need "2D" yi, using "reshaper()"'end%% eml_check_data(yi, ci, ri)%function eml_check_data(yi, ci, ri)if any(size(ci) > 1) if ~isequal(size(yi), size(ci)), error 'yi vs ci size', endendif any(size(ri) > 1) if ~isequal(size(yi), size(ri)), error 'yi vs ri size', endendif any(ci(:) < 0), error 'ci''s must be nonnegative', endif any(yi(:) < 0), error 'yi''s must be nonnegative', endif any(ri(:) < 0), error 'ri''s must be nonnegative', endif any(yi(:) & ~(ci(:) + ri(:))), error 'model mismatch', end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -