plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | alcu/sms-master | mri_r2_fit_costgrad_r2.m | .m | sms-master/irt/mri/mri_r2_fit_costgrad_r2.m | 1,634 | utf_8 | eaf558521318bb8e70d438bda9d1965b | function [cost grad] = mri_r2_fit_costgrad_r2(r2, data)
%|function [cost grad] = mri_r2_fit_costgrad_r2(r2, data)
%| for R2=1/T2 estimation from images
if nargin == 1 && streq(r2, 'test'), mri_r2_fit_costgrad_r2_test, return, end
if nargin < 2, help(mfilename), error(mfilename), end
yi = data.yi; % [(nd) nt] images... |
github | alcu/sms-master | mri_sensemap_denoise.m | .m | sms-master/irt/mri/mri_sensemap_denoise.m | 5,857 | utf_8 | 8679f30998a7c42e61bb9ff3a9d58c4e | function [smap, sinit, cost] = mri_sensemap_denoise(ykj, varargin)
%function [smap, sinit, cost] = mri_sensemap_denoise(ykj, [options])
%|
%| Regularized estimation of (smooth) sensitivity maps for parallel MRI.
%| Signal model: y_kj = s_kj f_j + noise_kj
%| s_kj sensitivity map (relative to "bodycoil" reference image... |
github | alcu/sms-master | mri_phase_denoise.m | .m | sms-master/irt/mri/mri_phase_denoise.m | 5,884 | utf_8 | 3cb908f8168e9c611b10511ae0ba4ba2 | function [x, mask0] = mri_phase_denoise(yi, varargin)
%|function [x, mask0] = mri_phase_denoise(yi, [options]) <- recommended usage
%|function [x] = mri_phase_denoise(yi, l2b, niter, chat, wthresh) <- old way
%|
%| in
%| yi [(N)] noisy complex image: y = mag .* exp(1i * x)
%| can be any size: 1D, 2D, 3D, ...
%|
%| ... |
github | alcu/sms-master | mri_r2_fit_costgrad_pd.m | .m | sms-master/irt/mri/mri_r2_fit_costgrad_pd.m | 1,647 | utf_8 | 427edfe6e78954f98a05ea7c2c925be4 | function [cost grad] = mri_r2_fit_costgrad_pd(pd, data)
%|function [cost grad] = mri_r2_fit_costgrad_pd(pd, data)
%| gradient wrt "proton density" (pd) image
%| for R2=1/T2 estimation from images
if nargin == 1 && streq(pd, 'test'), mri_r2_fit_costgrad_pd_test, return, end
if nargin < 2, help(mfilename), error(mfile... |
github | alcu/sms-master | mri_field_map_sim.m | .m | sms-master/irt/mri/mri_field_map_sim.m | 4,105 | utf_8 | afc4e6fcb85f9fd047984b0782010bce | function [f0, Bz] = mri_field_map_sim(x, z, varargin)
%|function [f0, Bz] = mri_field_map_sim(x, z, varargin)
%|
%| Analytically simulate the magnetic field variation caused simple
%| geometric shapes of various susceptibilties in a uniform magnetic field.
%|
%| Currently there are two geometries impemented:
%| 1) a ... |
github | alcu/sms-master | mri_objects_2d.m | .m | sms-master/irt/mri/arch/mri_objects_2d.m | 3,299 | utf_8 | f60fd76c1a10dd35402375348e3ba155 | function [xf, yf] = mri_objects_2d(varargin)
%function [xf, yf] = mri_objects_2d('type1', params1, 'type', params2, ...)
% Generate inline functions for describing image-domain objects
% and Fourier domain spectra of simple structures such as rectangles.
% These functions are useful for simple "idealized" MRI simulati... |
github | alcu/sms-master | mri_field_map_reg_2d.m | .m | sms-master/irt/mri/arch/mri_field_map_reg_2d.m | 5,894 | utf_8 | e5c6b8fcf085788521e0e6bc63423f9e | function [wmap, wconv] = mri_field_map_reg_2d(yi, etime, varargin)
%function [wmap, wconv] = mri_field_map_reg_2d(yik, etime, varargin)
%
% MRI field map estimation using regularization and optimization transfer,
% based on a multiple image model:
% y_ik = mag_i * phase_ik * decay_ik + noise_ik
% phase_ik = exp(1i * w... |
github | alcu/sms-master | mri_objects_3d.m | .m | sms-master/irt/mri/arch/mri_objects_3d.m | 5,821 | utf_8 | 532585a014bec2ea7294dc27494d0a4f | function [xf, yf] = mri_objects_3d(varargin)
%function [xf, yf] = mri_objects_3d('type1', params1, 'type', params2, ...)
% Generate inline functions for describing image-domain objects
% and Fourier domain spectra of simple structures such as rectangles.
% These functions are useful for simple "idealized" MRI simulati... |
github | alcu/sms-master | Gnufft.m | .m | sms-master/irt/systems/Gnufft.m | 3,377 | utf_8 | b6532c27aea539f439c483c09da563e1 | function ob = Gnufft(varargin)
%|function ob = Gnufft([mask,] args)
%| Construct Gnufft object, which computes nonunform samples of the FT
%| of signals with dimensions [(Nd)] approximately via the NUFFT.
%| For exact (but slow) computation, use Gdsft instead.
%|
%| The arguments (args) are simply a cell array of the... |
github | alcu/sms-master | Gnufft_gram.m | .m | sms-master/irt/systems/Gnufft_gram.m | 12,248 | utf_8 | cbaad624222c98466a7b4e8d065e098e | function [T, reuse] = Gnufft_gram(ob, W, reuse)
%|function [T, reuse] = Gnufft_gram(A, W, reuse)
%|
%| construct Toeplitz gram matrix object T = A'WA for a Gnufft object
%| in
%| A [M np] Gnufft object (Fatrix or fatrix2)
%| W [M M] W = diag_sp(wi) (often simply "1" or [])
%| W = Gdiag() for fatrix2
%| reuse str... |
github | alcu/sms-master | Gtranslate.m | .m | sms-master/irt/systems/Gtranslate.m | 9,627 | utf_8 | 45ff1a0c59e5f04ad995cc11ff9eda4e | function ob = Gtranslate(mask, varargin)
%|function ob = Gtranslate(mask, options)
%|
%| Construct Gtranslate object for image registration.
%| (Internally stores image-sized arrays so not very memory efficient.)
%|
%| See Gtranslate_test() below for example usage.
%|
%| in
%| mask size(image) logical array of object... |
github | alcu/sms-master | Gtomosyn.m | .m | sms-master/irt/systems/Gtomosyn.m | 2,264 | utf_8 | 82a244da0013dd829bb7ac0ff89bf20c | function ob = Gtomosyn(cg, ig, varargin)
%|function ob = Gtomosyn(cg, ig, [options])
%|
%| Construct Fatrix object for forward and back-projection with
%| a 3D tomosynthesis geometry having a flat detector and source moving in arc.
%| Currently is simply a "stack" of Gcone objects - not efficient for multicore.
%|
%|... |
github | alcu/sms-master | block_fatrix.m | .m | sms-master/irt/systems/block_fatrix.m | 10,602 | utf_8 | d35bfc1800ef6309f697bdf2b196964d | function ob = block_fatrix(blocks, varargin)
%|function ob = block_fatrix(blocks, options)
%|
%| Construct block_fatrix object, a meta-Fatrix composed of Fatrix blocks,
%| such as block_diag(A_1, A_2, ..., A_M)
%| See block_fatrix_test.m for example usage.
%|
%| in
%| blocks {cell} cell array of the blocks
%|
%| opti... |
github | alcu/sms-master | Gmatrix.m | .m | sms-master/irt/systems/Gmatrix.m | 4,371 | utf_8 | af3ae3f610595ed1374bc2e461fa0dd5 | function ob = Gmatrix(matrix, varargin)
%|function ob = Gmatrix(matrix, [options])
%|
%| Construct fatrix2 object from an object (such as a matrix) that can do
%| multiplication and transpose. The point of this would be to endow
%| the matrix with the masking features provided by fatrix2.
%|
%| in
%| matrix [M N] c... |
github | alcu/sms-master | wtf_write.m | .m | sms-master/irt/systems/wtf_write.m | 1,507 | utf_8 | 0b4d5047bf518e6a92fbb5f812c9e824 | function wtf_write(file, mat, nx, ny, nb, na, varargin)
%|function wtf_write(file, mat, nx, ny, nb, na, [options])
%| write (usually sparse) matrix mat to file (usually file.wtf)
%| mat can be Gsparse Fatrix or Gmatrix fatrix2 also.
%| option
%| 'row_grouped' 1|0 1 to write in row grouping (default: 0 col)
%| 'chat'
... |
github | alcu/sms-master | aspire_buff2mat.m | .m | sms-master/irt/systems/aspire_buff2mat.m | 1,861 | utf_8 | 4fe1e5b6f97f270438abdb10996180ab | function [mat sp] = aspire_buff2mat(buff)
%|function [mat sp] = aspire_buff2mat(buff)
%|
%| convert 'buffer' read from .wtf to matlab sparse matrix
%| primarily for testing
%|
%| in
%| buff byte read using wtfmex()
%|
%| out
%| mat sparse matlab sparse matrix, full sized
%| sp struct header information etc.
%|
%| Cop... |
github | alcu/sms-master | Gsparse.m | .m | sms-master/irt/systems/Gsparse.m | 9,512 | utf_8 | e9905ce5cbba041d9959641e85672f40 | function ob = Gsparse(arg1, varargin)
%function ob = Gsparse(file.wtf | sparse | cell, options)
%|
%| Construct Gsparse object, either from a sparse matrix itself,
%| or from the arguments that would be passed to matlab's sparse() command,
%| or from an Aspire binary .wtf file.
%|
%| The Gsparse object overcomes some ... |
github | alcu/sms-master | Glinear.m | .m | sms-master/irt/systems/Glinear.m | 3,313 | utf_8 | e98b20c9883999e090aabca5524dd85a | function A = Glinear(varargin)
%|function A = Glinear(options)
%|
%| Generate a geometric system matrix for tomographic projection
%| based on simple linear interpolation.
%| Contains exactly two a_ij values per pixel per projection angle.
%| This system model is very inadequate for reconstructing
%| real tomographic... |
github | alcu/sms-master | Gcone.m | .m | sms-master/irt/systems/Gcone.m | 15,912 | utf_8 | d16f43db33abb9051021e5af9179c094 | function ob = Gcone(cg, ig, varargin)
%|function ob = Gcone(cg, ig, [options])
%|
%| Construct Gcone object, for 3D axial cone-beam or helical cone-beam
%| forward and back-projection. Works with flat detectors or 3rd-gen CT arcs.
%| Also supports 3D parallel-beam geometry, but no polar angle.
%|
%| in
%| cg ct_geom... |
github | alcu/sms-master | Gtomo2_dscmex.m | .m | sms-master/irt/systems/Gtomo2_dscmex.m | 4,362 | utf_8 | dbdb05d948b70e0410f5578afb6344ca | function ob = Gtomo2_dscmex(arg1, varargin)
%|function ob = Gtomo2_dscmex(sg, ig, options)
%|function ob = Gtomo2_dscmex(file, options)
%|function ob = Gtomo2_dscmex(arg_pairs, options)
%|
%| Tomographic system model based on aspire's wtfmex() routine, using its
%| dsc,proj and dsc,back commands for on-the-fly forwar... |
github | alcu/sms-master | Gtomo3.m | .m | sms-master/irt/systems/Gtomo3.m | 7,333 | utf_8 | 930bdaf944659c88c07897968b5a9959 | function ob = Gtomo3(sys_type, mask, nx, ny, nz, varargin)
%|function ob = Gtomo3(sys_type, mask, nx, ny, nz, options)
%|
%| alternate usage for CT (however, Gcone() is recommended instead):
%|function ob = Gtomo3(cg, ig, options)
%|
%| Construct Gtomo3 object, for 3D tomographic image reconstruction.
%| This object ... |
github | alcu/sms-master | Gmri_gram.m | .m | sms-master/irt/systems/Gmri_gram.m | 3,607 | utf_8 | b805e893a769c46a533974b9878f35b1 | function [T, reuse] = Gmri_gram(ob, W, reuse)
%|function [T, reuse] = Gmri_gram(ob, W, reuse)
%|
%| build Toeplitz-like gram-matrix object for G'WG gram matrix
%| to be called by build_gram() indirectly rather than directly by user!
%|
%| Jeff Fessler
if nargin < 1, help(mfilename), error(mfilename), end
if streq(ob... |
github | alcu/sms-master | Gmri.m | .m | sms-master/irt/systems/Gmri.m | 14,807 | utf_8 | 6bde9049ee7790ca2f8b8b68b0fb8392 | function ob = Gmri(kspace, mask, varargin)
%|function ob = Gmri(kspace, mask, 'option name', option, ...)
%|
%| Construct Gmri object for MR image reconstruction, or for other problems
%| that require reconstruction of a function from nonuniform Fourier samples.
%| This object can also model relaxation and/or off-res... |
github | alcu/sms-master | wtf_read.m | .m | sms-master/irt/systems/wtf_read.m | 4,340 | utf_8 | 7c4164512424736a63513562c5774d31 | function [mat nx ny nb na] = wtf_read(file, varargin)
%|function [mat nx ny nb na] = wtf_read(file, [options])
%| read aspire sparse matrix file (usually file.wtf)
%| and return matlab sparse matrix
%| option
%| 'parse' 0|1 if 1, do it by old matlab parsing way (old wtfread.m)
%| Copyright 2008-9-26, Jeff Fessler, Un... |
github | alcu/sms-master | square_strip_int.m | .m | sms-master/irt/systems/square_strip_int.m | 2,602 | utf_8 | 6d1ebe594ba42267e4ebdbb082549231 | function proj = square_strip_int(rr, angles, varargin)
%|function proj = square_strip_int(rr, angles, varargin)
%|
%| strip-integrals of a square pixel basis object model,
%| normalized such that the units are length, not area.
%| In other words, the detector response is h(r) = (1/w) rect(r/w).
%| in
%| rr [] radial ... |
github | alcu/sms-master | Gdsft_gram.m | .m | sms-master/irt/systems/Gdsft_gram.m | 8,894 | utf_8 | ed0be07fc9be7bfcab9820882d81bad8 | function [T, reuse] = Gdsft_gram(ob, W, reuse)
%|function [T, reuse] = Gdsft_gram(A, W, reuse)
%|
%| Construct Toeplitz gram matrix object T = A'WA for a Gdsft object.
%| This object performs T*x rapidly using an over-sampled FFT.
%|
%| in
%| A [M np] Gdsft object (fatrix2)
%| W [M M] W = Gdiag() for fatrix2 (often... |
github | alcu/sms-master | Gtomo2_wtmex.m | .m | sms-master/irt/systems/Gtomo2_wtmex.m | 6,195 | utf_8 | 02065c08c3a0e98181b26bdb1698a722 | function ob = Gtomo2_wtmex(arg1, varargin)
%|function ob = Gtomo2_wtmex(sg, ig, options)
%|function ob = Gtomo2_wtmex(file, options)
%|function ob = Gtomo2_wtmex(arg_pairs, options)
%|
%| Generate a 2D tomographic system model based on aspire's wtfmex() routine.
%|
%| in
%| sg strum sino_geom()
%| ig strum image_ge... |
github | alcu/sms-master | Gtomo_nufft.m | .m | sms-master/irt/systems/Gtomo_nufft.m | 20,262 | utf_8 | be955d76d2b2cf2317f771179a219050 | function ob = Gtomo_nufft(mask, dim_data, varargin)
%|function ob = Gtomo_nufft(mask, dim_data, options)
%|
%| Construct Gtomo_nufft object, for Fourier-based forward and backprojection.
%| Currently handles 2D parallel and fan-beam cases.
%|
%| See Gtomo_nufft_test.m for example usage.
%|
%| Basically, you create an... |
github | alcu/sms-master | aspire_pair.m | .m | sms-master/irt/systems/aspire_pair.m | 7,283 | utf_8 | e0a649896bfbc193a7f019a2020d861f | function args = aspire_pair(sg, ig, varargin)
%|function args = aspire_pair(sg, ig, [options])
%| see ASPIRE users guide under tech. reports on web page for details
%|
%| options
%| 'scale' default: 0 - transmission scaling
%| 'strip_width' default: from sg.strip_width
%| or, if empty, then 0 (line integrals)
%| '... |
github | alcu/sms-master | fatrix_one.m | .m | sms-master/irt/systems/fatrix_one.m | 2,519 | utf_8 | c8b7be74ce283eb9e1f2a90245f67c79 | function ob = fatrix_one(dim, fun, arg, varargin)
%|function ob = fatrix_one(dim, fun, arg, varargin)
%|
%| Construct Fatrix object where one column of it is computed at a time by 'fun'
%|
%| in
%| dim [1 2] Fatrix dimension
%| fun @ fun(arg, n) must return nth column of matrix
%| arg struct argument for fun
%|
%| op... |
github | alcu/sms-master | Gpermute.m | .m | sms-master/irt/systems/Gpermute.m | 1,705 | utf_8 | 72e497cd2ffd98f481705cbd665f11b5 | function ob = Gpermute(Nd, varargin)
%|function ob = Gpermute(Nd, varargin)
%| Construct Gpermute object, which permutes input image dimensions.
%| This is useful perhaps for converting xyz to zyx order, for example.
%| See Gpermute_test() for example usage.
%|
%| in
%| Nd [1 D] input signal dimensions
%|
%| options... |
github | alcu/sms-master | embed_mult.m | .m | sms-master/irt/systems/embed_mult.m | 4,396 | utf_8 | fbfa02d6a7b0c8c7085319a70a960040 | function y = embed_mult(fun, arg, is_transpose, x, istart, nblock, ...
mask, np, odim, is_array, varargin)
%|function y = embed_mult(fun, arg, is_transpose, x, istart, nblock, ...
%| mask, np, odim, is_array, varargin)
%|
%| The matrix-vector versions of the linear forward models used herein
%| expect an input x of ... |
github | alcu/sms-master | Gtomo_blob.m | .m | sms-master/irt/systems/Gtomo_blob.m | 12,216 | utf_8 | e2a583d692d0c5bf740db9c956ec9ee8 | function ob = Gtomo_blob(mask, dim_data, varargin)
%function ob = Gtomo_blob(mask, dim_data, options)
%|
%| Construct Gtomo_blob object, for fast forward and backprojection.
%| INCOMPLETE, WORK-IN-PROGRESS!
%|
%| Currently handles 2D parallel and fan-beam cases.
%|
%| See Gtomo_blob_test.m for example usage.
%|
%| in
... |
github | alcu/sms-master | embed_out.m | .m | sms-master/irt/systems/embed_out.m | 2,523 | utf_8 | d08a24d35ed104726653ce3218d22371 | function [y, eo_fun] = embed_out(y, Mdim)
%|function [y, eo_fun] = embed_out(y, Mdim)
%|
%| Dual or adjoint of embed_in(). See embed_in() for details.
%| To be used around _back() routines that expect [(M) *L]
%| input and produce [(N) *L] output that then must be reshaped
%| to be either [(N) (L)] or [np *L]
%|
%| ... |
github | alcu/sms-master | Gblur.m | .m | sms-master/irt/systems/Gblur.m | 6,697 | utf_8 | 4558dff07bb938cb55c60515d91ca287 | function ob = Gblur(mask, varargin)
%|function ob = Gblur(mask, options)
%|
%| Construct Gblur object for image restoration.
%|
%| See Gblur_test.m for example usage.
%|
%| in
%| mask size(image) logical array of object support.
%|
%| options
%| 'chat' verbose printing of debug messages
%| 'psf' point spread functi... |
github | alcu/sms-master | Gdelaysum1.m | .m | sms-master/irt/systems/Gdelaysum1.m | 3,339 | utf_8 | da89afb3a56438ddc3309112fa0370cf | function ob = Gdelaysum(varargin)
%|function ob = Gdelaysum([options])
%|
%| Construct Gdelaysum object, which performs weighted sums of a delayed signal.
%| This is useful for model-based reconstruction of THz images.
%| See Gdelaysum_test() at end for example usage.
%|
%| y[n;m] = sum_{k=0}^{Nx-1} x[k] h[n - d[k;m]... |
github | alcu/sms-master | aspire_buff_parse.m | .m | sms-master/irt/systems/aspire_buff_parse.m | 2,192 | utf_8 | b0054843b54f772d94e7e1be66d0ebf8 | function sp = aspire_buff_parse(buff)
%|function sp = aspire_buff_parse(buff)
%|
%| parse 'buffer' read from aspire .wtf
%| primarily for testing
%|
%| in
%| buff byte read using wtfmex()
%|
%| out
%| sp struct header information etc.
%|
%| Copyright 2011-3-4, Jeff Fessler, University of Michigan
if nargin < 1, help... |
github | alcu/sms-master | Gdft.m | .m | sms-master/irt/systems/Gdft.m | 6,277 | utf_8 | d397e81839e58b955b5182632ae215b6 | function ob = Gdft(varargin)
%|function ob = Gdft([args])
%| Construct Gdft object that computes samples of the DFT of a signal
%| with dimensions [(N)]. This is useful for "under-sampled" MRI.
%|
%| options (at least one of first two must be provided):
%| 'mask' logical [(N)] image-domain mask, usually: true(nx,ny)... |
github | alcu/sms-master | embed_in.m | .m | sms-master/irt/systems/embed_in.m | 3,271 | utf_8 | 860d4dd7df99c91d0529a57f7c0bd5d2 | function [x, ei_fun] = embed_in(x, mask, np)
%|function [x, ei_fun] = embed_in(x, mask, np)
%|
%| The matrix-vector versions of the linear forward models used herein
%| expect an input x of size [np *L] and produce an output y of size [nd *L],
%| where np = sum(mask(:)) is the number of estimated pixel values,
%| and... |
github | alcu/sms-master | Gdown.m | .m | sms-master/irt/systems/Gdown.m | 2,668 | utf_8 | 8eb9c0ab6830aee7f0e0746371a13e81 | function ob = Gdown(Nd, varargin)
%|function ob = Gdown(Nd, varargin)
%| Construct Gdown object, which performs downsampling.
%| This is useful perhaps for iterative zooming methods.
%| See Gdown_test.m for example usage.
%|
%| in
%| Nd [1 D] input signal dimensions
%|
%| options
%| mask logical default: true(Nd)
... |
github | alcu/sms-master | Gdiag.m | .m | sms-master/irt/systems/Gdiag.m | 3,516 | utf_8 | 7d29376b092fbb2a541f8718111cdd5c | function ob = Gdiag(diag, varargin)
%|function ob = Gdiag(diag, [options])
%|
%| Construct diagonal "sparse" object, that does D * x = diag(d) * x via d .* x.
%|
%| in
%| diag [] numeric array
%|
%| option
%| 'mask' logical with sum(mask(:)) = numel(diag)
%| 'class' 'fatrix2' (default) or 'Fatrix' (obsolete)
%|
%| o... |
github | alcu/sms-master | diag_sp.m | .m | sms-master/irt/systems/diag_sp.m | 2,250 | utf_8 | 386ccbd0a7ec273d2b47c731d673414c | function ob = diag_sp(diag, varargin)
%|function ob = diag_sp(diag)
%| Construct diagonal "sparse" object, that does D * x = diag(d) * x via d .* x.
%|
%| Copyright 2005-4-6, Jeff Fessler, University of Michigan
if nargin == 1 && streq(diag, 'test'), diag_sp_test, return, end
if nargin < 1, help(mfilename), error(mf... |
github | alcu/sms-master | Gtomo2_strip.m | .m | sms-master/irt/systems/Gtomo2_strip.m | 8,461 | utf_8 | bf3cf84d9452f2c7c1147a0ccdde8f3f | function A = Gtomo2_strip(sg, ig, varargin)
%|function A = Gtomo2_strip(sg, ig, options)
%|
%| Generate a 2D system matrix for tomographic image reconstruction,
%| based on a square pixel basis and strip-integral detector model,
%| i.e., a rectangular detector response.
%| Works for parallel-beam, arc-fan, and flat-f... |
github | alcu/sms-master | block_op.m | .m | sms-master/irt/systems/block_op.m | 2,664 | utf_8 | 2d66161e64eb64a8550b91eea79be709 | function out = block_op(Ab, varargin)
%|function out = block_op(Ab, varargin)
%|
%| Various operations on "block" objects and block data.
%|
%| There are (at least) three types of block objects possible in this toolbox.
%| 1. Cell arrays of matrices (or of some other matrix-like object).
%| 2. A Fatrix object with bl... |
github | alcu/sms-master | Gtomo2_table.m | .m | sms-master/irt/systems/Gtomo2_table.m | 10,315 | utf_8 | e6b227f2a3ced5536ba684b73389d6b3 | function ob = Gtomo2_table(sg, ig, table, varargin)
%|function ob = Gtomo2_table(sg, ig, table, options)
%|
%| Generate a 2D parallel-beam tomographic system model
%| based on finely tabulated footprints.
%|
%| in
%| sg strum sino_geom()
%| ig strum image_geom()
%| table [Ktab Ltab] footprint table, see book: s,geo... |
github | alcu/sms-master | Gdsft.m | .m | sms-master/irt/systems/Gdsft.m | 3,909 | utf_8 | 45dd574cecc62d825fe1abf6fe49613b | function ob = Gdsft(om, Nd, varargin)
%|function ob = Gdsft(om, Nd, varargin)
%| Construct Gdsft object, which computes (nonuniform) FT samples
%| of signals with dimensions [(Nd)] exactly, e.g., for testing Gnufft
%| For faster computation, use Gnufft instead.
%| See Gdsft_test.m for example usage.
%|
%| in
%| om [M... |
github | alcu/sms-master | dsft_gram_hermitify.m | .m | sms-master/irt/systems/private/dsft_gram_hermitify.m | 3,089 | utf_8 | db95f5b9a36ec16ca02cbff96f50f1f9 | function kern = dsft_gram_hermitify(kern, show)
%|function kern = dsft_gram_hermitify(kern, show)
%|
%| When A is a Gdsft object and W is a Hermitian positive semidefinite matrix,
%| e.g., when W is diagonal with real, nonnegative diagonal elements,
%| the corresponding gram matrix A'WA is positive semidefinite and T... |
github | alcu/sms-master | Fatrix_test_basic.m | .m | sms-master/irt/systems/tests/Fatrix_test_basic.m | 4,409 | utf_8 | 6f595a7177b650af6f89d8a9a96e9968 | function Fatrix_test_basic(A, mask, varargin)
%|function Fatrix_test_basic(A, mask, [option])
%|
%| perform basic tests of Fatrix objects
%| in
%| A [nd *N] Fatrix object
%| mask [(N)] logical support
%| option
%| 'x' [(N)] optional input test image
%| 'multi' 0|1 if 1, test multiple rhs: A * [x x]. default: 1
%|... |
github | alcu/sms-master | fatrix2_tests.m | .m | sms-master/irt/systems/tests/fatrix2_tests.m | 9,936 | utf_8 | ef795542d118c11e75578c69920d1801 | function fatrix2_tests(A, varargin)
%|function fatrix2_tests(A, [option])
%|
%| perform basic tests of fatrix2 objects
%| in
%| A [nd np] fatrix2 object
%|
%| option
%| 'x' [idim] optional input test image
%| 'name' char name of input object (optional for display)
%| 'caller' char name of caller (optional for dis... |
github | alcu/sms-master | tester_tomo2.m | .m | sms-master/irt/systems/tests/tester_tomo2.m | 4,306 | utf_8 | da952893b8645c02f73c2c5213d79081 | function tester_tomo2(A1, mask, varargin)
%|function tester_tomo2(A1, mask, [options])
%| Test suite for a Fatrix-type 2D or 3D system object, including Gblock tests.
%|
%| in
%| A1 Fatrix or fatrix2
%| mask logical [nx ny] or [nx ny nz]
%|
%| option
%| 'A2' Fatrix optional 2nd object for testing and comparisons
%| ... |
github | alcu/sms-master | test_adjoint.m | .m | sms-master/irt/systems/tests/test_adjoint.m | 3,514 | utf_8 | 183814b9fe030437df198f09572bd716 | function [Af, Aa, dif] = test_adjoint(A, varargin)
%|function [Af, Aa, dif] = test_adjoint(A, varargin)
%|
%| test that the adjoint of a 'matrix object' A really is its transpose
%|
%| in
%| A Fatrix or fatrix2 typically
%|
%| option
%| 'tolre' dbl tolerance (relative) for equality (default: 0)
%| 'big' 0|1 for big ... |
github | alcu/sms-master | mtimes_block.m | .m | sms-master/irt/systems/@Fatrix/mtimes_block.m | 1,278 | utf_8 | 47f1cd3a254db55d68e9967fa143e37a | function y = mtimes_block(ob, x, istart, nblock)
%function y = mtimes_block(ob, x, istart, nblock)
% y = G(i'th block) * x or y = G'(i'th block) * x
% in either case the projection data will be "small"
% istart is 1,...,nblock
% support 'exists' option for seeing if this routine is available
if nargin == 2 && ischar(... |
github | alcu/sms-master | mtimes.m | .m | sms-master/irt/systems/@Fatrix/mtimes.m | 1,385 | utf_8 | e22a6887c1aab734b08a743df51390b1 | function y = mtimes(ob, x)
%function y = mtimes(ob, x)
% y = M * x or x = M' * y
if isa(x, 'Fatrix') % {object1 | scalar} * object2, tested in Gcascade
y = Gcascade(ob, x);
return
end
if ~isa(ob, 'Fatrix')
error 'only multiplication on right is done'
end
%
% partial multiplication?
%
if ob.is_subref
error 'subre... |
github | alcu/sms-master | Gcascade.m | .m | sms-master/irt/systems/@Fatrix/private/Gcascade.m | 2,940 | utf_8 | af8817195f7e46a7897572535ac18f8d | function ob = Gcascade(arg1, arg2, varargin)
%|function ob = Gcascade(A1, A2, options)
%|
%| Construct Gcascade object, which is the cascade of two objects: A = A1 * A2.
%|
%| See Gcascade_test.m for example usage.
%|
%| in
%| arg1 matrix | Fatrix object that can do "mtimes" and "size"
%| arg2 matrix | Fatrix ''
%|... |
github | alcu/sms-master | do_cascade.m | .m | sms-master/irt/systems/@Fatrix/private/do_cascade.m | 873 | utf_8 | 0e60b58458bda59a69d48ea9fa7934b4 | function y = do_cascade(cascade, x, is_transpose, istart, nblock, is_before)
%function y = do_cascade(cascade, x, is_transpose, istart, nblock, is_before)
% do cascade * x or cascade' * x
if isempty(cascade)
y = x;
elseif isa(cascade, 'function_handle') || isa(cascade, 'inline')
if nargin(cascade) == 4
y = feval... |
github | alcu/sms-master | nufft_gram_v2.m | .m | sms-master/irt/systems/arch/nufft_gram_v2.m | 7,048 | utf_8 | 2f31f3ed929c1a7642ddd22958c3b4c6 | function [T, reuse] = nufft_gram(ob, W, reuse)
%function [T, reuse] = nufft_gram(ob, W, reuse)
% construct Toeplitz matrix object T = G'WG for a Gnufft object
% in
% ob Fatrix a [M,np] Gnufft object
% W [M,M] W = diag_sp(wi) (often simply "1" or [])
% reuse struct stuff from the last call that can be reused
% out
%... |
github | alcu/sms-master | nufft_gram.m | .m | sms-master/irt/systems/arch/nufft_gram.m | 6,986 | utf_8 | ed586ae6715c4f071fd923bc7d5ea53b | function [T, reuse] = nufft_gram(ob, W, reuse)
%function [T, reuse] = nufft_gram(ob, W, reuse)
% construct Toeplitz matrix object T = G'WG for a Gnufft object
% in
% ob Fatrix a [M,np] Gnufft object
% W [M,M] W = diag_sp(wi) (often simply "1" or [])
% reuse struct stuff from the last call that can be reused
% out
%... |
github | alcu/sms-master | Gnufft_gram.m | .m | sms-master/irt/systems/arch/Gnufft_gram.m | 14,618 | utf_8 | d6c1a27f6d0917fb5aa5d085cd6df8ff | function [T, reuse] = Gnufft_gram(ob, W, reuse)
%|function [T, reuse] = Gnufft_gram(A, W, reuse)
%|
%| construct Toeplitz gram matrix object T = A'WA for a Gnufft object
%| in
%| A [M np] Gnufft object (Fatrix or fatrix2)
%| W [M M] W = diag_sp(wi) (often simply "1" or [])
%| W = Gdiag() for fatrix2
%| reuse str... |
github | alcu/sms-master | Gtomo_sparse.m | .m | sms-master/irt/systems/arch/Gtomo_sparse.m | 3,324 | utf_8 | a8bfb72d38b972d3af3f4394b8528a1d | function ob = Gtomo_sparse(arg1, arg2, varargin)
%function ob = Gtomo_sparse(file(or matrix), mask, options)
%
% Construct Gtomo_sparse object, either from a .wtf file,
% or from a Matlab sparse matrix.
% This just uses an ordinary Matlab sparse matrix for the core!
% See Gtomo_sparse_test.m for example usage.
% You c... |
github | alcu/sms-master | Gsparse.m | .m | sms-master/irt/systems/arch/Gsparse.m | 8,332 | utf_8 | faa2f08140223c42b74e008cd5b35e36 | function ob = Gsparse(arg1, varargin)
%function ob = Gsparse(file.wtf | sparse | cell, options)
%|
%| Construct Gsparse object, either from a sparse matrix itself,
%| or from the arguments that would be passed to matlab's sparse() command,
%| or from an Aspire binary .wtf file.
%|
%| The Gsparse object overcomes some ... |
github | alcu/sms-master | Gtomo_nufft_newsample.m | .m | sms-master/irt/systems/arch/Gtomo_nufft_newsample.m | 15,975 | utf_8 | a322d3aae2ca18b4935091b731839a30 | function ob = Gtomo_nufft_newsample(mask, dim_data, varargin)
%function ob = Gtomo_nufft_newsample(mask, dim_data, options)
%
% Construct Gtomo_nufft object, for Fourier-based forward and backprojection.
% Currently handles 2D parallel and fan-beam cases.
%
% See Gtomo_nufft_test.m for example usage.
%
% Basically, yo... |
github | alcu/sms-master | Gtomo2_wtmex.m | .m | sms-master/irt/systems/arch/Gtomo2_wtmex.m | 5,112 | utf_8 | 95c9dabb4010efbd5dc95c8d2d82a91c | function ob = Gtomo2_wtmex(arg1, varargin)
%function ob = Gtomo2_wtmex(sg, ig, options)
%function ob = Gtomo2_wtmex(file, options)
%function ob = Gtomo2_wtmex(arg_pairs, options)
%
% Generate a tomographic system model based on aspire's wtfmex() routine.
%
% in
% sg strum sino_geom()
% ig strum image_geom()
%
% opti... |
github | alcu/sms-master | Gtomo_nufft.m | .m | sms-master/irt/systems/arch/Gtomo_nufft.m | 16,929 | utf_8 | 4bc9843005a25188c1fe962922025bf1 | function ob = Gtomo_nufft(mask, dim_data, varargin)
%function ob = Gtomo_nufft(mask, dim_data, options)
%
% Construct Gtomo_nufft object, for Fourier-based forward and backprojection.
% Currently handles 2D parallel and fan-beam cases.
%
% See Gtomo_nufft_test.m for example usage.
%
% Basically, you create an object c... |
github | alcu/sms-master | fatrix_plus.m | .m | sms-master/irt/systems/arch/fatrix_plus.m | 1,433 | utf_8 | 0ed7e4e5bcb48ae6f019ace7b9ab0e99 | function ob = fatrix_plus(varargin)
%function ob = fatrix_plus(fatrix_objects)
%
% Construct Fatrix object consisting of sum of Fatrix objects, i.e.,
% T1 + T2 + ... + Tn
%
% in
% fatrix_objects one or more fatrix objects
%
% out
% ob T1 + ... + Tn
%
% Copyright 2007-10-16, Jeff Fessler, The University of Michigan
i... |
github | alcu/sms-master | Gembed.m | .m | sms-master/irt/systems/arch/Gembed.m | 2,675 | utf_8 | 4728c2561f2c1c4be6cfec19458cfa80 | function ob = Gembed(varargin)
%|function ob = Gembed([args])
%| Construct Gembed object that embes a short vector into a longer vector.
%| with dimensions [(Nd)].
%|
%| option1:
%| 'list' [N] list of array entries
%| 'odim' ndims
%|
%| option2:
%| 'samp' logical [(Nd)] sampling pattern of array entries
%|
%| out
%|... |
github | alcu/sms-master | Gtomo2_nufft.m | .m | sms-master/irt/systems/arch/@Gtomo2_nufft/Gtomo2_nufft.m | 14,715 | utf_8 | 9ba2872db713594d3b7b072a30828ae9 | function ob = Gtomo2_nufft(nx, ny, nb, na, varargin)
%function ob = Gtomo2_nufft(nx, ny, nb, na, ...)
%
% Construct Gtomo2_nufft object, which does parallel-beam or fan-beam
% forward projection via the Fourier-slice theorem,
% with the Fourier transform computed via NUFFT.
% See Gtomo2_nufft_test.m for example usage.... |
github | alcu/sms-master | mtimes.m | .m | sms-master/irt/systems/arch/@Gtomo2_nufft/mtimes.m | 3,487 | utf_8 | 0a0607aaff2b947f2a898c4b4963568f | function y = mtimes(ob, x)
%function y = mtimes(ob, x) for Gtomo2_nufft object
% y = G * x, or x = G' * y
if ob.apower ~= 1, error notdone, end
%
% partial projection or backprojection (for ordered subsets)
%
if ob.is.subref
error 'subref not done'
%
% full "projection"
%
elseif ~ob.is_transpose
if ob.is_masked
... |
github | alcu/sms-master | eigs.m | .m | sms-master/irt/systems/@fatrix2/eigs.m | 795 | utf_8 | d31c4b50c3e8022449cea1aec13b29ce | function out = eigs(ob, varargin)
% compute largest magnitude eigenvalue of object by calling eigs,
% which in turn probably uses the power method.
% this may be slow for big objects because it is iterative.
warn 'todo: i could not get this to work'
% A = Gdft('mask', true(8,6));
% eigs(A, 1)
if numel(varargin) ~= 1... |
github | alcu/sms-master | fatrix2.m | .m | sms-master/irt/systems/@fatrix2/fatrix2.m | 7,665 | utf_8 | 7ea439fa31ac3d0feb2b6e264d77d173 | function ob = fatrix2(varargin)
%|function ob = fatrix2('odim', odim, 'mask', mask, 'arg', arg, [options])
%|
%| Construct fatrix2 object, a matrix generalization for representing
%| any linear operator. The 'f' might stand for 'fake' or 'function-based'
%| or 'fancy' or maybe a last name?
%| The caller can provide ... |
github | alcu/sms-master | build_gram.m | .m | sms-master/irt/systems/@fatrix2/build_gram.m | 1,840 | utf_8 | 766ccdffc25114698aa904806d64653e | function [T, reuse] = build_gram(ob, W, reuse, varargin)
%|function [T, reuse] = build_gram(ob, W, reuse, varargin)
%| build "gram matrix object" T = A' W A
%| in
%| ob the system matrix A
%| W typically diag(wi), having size [1 1]*size(ob,1)
%| reuse stuff returned by previous call that can be reused
%| the nex... |
github | alcu/sms-master | subsref.m | .m | sms-master/irt/systems/@fatrix2/subsref.m | 1,490 | utf_8 | 05a3a416c4598a67125f656c218a6a2e | function out = subsref(ob, args)
%function out = subsref(ob, args)
% handle subscript references like ob.ref or ob(ref,:)
% Copyright 2002-2-20, Jeff Fessler, University of Michigan
out = fatrix2_subsref1(ob, args(1)); % handle first subscript
if numel(args) > 1 % handle multiple subscripts, e.g., ob.field()
out = ... |
github | alcu/sms-master | mtimes.m | .m | sms-master/irt/systems/@fatrix2/mtimes.m | 3,770 | utf_8 | 90cbcf760a916c679992d5969c44d459 | function y = mtimes(ob, x)
%function y = mtimes(ob, x)
% A * x
% A' * y
% y' * A
% x' * A'
% B * A
% etc
if isnumeric(ob)
if isscalar(ob) % scalar * object
y = fatrix2_scalar_times(ob, x);
else % row_vector(s) * object
y = (x' * ob')'; % trick: x <-> ob
end
return
end
if ~isnumeric(x) % object * object
if is... |
github | alcu/sms-master | block_diag.m | .m | sms-master/irt/systems/@fatrix2/block_diag.m | 3,627 | utf_8 | 67530ea7678d0958a6a8f5af96d0efba | function ob = block_diag(varargin)
%|function ob = block_diag(block1, ..., blockM)
%|
%| Construct fatrix2 object from fatrix2 objects
%| block_diag(A_1, A_2, ..., A_M)
%|
%| in
%| blocks{:} fatrix2 blocks
%|
%| options
%|
%| out
%| ob [nd np] nd = sum_m nrow(A_M), np = sum_m ncol(A_m)
%|
%| Copyright 2012-09-09, Je... |
github | alcu/sms-master | fatrix2_block_sum.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_block_sum.m | 3,445 | utf_8 | 055bfb14bdfb774dc36f96169e295992 | function ob = fatrix2_block_sum(blocks)
%| ob = fatrix2_block_sum(blocks)
%| called for ob1 + ob2 + ...
% find at least one fatrix2 in the collection
ib = [];
for ii=1:numel(blocks)
if isa(blocks{ii}, 'fatrix2')
ib = ii;
break
end
end
if isempty(ib), fail 'no fatrix2? bug', end
bb = blocks{ib}; % reference bloc... |
github | alcu/sms-master | fatrix2_kroni.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_kroni.m | 2,730 | utf_8 | 14a3e6530795e1e7806fea148dcc6cd2 | function ob = fatrix2_kroni(Mkron, ob)
%|function ob = fatrix2_kroni(Mkron, ob)
%|
%| Construct fatrix2_block object of form kron(eye(Mkron), ob)
%| i.e., a kronecker product of identity matrix with object.
%|
%| in
%| Mkron natural number
%| ob fatrix2
%|
%| out
%| ob fatrix2 equivalent to kron(eye(Mkron), ob)
%|... |
github | alcu/sms-master | fatrix2_vertcat.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_vertcat.m | 5,534 | utf_8 | 37bbf263034d1242f1d6e8efce069e50 | function ob = fatrix2_vertcat(blocks, varargin)
%|function ob = fatrix2_vertcat(blocks, [options])
%| vertcat: B = [A1; A2; ...]
%|
%| in
%| blocks {cell} cell array of the (fatrix2) blocks
%|
%| option
%| 'dim_cat' dimension along which to concatenate odims
%| all other odims must match
%| default is ndim+1 if *... |
github | alcu/sms-master | fatrix2_mtimes2.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_mtimes2.m | 2,931 | utf_8 | a2b7ec6fa51de76b0329a6de132cdd63 | function ob = fatrix2_mtimes2(ob1, ob2, varargin)
%|function ob = fatrix2_mtimes2(ob1, ob2, options)
%|
%| Construct fatrix2 object that is the product of two objects:
%| ob = ob1 * ob2.
%| Requires size(ob1,2) == size(ob2,1) as in matrix multiplication.
%|
%| in
%| ob1 *atrix any object that can do "mtimes" and "si... |
github | alcu/sms-master | fatrix2_subsref_colon.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_subsref_colon.m | 2,533 | utf_8 | 984e937cde23c07d725fc3435bcc1f42 | function out = fatrix2_subsref_colon(ob, sub2, varargin)
%function out = fatrix2_subsref_colon(ob, sub2, varargin)
%
% handle subscript references like ob(:,sub2)
% This will called from ../subsref with (ob, subs{2})
%
% Copyright 2010-12-02, Jeff Fessler, University of Michigan
if streq(sub2, ':') % ob(:,:)
% do by... |
github | alcu/sms-master | fatrix2_block.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_block.m | 7,290 | utf_8 | 29b7a9381463276f507b6c857d862043 | function ob = fatrix2_block(blocks, varargin)
%|function ob = fatrix2_block(blocks, options)
%|
%| Construct fatrix2_block object, a meta-object composed of fatrix2 blocks,
%| such as block_diag(A_1, A_2, ..., A_M)
%| See fatrix2_block_test.m for example usage.
%|
%| in
%| blocks {cell} cell array of the blocks
%|
%|... |
github | alcu/sms-master | fatrix2_horzcat.m | .m | sms-master/irt/systems/@fatrix2/private/fatrix2_horzcat.m | 2,654 | utf_8 | a7296a7a662b83420af5e6c0880c5bf1 | function ob = fatrix2_horzcat(blocks, varargin)
%|function ob = fatrix2_horzcat(blocks, [options])
%| horzcat: B = [A1, A2, ...]
%|
%| in
%| blocks {cell} cell array of the (fatrix2) blocks
%|
%| option
%| 'dim_cat' dimension along which to concatenate idims
%| all other idims must match
%| default is ndim+1 if *... |
github | alcu/sms-master | ir_conv.m | .m | sms-master/irt/utilities/ir_conv.m | 3,042 | utf_8 | 924cf091c5f85a6e133ca58987014b06 | function y = ir_conv(x, psf, varargin)
%|function y = ir_conv(x, psf, varargin)
%|
%| ND convolution of signal x with psf
%|
%| in
%| x [(N)] signal
%| psf [(N)] psf
%|
%| option
%| 'adj' 0|1 default: 0 (if 1 then adjoint)
%| 'per' 0|1|[] default: 0 (if 1 then periodic boundary conditions)
%| if logical array with ... |
github | alcu/sms-master | ifft_sym.m | .m | sms-master/irt/utilities/ifft_sym.m | 1,213 | utf_8 | db6d67345856cfa97bc5e29f62cb0d57 | function y = ifft_sym(varargin)
%|function y = ifft_sym(varargin)
%|
%| matlab 7.0 introduced a 'symmetric' option to ifft to handle
%| spectra that are (circularly) hermitian symmetric (real signal).
%| this glue routine is to provide backward compatibility for matlab 6.5.
%| Caution: v7 ifft with 'symmetric' just u... |
github | alcu/sms-master | jf_protected_names.m | .m | sms-master/irt/utilities/jf_protected_names.m | 2,338 | utf_8 | 13cbf7dbe4783622aed5922538805812 | function pn = jf_protected_names
%|function pn = jf_protected_names
%|
%| A serious drawback of the matlab language is that it lacks
%| a protected or local namespace. Every m-file that is in the path
%| is available to all functions (except those in "private" subdirectories).
%| Users who have their own m-files tha... |
github | alcu/sms-master | os_run.m | .m | sms-master/irt/utilities/os_run.m | 496 | utf_8 | b86b9948f9e383a3f5f8d047d0ec9ae0 | function out = os_run(str)
%|function out = os_run(str)
%| call OS (unix only of course), check for error, optionally return output
if nargin < 1, help(mfilename), error(mfilename), end
if streq(str, 'test'), os_run_test, return, end
[s out1] = unix(str);
if s
fail('unix call failed:\n%s', str)
end
if nargout
ou... |
github | alcu/sms-master | ir_has_imfilter.m | .m | sms-master/irt/utilities/ir_has_imfilter.m | 490 | utf_8 | 02358bca6df656e39e797a84b9dfbf1c | function out = ir_has_imfilter
%function out = ir_has_imfilter
%| determine if we have the "real" imfilter from image processing toolbox or not
out = (exist('imfilter') == 2) && ir_has_image_processing_toolbox;
function out = ir_has_image_processing_toolbox
v = ver;
if ~isstruct(v)
fail 'cannot determine if thi... |
github | alcu/sms-master | ir_odwt1.m | .m | sms-master/irt/utilities/ir_odwt1.m | 5,436 | utf_8 | c2b8f6c530d52655ee78558baa946db7 | function [coef codes] = ir_odwt1(x, varargin)
%|function [coef codes] = ir_odwt1(x, varargin)
%|
%| 1D orthonormal discrete wavelet transform (ODWT) of (each column of) x
%|
%| in
%| x [N L] L signals of length N
%|
%| option
%| 'level' int default: 1
%| 'wname' char default: 'haar'
%| 'ortho' 0|1 default: 1
%| 'adj'... |
github | alcu/sms-master | ir_bspline_knot.m | .m | sms-master/irt/utilities/ir_bspline_knot.m | 1,349 | utf_8 | 0749eb15026b38260ce92d0ff32824ed | function knot = ir_bspline_knot(ti, k)
%function knot = ir_bspline_knot(ti, k)
%| Given a set of sample point locations "ti",
%| determine reasonable knots for B-spline of order k.
%| Useful especially for zero boundary conditions?
%|
%| in
%| ti [N] sample locations
%| k order (nonnegative integer)
%|
%| out
%| ti ... |
github | alcu/sms-master | interp1_jump.m | .m | sms-master/irt/utilities/interp1_jump.m | 2,280 | utf_8 | b183193c9190a72ea28565ea8def6dba | function yi = interp1_jump(xj, yj, xi, varargin)
%function yi = interp1_jump(xj, yj, xi, {arguments for interp1})
% Generalization of matlab's "interp1" to allow xj with repeated values,
% for interpolation of a function that has "jumps" (discontinuities),
% such as is caused by k-edges for mass attenuation coefficien... |
github | alcu/sms-master | jf_histn.m | .m | sms-master/irt/utilities/jf_histn.m | 2,095 | utf_8 | 4ff147f366a7c294eac646158ea776fa | function [hist center] = jf_histn(data, varargin)
%|function [hist center] = jf_histn(data, varargin)
%|
%| Fast histogram of multidimensional data for equally-spaced bins.
%| todo: use accumarray?
%|
%| in
%| data [N M] data values to be binned (M-dimensional)
%|
%| option
%| 'min' [M] minimum bin values for each di... |
github | alcu/sms-master | jf_assert.m | .m | sms-master/irt/utilities/jf_assert.m | 871 | utf_8 | 444b53c5605424b42508cd26fa0da635 | function jf_assert(varargin)
%function jf_assert(command)
% verify that the command (evaluated within caller) returns true.
% if not, print error message.
if nargin < 1, help(mfilename), error(mfilename), end
if nargin == 1 && streq(varargin{1}, 'test'), jf_assert_test, return, end
arg = [varargin{:}]; % handle case... |
github | alcu/sms-master | ir_interpft.m | .m | sms-master/irt/utilities/ir_interpft.m | 2,775 | utf_8 | d2f552c5cc6318874b8d23b165f62ad9 | function yy = ir_interpft(xx, K, dim)
%|function yy = ir_interpft(xx, K, dim)
%|
%| Interpolate dimension "dim" (default 1) of input vector or array xx
%| using an FFT-based approach so that it has K > size(xx, dim) samples.
%| Unlike matlab or octave interpft, if the input is real, this version
%| always produces a... |
github | alcu/sms-master | gaussian_kernel.m | .m | sms-master/irt/utilities/gaussian_kernel.m | 760 | utf_8 | 119655fccf91567673b1e3739af2b637 | function kern = gaussian_kernel(fwhm, nk_half)
%function kern = gaussian_kernel(fwhm, nk_half)
% samples of a gaussian kernel at [-nk_half:nk_half]
% with given FWHM in pixels
% uses integral over each sample bin so that sum is very close to unity
%
% Copyright 2001-9-18, Jeff Fessler, The University of Michigan
if n... |
github | alcu/sms-master | fwhm_match.m | .m | sms-master/irt/utilities/fwhm_match.m | 1,879 | utf_8 | 0145888c3142cf5ec7dbe03d86b0ede4 | function [fwhm_best, costs, im_best] = ...
fwhm_match(true_image, blurred_image, fwhms)
%|function [fwhm_best, costs, im_best] = ...
%| fwhm_match(true_image, blurred_image, fwhms)
%|
%| given a blurred_image of a true_image, find the FHWM of a Gaussian kernel
%| that, when convolved to the true_image, yields the sm... |
github | alcu/sms-master | fractional_delay.m | .m | sms-master/irt/utilities/fractional_delay.m | 2,438 | utf_8 | 09fad587ef6cfbb84e8a06617919b92f | function y = fractional_delay(x, delay)
%function y = fractional_delay(x, delay)
%
% given N samples x[n] of a real, periodic, band-limited signal x(t),
% compute sinc interpolated samples of delayed signal y(t) = x(t - delay)
% each column of x can be shifted by a different amount if delay is a vector.
% in
% x [N,L]... |
github | alcu/sms-master | ir_reclass.m | .m | sms-master/irt/utilities/ir_reclass.m | 977 | utf_8 | df7beaf3f847ddcb271459c0e19499a5 | function y = ir_reclass(x, varargin)
%|function y = ir_reclass(x, newclass)
%|
%| Convert input variable x to specific class.
%| Typically: x = ir_reclass(x, class(z)); to match class of z
%|
%| in
%| x data
%|
%| option
%| classname e.g. 'single' or 'double'
%|
%| out
%| y data with converted class
%|
%| 2012-06-0... |
github | alcu/sms-master | poisson1.m | .m | sms-master/irt/utilities/poisson1.m | 906 | utf_8 | 7940f72d48835909f7b8fad255b41f56 | function data = poisson1(xmean, seed)
%|function data = poisson1(xmean, seed)
%| Generate poisson random column vector with mean xmean
%| by summing exponentials.
%| Optional seed for rng().
%| This is efficient only for small mean values, eg < 20.
if nargin < 1, help(mfilename), error(mfilename), end
if streq(xmean... |
github | alcu/sms-master | pad_into_center.m | .m | sms-master/irt/utilities/pad_into_center.m | 2,112 | utf_8 | f97748c8b30c06f95a39ce3b11ac7f40 | function xpad = pad_into_center(x, npad, varargin)
%|function xpad = pad_into_center(x, npad, varargin)
%|
%| Zero pad an input signal x symmetrically around "0" (image center).
%| Useful for DFT/FFT of PSF.
%| using this avoids matlab's padarray.m which is in image proc toolbox
%|
%| option
%| 'circ' 0|1 if 1, circu... |
github | alcu/sms-master | downsample2.m | .m | sms-master/irt/utilities/downsample2.m | 797 | utf_8 | c7dfd107658a763d075731b3310d1685 | function y = downsample2(x, m, varargin)
%|function y = downsample2(x, m, varargin)
%| downsample by averaging by integer factors
%| m can be a scalar (same factor for both dimensions)
%| or a 2-vector
%| in
%| x [nx ny]
%| option
%| 'warn' 0|1 warn if non-integer factor. default: 1
%| out
%| y [nx/m ny/m]
if nargin... |
github | alcu/sms-master | reshaper.m | .m | sms-master/irt/utilities/reshaper.m | 891 | utf_8 | 38be3bcef2a0d0b3c2f790d8b4ed9dcc | function y = reshaper(x, dim)
%|function y = reshaper(x, dim)
%|
%| reshape function that is more flexible, allowing for "multiples".
%| example: reshape(rand(2*3*5,7), [2 3 5]) will become [2 3 5 7]
%|
%| in
%| x [*dim (Ld)]
%| dim short row or column
%| if dim is '2d' then y is 2d with first n-1 dims collapsed
%|
... |
github | alcu/sms-master | fld_write.m | .m | sms-master/irt/utilities/fld_write.m | 5,855 | utf_8 | b88cbfbc75f19788fa6269beda2d77f5 | function fld_write(file, data, varargin)
%|function fld_write(file, data, [options])
%| write data into AVS format .fld file
%| see ASPIRE user's guide (or AVS online documentation) for file format.
%|
%| todo: generalize to include 'extent' options and default
%|
%| options
%| 'check' 0|1 1: report error if file ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.