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 | Cdiff.m | .m | sms-master/irt/penalty/Cdiff.m | 5,303 | utf_8 | 199166d71c81af27b920d06c547dc4dc | function ob = Cdiff(kappa, varargin)
%|function C = Cdiff(kappa, [options])
%|
%| This object has been made obsolete by Cdiff1.m and Reg1.m
%|
%| Construct Cdiff object that can compute C * x and the adjoint C' * d
%| for a "differencing" matrix C for roughness penalty regularization.
%| This object is used internall... |
github | alcu/sms-master | penalty2_design.m | .m | sms-master/irt/penalty/penalty2_design.m | 7,202 | utf_8 | 8d3cfcdf12fcd3db5ed8ad7bd3946e55 | function [C, rj] = penalty2_design(type, varargin)
%|function [C, rj] = penalty2_design(type, ['leak'|'tight'], wang, ang, mask)
%|
%| Design the penalty matrix "C" (and penalty coefficients "rj")
%| for a quadratic penalty R(x) = 1/2 x' C * C * x with:
%| 1st-order differences and a 2nd-order neighborhood (8 neighbor... |
github | alcu/sms-master | adw_fan_new.m | .m | sms-master/irt/penalty/adw_fan_new.m | 4,058 | utf_8 | 1c487be9ecb8ec3416473a460a9611e4 | function [w0, phi] = adw_fan_new(sg, ig, wi)
%function [w0, phi] = adw_fan_new(sg, ig, wi)
%
% Compute the angular-dependent weighting for fan-beam geometry.
% w0(\Phi) = w(x0, y0, \Phi)
% For fully corrected penalty:
% w(s',\beta') * J(s') | \phi'=\Phi + ...
% w(s',\beta') * J(s') | \phi'=\Phi-pi
% See fessler chapte... |
github | alcu/sms-master | RfromC.m | .m | sms-master/irt/penalty/RfromC.m | 2,319 | utf_8 | 1624a52ba01ac641bb1caf5142d46a78 | function R = RfromC(varargin)
%|function R = RfromC(varargin)
%|
%| Create regularization object from "analysis" matrix (or fatrix2) C1.
%|
%| R(x) = sum_k wt_k pot([C1*x]_k)
%|
%| option
%| 'C1' from Godwt1 or such. default: 1
%| must be capable of providing abs(C1)
%| 'pot' from potential_fun. default: quadrat... |
github | alcu/sms-master | potential_fun.m | .m | sms-master/irt/penalty/potential_fun.m | 21,476 | utf_8 | 16394e0d895a14fca802e60795a4c7a4 | function pot = potential_fun(type, delta, param, varargin)
%|function pot = potential_fun(type, delta, param, varargin)
%|
%| Define roughness penalty potential functions (as strum).
%|
%| The penalty will have the form
%| R(x) = sum_k w_k * potential_k([Cx]_k, delta_k)
%| where w_k is provided elsewhere, not here!
%... |
github | alcu/sms-master | Rweights.m | .m | sms-master/irt/penalty/Rweights.m | 12,650 | utf_8 | f4fd48c7cc45684a035e350caae757a3 | function wt = Rweights(kappa, offsets, varargin)
%|function wt = Rweights(kappa, offsets, [options])
%|
%| Build "weights" for roughness penalty for regularized methods.
%| Intended to be used internally by roughness penalty object Reg1.
%|
%| General form of roughness penalty:
%| R(x) = sum_{m=1}^M sum_n w[n;m] pote... |
github | alcu/sms-master | penalty_distance.m | .m | sms-master/irt/penalty/penalty_distance.m | 1,242 | utf_8 | 93af70a7c35044202b24a61aeba16350 | function distance = penalty_distance(offsets, sizes)
%|function distance = penalty_distance(offsets, sizes)
%|
%| convert scalar offsets to Euclidean distances to neighbors,
%| with the exception that '0' is mapped to 1 for identity case
%|
%| in
%| offsets [MM]
%| sizes [1 ndim]
%| out
%| distance [MM 1]
%|
%| Cop... |
github | alcu/sms-master | Gwave2.m | .m | sms-master/irt/penalty/Gwave2.m | 4,637 | utf_8 | 5be0e2f081a8433934e5cb21697d18b4 | function ob = Gwave2(varargin)
%|function ob = Gwave2([args])
%|
%| Construct object that performs wavelet analysis of a 2D image,
%| for regularization based on sparsity such as in compressed sensing.
%|
%| option
%| 'mask' logical [nx ny] image-domain mask, often: true(nx,ny)
%| 'wname' wavelet name (default: 'haa... |
github | alcu/sms-master | ugibb_form.m | .m | sms-master/irt/penalty/ugibb_form.m | 6,606 | utf_8 | 8b2531cc757a57b58c93a6f869165abc | function ugibb = ugibb_form(pic, varargin)
%|function ugibb = ugibb_form(pic, [options])
%|
%| form a "ugibb" structure from a 2D or 3D picture,
%| of potential use for regularization with side information.
%| Specifically can be used with ASPIRE 'ugibb' regularization option.
%| See Fessler et al, IEEE Tr. Nuc. Scie... |
github | alcu/sms-master | Gwave1.m | .m | sms-master/irt/penalty/Gwave1.m | 15,577 | utf_8 | ca8e67aaea2058d29f95b3fe4b0acadf | function ob = Gwave1( varargin )
%|function ob = Gwave1([args])
%| Construct Gwave object that computes wavelet decomposition of a
%| signal with dimensions [(Nd)]. This is useful for compressed sensing
%| imaging. (1D or 2D wavelets only)
%|
%| options:
%| 'mask' logical [(Nd)] image-domain mask, usually: true(nx,... |
github | alcu/sms-master | Godwt1.m | .m | sms-master/irt/penalty/Godwt1.m | 2,863 | utf_8 | d0e710edb6f854dd53b670f038e39566 | function ob = Godwt1(mask, varargin)
%|function ob = Godwt1(mask, varargin)
%| Construct Godwt1 object that computes orthonormal discrete wavelet
%| decomposition of a signal with dimensions [(N)].
%| This is useful for sparsity regularization (aka compressed sensing).
%| (1D or 2D wavelets only)
%|
%| in
%| 'mask' l... |
github | alcu/sms-master | penalty2_nuyts.m | .m | sms-master/irt/penalty/penalty2_nuyts.m | 7,320 | utf_8 | 1ca70bcf6790bfe433f38d8dcdc21df5 | function [C, rj] = penalty2_nuyts(type, wang, ang, mask)
%|function [C, rj] = penalty2_nuyts(type, wang, ang, mask)
%|
%| Design the penalty matrix "C" (and penalty coefficients "rj")
%| for a quadratic penalty R(x) = 1/2 x' C * C * x with:
%| 1st-order differences and a 2nd-order neighborhood (8 neighbors).
%| Desig... |
github | alcu/sms-master | Cdiffs.m | .m | sms-master/irt/penalty/Cdiffs.m | 7,538 | utf_8 | 186f05f2a91714f0672adb5996128c84 | function ob = Cdiffs(isize, varargin)
%|function C1 = Cdiffs(isize, [options])
%|
%| Construct C1 object that can compute C1 * x and the adjoint C1' * d
%| for a "finite differences" matrix C for roughness penalty regularization.
%| This "stacks up" multiple Cdiff1() objects, e.g., akin to using vertcat(),
%| for pos... |
github | alcu/sms-master | potential_func.m | .m | sms-master/irt/penalty/potential_func.m | 6,692 | utf_8 | eb0881cb1de31aadc91582eda10e0589 | function pot = potential_func(type, delta, param)
%|function pot = potential_func(type, delta, param)
%|
%| Define roughness penalty potential functions (using function handles).
%|
%| The penalty will have the form
%| R(x) = sum_k w_k * potential_k([Cx]_k, delta_k)
%| where w_k is provided elsewhere, not here!
%|
%|... |
github | alcu/sms-master | Reg1_setup_zxy.m | .m | sms-master/irt/penalty/private/Reg1_setup_zxy.m | 2,932 | utf_8 | 26e0f6b8db297e89fd4e0efd5225efbd | function R = Reg1_setup_zxy(arg, kappa)
%|function R = Reg1_setup_zxy(arg, kappa)
%|
%| Reg1_setup_zxy()
%|
%| mex-based calculations of penalty gradient/denom for zxy ordering
%|
%| caution: when this is called, arg.offsets must be w.r.t. [nz nx ny]
%| so the caller must take care to convert (if necessary) using
%| ... |
github | alcu/sms-master | Cmask.m | .m | sms-master/irt/penalty/arch/Cmask.m | 2,089 | utf_8 | 04bcda4c4c8de825200e0e8edb9c8df0 | function [out] = Cmask(type, mask)
%function [out] = Cmask(type, mask)
% select appropriate portions of penalty_mex output based on support mask.
% Cmask() .* penalty_mex() should be same as C * x.
% in
% type string
% mask [nx,ny[,nz]] support
% out
% out [nx,ny,4] binary
%
% Copyright 2004-5-16, Jeff Fessler, The U... |
github | alcu/sms-master | Rbuild_new.m | .m | sms-master/irt/penalty/arch/Rbuild_new.m | 4,748 | utf_8 | cb68886cfe43ae3dd38230441d6c9975 | function R = Rbuild(ctype, kappa, nbrs, beta, potential, delta, ...
match_aspire, dist_power)
%function R = Rbuild(ctype, kappa, nbrs, beta, potential, delta, ...
% match_aspire, dist_power)
%
% build a regularization "object" for penalized-likelihood reconstruction.
%
% general form of nonquadratic penalty functio... |
github | alcu/sms-master | penalty_funcs.m | .m | sms-master/irt/penalty/arch/penalty_funcs.m | 4,682 | utf_8 | 5af80b084c2fed76c6415f04284c2f5a | function [potk, wpot, dpot] = penalty_funcs(type, beta, delta)
%function [potk, wpot, dpot] = penalty_funcs(type, beta, delta)
%
% Define roughness penalty functions via inline functions.
%
% If beta is numeric, then the penalty will have the form
% R(x) = sum_k beta * potential([Cx]_k, delta)
% If beta is empty, then... |
github | alcu/sms-master | Rmem.m | .m | sms-master/irt/penalty/arch/Rmem.m | 11,361 | utf_8 | 01601d4dc1fdb887b68772f82d541967 | function R = Rmem(kappa, varargin)
%function R = Rmem(kappa, [options])
%
% Build roughness penalty regularization "object" based on C = Cdiff() object,
% for regularized solutions to inverse problems.
% This version is somewhat less flexible than Robject() but uses less memory.
%
% General form of nonquadratic penalt... |
github | alcu/sms-master | Rbuild.m | .m | sms-master/irt/penalty/arch/Rbuild.m | 4,732 | utf_8 | ae00bd76584d5f257d217edf74673b2d | function R = Rbuild(ctype, kappa, nbrs, beta, potential, delta, ...
match_aspire, dist_power)
%function R = Rbuild(ctype, kappa, nbrs, beta, potential, delta, ...
% match_aspire, dist_power)
%
% build a regularization "object" for penalized-likelihood reconstruction.
%
% general form of nonquadratic penalty functio... |
github | alcu/sms-master | Rmem_somesh.m | .m | sms-master/irt/penalty/arch/Rmem_somesh.m | 17,475 | utf_8 | 667bc93584ca7b19a783f38df32f6517 | function R = Rmem(kappa, varargin)
%function R = Rmem(kappa, [options])
%
% Build roughness penalty regularization "object" based on C = Cdiff() object,
% for regularized solutions to inverse problems.
% This version is somewhat less flexible than Robject() but uses less memory.
%
% General form of nonquadratic penalty... |
github | alcu/sms-master | embed_fatrix.m | .m | sms-master/irt/penalty/arch/embed_fatrix.m | 511 | utf_8 | b9a50333b616c9ea59460d3ec403e655 | function ob = embed_fatrix(mask)
%function ob = embed_fatrix(mask)
% Under Construction: perhaps not needed?
% in
% mask [dim] logical support mask
% out
% ob [*dim,np] np = sum(mask(:))
arg.nn = numel(mask);
arg.np = sum(mask(:));
dim = [arg.nn arg.np];
ob = fatrix(dim, 'forw', @embed_fatrix_forw, 'back', @embed_fatr... |
github | alcu/sms-master | Cdiffs.m | .m | sms-master/irt/penalty/arch/Cdiffs.m | 2,271 | utf_8 | 4270566fa2e149d3ed98c0ad7e6c0a5f | function ob = Cdiffs(isize, varargin)
%function C1 = Cdiffs(isize, [options])
%
% Construct C1 object that can compute C1 * x and the adjoint C1' * d
% for a "differencing" matrix C for roughness penalty regularization.
% This object "stacks up" multiple Cdiff1() objects using block_fatrix()
% for possible internal us... |
github | alcu/sms-master | fftn_fast.m | .m | sms-master/irt/nufft/fftn_fast.m | 2,536 | utf_8 | 45eea8a7988be9d007556ae10931481b | function Xs = fftn_fast(xs, ns)
%|function Xs = fftn_fast(xs, ns)
%|
%| For some reason, in matlab versions before about 7.4 (R2007a),
%| matlab's fftn routine was suboptimal for the case of 2D FFTs,
%| at least on some machines.
%| The improvement herein was found by Hugo Shi.
%| After 7.4, fftn worked fine so this ... |
github | alcu/sms-master | nufft_init.m | .m | sms-master/irt/nufft/nufft_init.m | 9,531 | utf_8 | b61c2d39bde694baaa40d52fbce3a07d | function st = nufft_init(om, Nd, Jd, Kd, varargin)
%|function st = nufft_init(om, Nd, Jd, Kd, [n_shift,] ...)
%|
%| Initialize structure for d-dimension NUFFT using KB interpolator,
%| particularly the interpolation matrix in sparse format.
%| caution: this routine can require a lot of memory!
%| in
%| om [M d] "digi... |
github | alcu/sms-master | dtft.m | .m | sms-master/irt/nufft/dtft.m | 3,773 | utf_8 | 16434318e110e05a43a4688c27874e78 | function X = dtft(x, omega, varargin)
%|function X = dtft(x, omega [,options])
%|
%| Compute d-dimensional DTFT of signal x at frequency locations omega
%|
%| in
%| x [(Nd) L] signal values
%| omega [M dd] frequency locations (radians), dd = numel(Nd)
%|
%| option
%| 'n_shift' [dd 1] use [0:N-1]-n_shift (default [0 ... |
github | alcu/sms-master | newfft.m | .m | sms-master/irt/nufft/newfft.m | 18,075 | utf_8 | adc488b6dfedc713130f4db30fcf2933 | function st = newfft(om_in, Nd_in, varargin)
%|function st = newfft(om, Nd, [options])
%|
%| New version of NUFFT (pun intended) that uses real interpolation kernels.
%| (The original NUFFT code used complex interpolation needlessly.)
%|
%| This returns a "strum" object with methods for both forward and adjoint
%| d-... |
github | alcu/sms-master | kaiser_bessel.m | .m | sms-master/irt/nufft/kaiser_bessel.m | 4,253 | utf_8 | 777466f41ddd4710150d642e5618e676 | function [kb, alpha, kb_m] = kaiser_bessel(x, J, alpha, kb_m, K_N)
%|function [kb, alpha, kb_m] = kaiser_bessel(x, J, alpha, kb_m)
%|function [kb, alpha, kb_m] = kaiser_bessel(x, J, 'best', 0, K_N)
%|
%| generalized Kaiser-Bessel function for x in support [-J/2,J/2]
%| shape parameter "alpha" (default 2.34 J)
%| orde... |
github | alcu/sms-master | kaiser_bessel_xray.m | .m | sms-master/irt/nufft/kaiser_bessel_xray.m | 2,171 | utf_8 | 20c7fd23b0117fae5747e6138c3e10be | function [proj, J, alpha, kb_m, d] = kaiser_bessel_xray(r, J, alpha, kb_m, d)
%function [proj, J, alpha, kb_m, d] = kaiser_bessel_xray(r, J, alpha, kb_m, d)
%
% X-ray transform of generalized Kaiser-Bessel function,
% See (A7) in lewitt:90:mdi, JOSA-A, Oct. 1990.
%
% in
% r [?] radial locations in projection space (un... |
github | alcu/sms-master | kaiser_bessel_ft.m | .m | sms-master/irt/nufft/kaiser_bessel_ft.m | 2,917 | utf_8 | 55a5441789ed3aeef16729508beaef41 | function y = kaiser_bessel_ft(u, J, alpha, kb_m, d)
%function y = kaiser_bessel_ft(u, J, alpha, kb_m, d)
%
% Fourier transform of generalized Kaiser-Bessel function,
% in dimension d (default 1).
% shape parameter "alpha" (default 2.34 J)
% order parameter "kb_m" (default 0)
% See (A3) in lewitt:90:mdi, JOSA-A, Oct. 1... |
github | alcu/sms-master | ifftn_fast.m | .m | sms-master/irt/nufft/ifftn_fast.m | 2,149 | utf_8 | 3749fee0395f552bc7cf2430bba890df | function ys = ifftn_fast(xs)
%|function ys = ifftn_fast(xs)
%|
%| For some reason, matlab's ifftn routine is suboptimal
%| for the case of 2D FFTs, at least on some machines.
%| The improvement herein was found by Hugo Shi.
%|
%| Note: matlab's ifft() and ifftn() handle an optional second "N" argument in
%| different... |
github | alcu/sms-master | nufft1_build.m | .m | sms-master/irt/nufft/nufft1_build.m | 6,860 | utf_8 | 028fb5e6d7a50d070b13194cc93011cb | function st = nufft1_build(J, varargin)
%function st = nufft1_build(J, [option])
% Build 1D LS-NUFFT interpolation coefficients by brute force.
%
% in
% J neighborhood size: [-J/2,J/2]
% option
% om [M,1] frequency locations, if not provided build fine table
% N # of signal values (default: 2^8)
% K # of DFT freque... |
github | alcu/sms-master | nufft_scale.m | .m | sms-master/irt/nufft/nufft_scale.m | 1,782 | utf_8 | 3d9a700fb548713bc674a82ee26a673a | function sn = nufft_scale(Nd, Kd, alpha, beta, Nmid)
%function sn = nufft_scale(Nd, Kd, alpha, beta, Nmid)
% Compute scaling factors for NUFFT
% in
% Nd,Kd
% alpha {d}
% beta {d}
% option
% Nmid [d] midpoint: floor(Nd/2) or default (Nd-1)/2
% out
% sn [[Nd]] scaling factors
%
% Copyright 2004-7-8, Jeff Fessler, The ... |
github | alcu/sms-master | nufft_sinc.m | .m | sms-master/irt/nufft/nufft_sinc.m | 695 | utf_8 | e6857ad90712d847152c31e539b33d09 | function y = nufft_sinc(x)
%|function y = nufft_sinc(x)
%|
%| my version of "sinc" function, because matlab's sinc() is in a toolbox
%|
%| Copyright 2001-12-8, Jeff Fessler, University of Michigan
if nargin < 1, help(mfilename), error(mfilename), end
if streq(x, 'test'), nufft_sinc_test, return, end
iz = find(x == ... |
github | alcu/sms-master | nufft_diric.m | .m | sms-master/irt/nufft/nufft_diric.m | 1,999 | utf_8 | 271ee48427961a368e4e0f64f481e0c1 | function f = nufft_diric(k, N, K, use_true_diric)
%|function f = nufft_diric(k, N, K, use_true_diric)
%|
%| "regular fourier" Dirichlet-function WITHOUT phase
%| nufft_diric(t) = sin(pi N t / K) / ( N * sin(pi t / K) )
%| \approx sinc(t / (K/N))
%|
%| caution: matlab's version is different: sin(N * x / 2) / (N * sin... |
github | alcu/sms-master | dtft_adj.m | .m | sms-master/irt/nufft/dtft_adj.m | 2,513 | utf_8 | 365e6142f781387360ff6380084bc214 | function x = dtft_adj(X, omega, Nd, n_shift, useloop)
%|function x = dtft_adj(X, omega, Nd, n_shift, useloop)
%| Compute adjoint of d-dim DTFT for spectrum X at frequency locations omega
%| in
%| X [M L] dD DTFT values
%| omega [M d] frequency locations (radians)
%| n_shift [d 1] use [0:N-1]-n_shift (default [0 ..... |
github | alcu/sms-master | interp1_table1_import.m | .m | sms-master/irt/nufft/table/interp1_table1_import.m | 413 | utf_8 | 0e4818f872ba8ea210db56495b187e58 | function interp1_table1_import
libname = 'interp1_table1.a';
type11r = ['double[K1] r_ck, double[K1] i_ck, int32 K1, ' ...
'double[J1*L1+1] r_h1, int32 J1, int32 L1, ' ...
'double[M] p_tm, int32 M, double[M] &r_fm, double[M] &i_fm'];
myimport(libname, 'interp1_table1_real_per', 'void', type11r);
function myimport... |
github | alcu/sms-master | nufft_interp_zn.m | .m | sms-master/irt/nufft/private/nufft_interp_zn.m | 2,194 | utf_8 | 19b50f0ee43faa6a8824265f0516a25a | function zn = nufft_interp_zn(alist, N, J, K, func, Nmid)
%|function zn = nufft_interp_zn(alist, N, J, K, func, Nmid)
%| compute the "zn" terms for a conventional "shift-invariant" interpolator
%| as described in T-SP paper. needed for error analysis and for user-
%| defined kernels since i don't provide a means to ... |
github | alcu/sms-master | newfft_approx_for.m | .m | sms-master/irt/nufft/private/newfft_approx_for.m | 1,794 | utf_8 | 9f6f995e5bc3c9e4502d112ffc5c7b8c | function X = newfft_approx_for(st, x, om)
%|function X = newfft_approx_for(st, x, om)
%| (approximate) forward NUFFT
Nd = st.Nd;
Kd = st.Kd;
dims = size(x);
dd = length(Nd);
if ndims(x) < dd, error 'input signal has too few dimensions', end
if any(dims(1:dd) ~= Nd), error 'input signal has wrong size', end
%
% th... |
github | alcu/sms-master | newfft_table_init.m | .m | sms-master/irt/nufft/private/newfft_table_init.m | 5,812 | utf_8 | b37f03919ecb85b344b9b27b847ac7e1 | function st = newfft_table_init(st, varargin)
%|function st = newfft_table_init(st, varargin)
%|
%| Initialize structure for d-dimension NUFFT using table-based interpolator,
%| This should be called only by newfft for its 'table0' or 'table1' mode!
%| Note: default oversample factor is 2^11 or 2^13
%|
%| in
%| st s... |
github | alcu/sms-master | nufft_offset.m | .m | sms-master/irt/nufft/private/nufft_offset.m | 1,160 | utf_8 | 484e73add0ea3fc089c87836e367f318 | function k0 = nufft_offset(om, J, K)
%|function k0 = nufft_offset(om, J, K)
%| offset for NUFFT
%| in
%| om [M,1] omega (radians), typically in [-pi, pi) (not essential!)
%| J # of neighbors used for NUFFT interpolation
%| K FFT size
%|
%| out
%| k0 [M,1] prepared for mod(k0 + [1:J], K) (+ 1 for matlab)
%|
%| Copyri... |
github | alcu/sms-master | nufft2_bilinear.m | .m | sms-master/irt/nufft/archive/nufft2_bilinear.m | 3,189 | utf_8 | f8c76972dc1531204901130e78618094 | function X = nufft2_bilinear(omega, x, K1, K2, n_shift)
%function X = nufft2_bilinear(omega, x, K1, K2, n_shift)
% in:
% omega [M 2] frequencies in radians
% x [N1 N2] image dimensions
% J # of neighbors used
% K1,K2 FFT sizes (should be > N1,N2)
% n_shift [2] n = 0-n_shift to N-1-n_shift
% out:
% X [M 1]... |
github | alcu/sms-master | l1_regress_admm1.m | .m | sms-master/irt/example/l1_regress_admm1.m | 3,159 | utf_8 | e64ff2d4682f920097f0680d0b6ceeb4 | function [xs, info] = l1_regress_admm1(yi, A, varargin)
%|function [xs, info] = l1_regress_admm1(yi, A, varargin)
%|
%| l1 regression, minimizing cost function
%| cost(x) = pot( y - A x ) where pot(r) = |r|_1 by default.
%| minimized via ADMM algorithm with v = A x split.
%|
%| in
%| yi [M 1] noisy data
%| A [M N] ... |
github | alcu/sms-master | l1_tv_restore1_fun.m | .m | sms-master/irt/example/l1_tv_restore1_fun.m | 1,685 | utf_8 | f95c3477491614603abaa51116c99bc3 | function xs = l1_tv_restore1_fun(yi, A, varargin)
%|function xs = l1_tv_restore1_fun(yi, A, varargin)
%|
%| see l1_tv_restore1.m
%| min_x |yi - A(ti) * x|_1 + beta (|Cx x|_1 + |Cy x|_1)
%| where |.|_1 is approximated by a hyperbola
%|
%| in
%| yi data
%| A system matrix
%|
%| option
%| several - see code ...
%|
%| ou... |
github | alcu/sms-master | ir_inpaint_admm1.m | .m | sms-master/irt/example/ir_inpaint_admm1.m | 4,497 | utf_8 | bb257a0498aabf45f108c4492d6a7046 | function [xs, info] = ir_inpaint_admm1(yi, samp, varargin)
%function [xs, info] = ir_inpaint_admm1(yi, samp, varargin)
%|
%| Image in-painting by cost function
%| cost(x) 1/2 | y - x |_2^2 + beta * pot(C x)
%| minimized via ADMM algorithm (cf split Bregman) with v = C x split.
%|
%| in
%| yi [(N)] image to be in-pain... |
github | alcu/sms-master | ir_denoise_admm1.m | .m | sms-master/irt/example/ir_denoise_admm1.m | 3,762 | utf_8 | 9b6906c59f9eb8ff6bd4079dbb5da06e | function [xs, info] = ir_denoise_admm1(yi, varargin)
%|
%| Image denoising by cost function
%| cost(x) 1/2 | y - x |_2^2 + beta * pot(C x)
%| minimized via ADMM algorithm (cf split Bregman) with v = C x split.
%|
%| in
%| yi [(N)] noisy data
%|
%| options
%| x0 [(N)] initial estimate
%| C penalty matrix
%| (defa... |
github | alcu/sms-master | l1_regress_fun.m | .m | sms-master/irt/example/l1_regress_fun.m | 2,080 | utf_8 | dfd0e3d5d5bc13af6ddaef7c9b1606f3 | function [x1 x2] = l1_regress_fun(ti, yi, varargin)
%function [x1 x2] = l1_regress_fun(ti, yi, varargin)
% see l1_regress_example.m
% min_x |yi - A(ti) * x|_1
% where |.|_1 is approximated by a hyperbola
%
% Copyright 2005-4-24, Jeff Fessler, University of Michigan
if nargin == 1 && streq(ti, 'test')
l1_regress_exam... |
github | alcu/sms-master | xray_atten_interp.m | .m | sms-master/irt/ct/xray_atten_interp.m | 1,478 | utf_8 | c5f4586b5bd90c28284e5304b9401f66 | function mac = xray_atten_interp(kev, mac, kev_in, varargin)
%function mac = xray_atten_interp(kev, mac, kev_in, [options])
%
% Interpolate mass attenuation coefficients (mac) onto desired energies.
%
% in
% kev [M,1]
% mac [M,1]
% kev_in [N,1] desired energies [in keV]
%
% option
% 'interp' {} default {'cubic', 'e... |
github | alcu/sms-master | de_ftab.m | .m | sms-master/irt/ct/de_ftab.m | 9,344 | utf_8 | 3b8666a5535abbbe98f706e2d43e47fa | function ftab = de_ftab(xrs, mas, varargin)
%|function ftab = de_ftab(xrs, mas, [options])
%|
%| For multiple-kVp X-ray imaging, we must evaluate functions f_m(s_1, ..., s_L)
%| for m=1,..,M, where M is the number of kVp settings,
%| and L is the number of material components.
%| f_m(s1, s2) = -log( \int exp(- (m1(E)... |
github | alcu/sms-master | xray_read_dens.m | .m | sms-master/irt/ct/xray_read_dens.m | 2,205 | utf_8 | 205b32cd221f73df1f4e12926c19147c | function [density, mtype] = xray_read_dens(mtype, varargin)
%|function [density, mtype] = xray_read_dens(mtype, [options])
%|
%| Read densities for given material type(s).
%|
%| in
%| mtype 'aluminum', 'copper', ...
%| (optionally can be a cell array of several)
%| option
%| 'units' cm | mm default: cm
%| out... |
github | alcu/sms-master | de_ftab_invert.m | .m | sms-master/irt/ct/de_ftab_invert.m | 7,960 | utf_8 | 35fb8433d91aa7173f492938624435c1 | function shat = de_ftab_invert(ftab, fhat, varargin)
%|function shat = de_ftab_invert(ftab, fhat, [options])
%|
%| given fhat (log transmission data),
%| estimate shat (component density line integrals)
%|
%| in
%| ftab strum BH "table" built by de_ftab.m
%| fhat [(n?) M] log measurements
%| option
%| smin {LL}
%| s... |
github | alcu/sms-master | de_ftab_inv2.m | .m | sms-master/irt/ct/de_ftab_inv2.m | 4,168 | utf_8 | d9e3426ea8946c666817f52bd59502ef | function inv2 = de_ftab_inv2(fit, sl, varargin)
%|function inv2 = de_ftab_inv2(fit, sl, [options])
%|
%| Build object that does polynomial inverse of BH function.
%| (To map log data into corresponding to line-integrals of material density.)
%|
%| in
%| fit strum initialized by de_ftab_fit()
%| sl cell {s1, ..., sL} ... |
github | alcu/sms-master | de_wls_dercurv.m | .m | sms-master/irt/ct/de_wls_dercurv.m | 3,320 | utf_8 | 9e6910bf5128f535b9bd41683c8ae682 | function [grad, curv, fim, diml] = de_wls_dercurv(data, sil, curvtype, iblock, nblock)
%|function [grad, curv, fim, diml] = de_wls_dercurv(data, sil, curvtype, iblock, nblock)
%|
%| evaluate gradients and curvatures for DE WLS data-fit function:
%| U(x) = \sum_i U_i(s)
%| U_i(s) = \sum_m=1^M U_im(s)
%| U_im(s_i) = 1/... |
github | alcu/sms-master | de_ftab_fit.m | .m | sms-master/irt/ct/de_ftab_fit.m | 17,775 | utf_8 | d925d12e452b0a7bf8511b582d3f100b | function fit = de_ftab_fit(sl, fm, varargin)
%|function fit = de_ftab_fit(sl, fm, [options])
%|
%| Fit to DE table fm(), suitable for subsequent interpolation / extrapolation.
%| Uses either classic polynomial basis functions,
%| or an exponential model: -log(sum_k p_k exp(-m_k . s))
%|
%| in
%| sl {L} sample locati... |
github | alcu/sms-master | de_pl_obj.m | .m | sms-master/irt/ct/de_pl_obj.m | 1,984 | utf_8 | 431e8d6c9868d7c9b2b2c475d112237b | function [obj, like, penal] = de_pl_obj(xs, G, ymi, Im, rmi, ftab, R, mask)
%function [obj, like, penal] = de_pl_obj(xs, G, ymi, Im, rmi, ftab, R, mask)
%
% compute quadratically penalized Poisson likelihood for each column of x
% for dual-energy x-ray problem
% in
% xs [np,2,niter] iterates
% [nx,ny,2,niter] if ma... |
github | alcu/sms-master | de_ftab_fm.m | .m | sms-master/irt/ct/de_ftab_fm.m | 1,906 | utf_8 | f96b7fde602deaedce29eb3a4ddd4166 | function fm = de_ftab_fm(sll, mac, Ide)
%|function fm = de_ftab_fm(sll, mac, Ide)
%| calculate f_m(s1, s2, ...) (nonlinear BH function) using
%| in
%| sll cell{LL} or [(Nd),LL] material density integrals
%| {s1, s2, ..., sL} (ndgrid so same size [(Nd)])
%| mac [ne,LL] mass atten coefficients
%| Ide [ne,MM] spec... |
github | alcu/sms-master | de_poly_eval.m | .m | sms-master/irt/ct/de_poly_eval.m | 3,228 | utf_8 | e51cfb74d88a1f8ae3d0a1c6101f90b5 | function yy = de_poly_eval(xx, coef, expo, varargin)
%|function yy = de_poly_eval(xx, coef, expo, [option])
%|
%| Evaluate multi-dimensional polynomial:
%| y[n,l] = sum_k=1^K coef(k,l) x[n,1]^expo(k,1) * ... * x[n,M]^expo(k,M)
%|
%| in
%| xx [(nn) M] input values
%| coef [K L] coefficients
%| expo [K M] exponents a... |
github | alcu/sms-master | de_ftab_inv1.m | .m | sms-master/irt/ct/de_ftab_inv1.m | 5,368 | utf_8 | be89b32c4e0e316bb3c2c545559c5163 | function inv1 = de_ftab_inv1(fit, s1, varargin)
%|function inv1 = de_ftab_inv1(fit, s1, [options])
%|
%| Build object that does 1D inverse of BH function for 1st material component,
%| (usually water), for conventional "water only" beam-hardening correction.
%|
%| in
%| fit strum initialized by de_ftab_fit()
%| s1 [N... |
github | alcu/sms-master | de_ftab_build.m | .m | sms-master/irt/ct/de_ftab_build.m | 11,228 | utf_8 | 017c31c1d3d24911075b6a2f976f01cf | function ftab = de_ftab_build(s_arg, varargin)
%function ftab = de_ftab_build(s_arg, [options])
%
% For multiple-kVp X-ray imaging, we must evaluate functions f_m(s_1, ..., s_L)
% for m=1,..,M, where M is the number of kVp settings,
% and L is the number of material components.
% f_m(s1, s2) = -log( \int exp(- (m1(E) ... |
github | alcu/sms-master | xray_read_mac.m | .m | sms-master/irt/ct/xray_read_mac.m | 5,446 | utf_8 | c7868b3e61c185c8d7add22af131a225 | function mas = xray_read_mac(mtype, varargin)
%function mas = xray_read_mac(mtype, [options])
%|
%| Read mass attenuation coefficients for a given material type.
%| Returns a strum that can interpolate onto desired energies.
%|
%| in
%| mtype 'aluminum', 'copper', 2, '2', '02-helium', ...
%| See xray_material_file... |
github | alcu/sms-master | de_poly_expo.m | .m | sms-master/irt/ct/de_poly_expo.m | 1,207 | utf_8 | 90567cd293ec809e938c07f440cce758 | function expo = de_poly_expo(MM, varargin)
%|function expo = de_poly_expo(MM, [option])
%|
%| Generate exponents for multi-dimensional polynomials with terms:
%| x[n,1]^expo(k,1) * ... * x[n,M]^expo(k,M)
%|
%| in
%| MM dimension of polynomial
%|
%| option
%| 'emax' [1]|[M] maximum exponent of any given term. defau... |
github | alcu/sms-master | xray_read_spectra.m | .m | sms-master/irt/ct/xray_read_spectra.m | 7,747 | utf_8 | f68215b987e79335c14ddcf4fad23e64 | function xrs = xray_read_spectra(stype, varargin)
%|function xrs = xray_read_spectra(stype, [options])
%|
%| Read X-ray spectra data and initialize a structure that describes "M"
%| piecewise constant polyenergetic X-ray spectra, where M=2 for dual-kVp case.
%|
%| in
%| stype char which spectrum model:
%| 'mono,6... |
github | alcu/sms-master | de_ftab_curv.m | .m | sms-master/irt/ct/de_ftab_curv.m | 14,816 | utf_8 | e874592210514959d859520d589746d7 | function fit = de_ftab_curv(fit, varargin)
%|function fit = de_ftab_curv(fit, [options])
%|
%| Augment a fitted DE BH function strum object
%| to also have curvature methods for LS (or WLS) data-fit term
%|
%| in
%| fit strum from de_ftab_fit (type: 'exp')
%|
%| option
%| 'ctype' char curvature type: (default: 'pre... |
github | alcu/sms-master | xray_read_atomic_mass.m | .m | sms-master/irt/ct/xray_read_atomic_mass.m | 1,836 | utf_8 | f67f2bb6eed6bee8d2af7f901633fb98 | function mass = xray_read_atomic_mass(mtype, varargin)
%function mass = xray_read_atomic_mass(mtype)
%
% Read atomic mass for a given material type.
%
% in
% mtype 'aluminum', 'copper', 2, '2', '02-helium', ...
% See xray_material_file_name.m
% (Optionally mtype can be a cell array of several materials.
% If s... |
github | alcu/sms-master | wls_simplex.m | .m | sms-master/irt/ct/wls_simplex.m | 6,659 | utf_8 | 95ecf3b342b9a3aef5504fc92b1f269e | function x = wls_simplex(A, y, Wh, x, varargin)
%function x = wls_simplex(A, y, Wh, x, [options])
%| min_x || Wh * (A x - y) ||^2 + reg || x ||^2
%| subject to simplex constraint: 0 <= x <= 1 and sum(x) = 1
%|
%| based on:
%| x = lsqlin(C,d,A,b,Aeq,beq) solves the least-squares
%| (with equality constraints) problem:
... |
github | alcu/sms-master | de_ftab_s_iter.m | .m | sms-master/irt/ct/de_ftab_s_iter.m | 6,014 | utf_8 | 2a45f5d4a55f9a4a9d1f0fe1a91fee78 | function sh = de_ftab_s_iter(fit, fh, varargin)
%|function sh = de_ftab_s_iter(fit, fh, [options])
%| estimate s from fh by iterative LS
%| sh = argmin{s} | fh - fm(s) |^2
%| in
%| fit from de_ftab_fit() / de_ftab_curv()
%| fh [(Nd) M] estimates of f (nonlinear BH function)
%| option
%| 'niter' # of iterations (d... |
github | alcu/sms-master | de_ftab_sls.m | .m | sms-master/irt/ct/de_ftab_sls.m | 2,249 | utf_8 | 5a5a95c79fae0b00584e54b9b7770fe7 | function sls = de_ftab_sls(varargin)
%function sls = de_ftab_sls(varargin)
%|
%| Determine structure that characterizes the "s" limits for polyenergetic CT,
%| where s_l is a line integral through the lth material type, l=1...L.
%| L is the number of material components.
%|
%| in
%| option
%| 'sl' cell{LL} sample thic... |
github | alcu/sms-master | xray_read_atten.m | .m | sms-master/irt/ct/xray_read_atten.m | 3,340 | utf_8 | b823165093a8395f91f9ee6ca7229c22 | function [mass_atten, kev, mtype, file] = ...
xray_read_atten(mtype, kev_in, varargin)
%|function [mass_atten, kev, mtype, file] = ...
%| xray_read_atten(mtype, kev_in, [options])
%|
%| Read mass attenuation coefficients for a given material type.
%| Optionally interpolate onto desired energies.
%|
%| in
%| mtype... |
github | alcu/sms-master | xray_filters.m | .m | sms-master/irt/ct/xray_filters.m | 1,427 | utf_8 | 1762142abdcbbb337e06c8c14a1cad18 | function atten = xray_filters(mtype, thickness, energy, varargin)
%|function atten = xray_filters(mtype, thickness, energy, [options])
%|
%| Compute X-ray photon survival probability as a function of energy
%| for various materials.
%| in
%| mtype 'aluminum', 'copper', ...
%| can be a cell array {L} for multiple... |
github | alcu/sms-master | xray_material_file_name.m | .m | sms-master/irt/ct/xray_material_file_name.m | 3,628 | utf_8 | 2f4c215a9a0a976fc46b6685999d0d95 | function file = xray_material_file_name(name, varargin)
%|function file = xray_material_file_name(name, [options])
%| given name of an element, such as '01' or '01-hydrogen' or 'hydrogen',
%| or of a material such as 'water', determine the full file name for the
%| mass attenuation coefficient data for that material.... |
github | alcu/sms-master | element_density.m | .m | sms-master/irt/ct/element_density.m | 3,739 | utf_8 | 79eed16aa31d6c83d447827a9848069d | function rho = element_density(elem)
%function rho = element_density(elem)
% density of an element (in g/cc)
if ~nargin, help(mfilename), error(mfilename), return, end
% http://environmentalchemistry.com/yogi/periodic/density.html
% awk '{print $5, $4, $3, $1, $2}' < tt | sort -n > element_density.m
all = load;
if... |
github | alcu/sms-master | de_ftab_fit.m | .m | sms-master/irt/ct/arch/de_ftab_fit.m | 18,704 | utf_8 | f2d651baee92913be079496c9769c695 | function fit = de_ftab_fit(sl, fm, varargin)
%|function fit = de_ftab_fit(sl, fm, [options])
%|
%| Fit to DE table fm(), suitable for subsequent interpolation / extrapolation.
%| Uses either classic polynomial basis functions,
%| or an experimental exponential model -log(sum_k p_k exp(-m_k . s))
%|
%| in
%| sl {L} s... |
github | alcu/sms-master | de_ftab_fit_exp3.m | .m | sms-master/irt/ct/arch/de_ftab_fit_exp3.m | 9,346 | utf_8 | c6d2f8c10b786633054e3131340a7e1b | function fit = de_ftab_fit_exp3(xrs, mac, varargin)
%|function fit = de_ftab_fit_exp3(xrs, mac, [options])
%|
%| Fit to DE table fm(), suitable for subsequent interpolation / extrapolation.
%| Uses a special experimental exponential model:
% todo -log(sum_k p_k exp(-m_k . s))
% fit a 3-term exponential model that has... |
github | alcu/sms-master | cbct_back.m | .m | sms-master/irt/mex/src/fdk/fdk-cuda-new/cbct_back.m | 6,484 | utf_8 | 2fd0dde957137e658a658ae25f804021 | function back = cbct_back(proj, cg, ig, varargin)
% function back = cbct_back(proj, cg, ig, varargin)
%|
%| cone-beam backprojector for feldkamp.m
%| in
%| proj [ns nt na] cone-beam projection views
%| option
%| 'use_mex' 1|2|3 default: 1 mex with loop in mex
%| 2 mex with loop in matlab
%| 3 mex st
%| 0... |
github | alcu/sms-master | montager.m | .m | sms-master/irt/graph/montager.m | 1,780 | utf_8 | 7d765655b025c1ad0beb96a35e150810 | function xo = montager(xi, varargin)
%|function xo = montager(xi, varargin)
%|
%| Make montage or mosaic of set of images.
%|
%| in
%| xi [3d or 4d] set of images
%|
%| options
%| 'col' # of cols
%| 'row' # of rows
%| 'aspect' aspect ratio (default 1.2)
%| 'byte' if 1, convert each slice to [0,255]
%|
%| out
%| xo... |
github | alcu/sms-master | slicer3.m | .m | sms-master/irt/graph/slicer3.m | 1,429 | utf_8 | f975ace030ccb2102007d5c425a50c64 | function slicer3(vol, varargin)
%function slicer3(vol, varargin)
% show transaxial, coronal, and saggital slices of a 3D volume
% in
% vol [nx,ny,nz] 3d image volume
% option
% 'how' 'c|cent|center|max'
% 'args' {} for im(..., args{:})
% 'clim' [2] color limits
%
% Copyright 2007-1-28, Jeff Fessler, The Universit... |
github | alcu/sms-master | cbar.m | .m | sms-master/irt/graph/cbar.m | 5,237 | utf_8 | fc812f5aed826ebdcd562582f7bfdd7b | function hh = cbar(varargin)
%|function hh = cbar(varargin)
%|
%| colorbar with options
%| 'h' 'horiz' horizontal
%| 'v' 'vert' vertical
%| 'below' horizontal colorbar below current plot (jf)
%| 'hide' make room for it, but hide it (invisible)
%| 'fSIZE' font size
%| 1d-array ytick
%| 'notick' disable tick marks
%... |
github | alcu/sms-master | plot_cell.m | .m | sms-master/irt/graph/plot_cell.m | 1,153 | utf_8 | acf0db5e9bedf045c43bb285f3dd86ca | function plot_cell(xc, yc, types, varargin)
%function plot_cell(xc, yc, types, varargin)
% plot several "y" curves against x curve(s)
% in:
% xc {N} or 1 cell array of x points
% or a single vector if all x's are the same
% yc {N} cell array of y points
% types {N} cell array of line types
% options:
% 'use', fu... |
github | alcu/sms-master | xaxis_pi.m | .m | sms-master/irt/graph/xaxis_pi.m | 2,131 | utf_8 | 3097d5b44a524ba59f91e4aafbbb1a7a | function xaxis_pi(varargin)
%|function xaxis_pi(varargin)
%| label x axis with various forms of "pi"
%| the argument can be a string with p's in it, or fractions of pi:
%| [0 1/2 1] or '0 p/2 p' -> [0 pi/2 pi]
%| [-1 0 1] or '-p 0 p' -> [-pi 0 pi]
%| etc.
%|
%| There is one catch: this changes the axes font, so subse... |
github | alcu/sms-master | ir_mid3_pic1.m | .m | sms-master/irt/graph/ir_mid3_pic1.m | 1,176 | utf_8 | c22b031aaa78567cc68ae307d3018ec5 | function b = ir_mid3_pic1(x, file, varargin)
%|function b = ir_mid3_pic1(x, file, varargin)
%|
%| write 'mid3' type picture to .png file
%|
%| in
%| x [nx ny nz] 3D image
%| file char file name
%|
%| option
%| 'clim' display limit, default [800 1200]
%|
%| out
%| b [nx+nz ny+nz] 2D 'mid3' image, uint8
%|
%| 2012-1... |
github | alcu/sms-master | plot_ellipse.m | .m | sms-master/irt/graph/plot_ellipse.m | 1,048 | utf_8 | 2d49c04f3121cc0bb1ff3280612b457b | function [xo, yo] = plot_ellipse(cx, cy, rx, ry, theta, varargin)
%|function [xo, yo] = plot_ellipse(cx, cy, rx, ry, theta, [options])
%| plot an ellipse
%| option
%| 'n' # of points for half of ellipse. default: 301
%| 'c' line type. default: 'b-'
%| 'hold' 1|0 if 1, then add to current plot. default: 0
if nar... |
github | alcu/sms-master | axis_pipi.m | .m | sms-master/irt/graph/axis_pipi.m | 1,940 | utf_8 | d7dbe94c3e8c055ee8bbf49737d16df9 | function axis_pipi(varargin)
%function axis_pipi(['set',] xo, yo, omx, omy)
% label x and y axes from -pi to pi for 2D DSFT
if nargin <= 1
% trick: axes labels must *precede* the symbol font below
xlabelf '\omega_X'
ylabelf '\omega_Y'
if nargin == 1
if streq(varargin{1}, 'set')
axis([-pi pi -pi pi])
else
... |
github | alcu/sms-master | savefig.m | .m | sms-master/irt/graph/savefig.m | 3,768 | utf_8 | 05b3efa28e6d4991f8dde1fb8f2ef2a3 | function savefig(varargin)
%|function savefig([rootdir,] base, ['c'])
%|
%| save current figure to eps file rootdir/base.eps with prompting.
%|
%| options:
%| 'eps_c' save to color .eps file without inverting!
%| 'cw' color .eps file for use in white paper
%| 'c' save both color and b/w files (for talks)
%| name.eps... |
github | alcu/sms-master | jpg_write.m | .m | sms-master/irt/graph/jpg_write.m | 898 | utf_8 | 2ec215dcac320f380bff814c62d09c54 | function jpg_write(x, file, varargin)
%function jpg_write(x, file, varargin)
arg.clim = [];
arg.qual = 99;
arg = vararg_pair(arg, varargin);
if isempty(arg.clim)
arg.clim = minmax(x);
end
x = floor(255*(x-arg.clim(1))/(arg.clim(2)-arg.clim(1)));
x = max(x,0);
x = min(x,255);
x = uint8(x);
x = x.';
file = file_ch... |
github | alcu/sms-master | xtick.m | .m | sms-master/irt/graph/xtick.m | 482 | utf_8 | cf4f7a0e298bed9f6e9808cbf5baafd2 | function xtick(arg)
%|function xtick(arg)
%| set axis xticks to just end points
if ~nargin
lim = get(gca, 'xlim');
if lim(1) == -lim(2)
lim = [lim(1) 0 lim(2)];
end
set(gca, 'xtick', lim)
elseif nargin == 1
if ischar(arg)
switch arg
case 'off'
set(gca, 'xtick', [])
set(gca, 'xticklabel', [])
case ... |
github | alcu/sms-master | jf_mip3.m | .m | sms-master/irt/graph/jf_mip3.m | 1,511 | utf_8 | ee392bfcbeae0ee1437753a1d74904a1 | function out = jf_mip3(vol, varargin)
%|function out = jf_mip3(vol, varargin)
%|
%| create a MIP (maximum intensity projection) mosaic from a 3D volume
%| in
%| vol [] [nx ny nz] 3d
%| option
%| 'show' bool default: 1 if no output, 0 else
%| 'type' char 'mip' (default) | 'sum' | 'mid'
%| out
%| out [] [nx+nz ny+nz]... |
github | alcu/sms-master | subplot_stack.m | .m | sms-master/irt/graph/subplot_stack.m | 1,234 | utf_8 | 6dcbddc72113c147761f32a84178c3af | function subplot_stack(x, ys, str_title, colors)
%function subplot_stack(x, ys, str_title, colors)
% a tight stack of subplots to show L signal components
% in
% x [N,1]
% ys [N,L] or ?
if nargin == 1 && streq(x, 'test'), subplot_stack_test, return, end
if nargin < 2, help(mfilename), error(mfilename), end
if ~isvar... |
github | alcu/sms-master | movie2.m | .m | sms-master/irt/graph/movie2.m | 2,123 | utf_8 | cbbaf61f83e762896df3850e8d12ae20 | function [mov avi] = movie2(x, varargin)
%|function [mov avi] = movie2(x, [options])
%| in
%| x [nx ny nz] sequence of 2d frames
%| option
%| clim "color" limits default: minmax(x)
%| file name of avi file default: [test_dir 'tmp.avi']
%| cmap colormap default: gray(256)
%| fps frames per second in avifile defau... |
github | alcu/sms-master | yaxis_pi.m | .m | sms-master/irt/graph/yaxis_pi.m | 1,198 | utf_8 | bc198c4db6050dc1aeb010bb1d1a9daf | function yaxis_pi(varargin)
%function yaxis_pi(varargin)
% label y axis with various forms of "pi"
% the argument can be a string with p's in it, or fractions of pi:
% [0 1/2 1] or '0 p/2 p' -> [0 pi/2 pi]
% [-1 0 1] or '-p 0 p' -> [-pi 0 pi]
% etc.
% Jeff Fessler
if length(varargin) == 0
ticks = '0 p';
elseif lengt... |
github | alcu/sms-master | jf_add_slider.m | .m | sms-master/irt/graph/jf_add_slider.m | 2,514 | utf_8 | 32b04674cb05784d80ffe4230a742c33 | function hs = jf_add_slider(varargin)
%|function hs = jf_add_slider([options])
%|
%| add a slider control to the current figure to enable interaction
%|
%| option
%| 'callback' @ (value,data{:}) function to call with
%| slider value [0,1] and data
%| 'pos' [l b w h] slider position
%| 'data' {} data to be pas... |
github | alcu/sms-master | jf_slicer.m | .m | sms-master/irt/graph/jf_slicer.m | 1,602 | utf_8 | cf7941ddd62cf64992da209a39ca95cf | function jf_slicer(data, varargin)
%|function jf_slicer(data, [options])
%|
%| slice 3d data interactively (along 3rd dimension)
%| uses scroll wheel to sweep through all slices
%|
%| in
%| data [nx ny nz]
%|
%| options
%| clim [1 2] clim arg to im()
%| iz [1] initial slice (default: nz/2+1)
%|
%| Jeff Fessler, Uni... |
github | alcu/sms-master | label.m | .m | sms-master/irt/graph/label.m | 654 | utf_8 | 6ae74a9fa1ebfb4616a56849758663e3 | function label(varargin)
% usage:
% label x string
% label y string
% label tex ... todo
narg = length(varargin);
if narg < 2
error 'need x or y'
end
props = {'interpreter', 'none'};
if streq(varargin{1}, 'x')
arg2 = varargin{2};
xlabel(arg2, props{:})
elseif streq(varargin{1}, 'y')
arg2 = varargin{2};
ylabel... |
github | alcu/sms-master | fig_text.m | .m | sms-master/irt/graph/fig_text.m | 1,398 | utf_8 | 20a59fa6097354c841c2f7e7fbf80e9b | function hh = fig_text(varargin)
%|function hh = fig_text(...)
%| add text to figure, using coordinates relative to entire window
%| options:
%| '-date' prepend date
%| '-tex' tex parse string
%| x,y coordinates relative to [0 0 1 1]
%| {args} style arguments for text() command
%| jeff fessler
comment = '';
thed... |
github | alcu/sms-master | im_toggle.m | .m | sms-master/irt/graph/im_toggle.m | 2,842 | utf_8 | 3022ce0ead91537f182eaaf6b28645cf | function im_toggle(i1, i2, varargin)
%|function im_toggle(i1, i2, [..., options for im()])
%|
%| toggle between two or more images via keypress (octave) or click (matlab)
%|
%| Jeff Fessler
if nargin == 1 && streq(i1, 'test'), im_toggle_test, return, end
if nargin < 2, help(mfilename), error(mfilename), end
% find ... |
github | alcu/sms-master | texts.m | .m | sms-master/irt/graph/texts.m | 1,230 | utf_8 | cdf8c0ae73c9b136194966f0a36c2b84 | function ho = texts(x, y, str, varargin)
%function ho = texts(x, y, str [, center], options)
% put text on current plot using screen coordinates
% user can supply optional name/value object properties.
% for horizontalalign, only the value is needed (e.g., 'center')
% if it is the first option.
if nargin == 1 && str... |
github | alcu/sms-master | im.m | .m | sms-master/irt/graph/im.m | 14,464 | utf_8 | 13bb0975664e359f13fb4d442549f48c | function h = im(varargin)
%|function h = im([options,] [xx,] [yy,] zz, [scale|clim,] [title])
%| show matrix zz as an image, possibly with (x,y) axes labeled by xx,yy
%|
%| options:
%| subplot an integer for subplot
%| 'notick' no axis tick marks
%| 'black0' make sure image value of 0 is black (max white)
%| 'blue0'... |
github | alcu/sms-master | spsp_Af.m | .m | sms-master/irt/mri-rf/yip-spsp/spsp_Af.m | 1,639 | utf_8 | 504191d7eeea1c651ea7e7ef09940377 | function ob = spsp_Af(z, f, kz, kf, tsp, fovf, fovz, varargin)
%function ob = spsp_Af(z, f, kz, kf, tsp, fovf, fovz, varargin)
%
% input
% z : Nz by 1 vector (cm)
% f : Nf by 1 vector (Hz)
% kz, kf : M by 1 vector
% tsp : sampling time of RF pulse in sec
% Construct spsp_Af object
%
% This one calls the fast project... |
github | alcu/sms-master | example_spsp_param1.m | .m | sms-master/irt/mri-rf/yip-spsp/example_spsp_param1.m | 8,659 | utf_8 | 74f874aab784bd156feb48b9c31b77e7 | function [kp, iop, rfp] = example_spsp_param1()
%function [kp, iop, rfp] = example_spsp_param1()
% setup parameters for spectral-spatial pulse design.
%
%Chun-yu Yip, 4/7/09
kp = kparametersSPSP(); % k-space trajectory parameters
iop = ioparametersSPSP(); % input/ouput parameters
rfp = r... |
github | alcu/sms-master | Gmri_SENSE.m | .m | sms-master/irt/contrib/grissom-mri-rf-large-tip/Gmri_SENSE.m | 13,940 | utf_8 | 03d2bb644bb05419ad4119ca4d97e934 | function ob = Gmri_SENSE(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 or off-resonan... |
github | alcu/sms-master | Gocrf.m | .m | sms-master/irt/contrib/grissom-mri-rf-large-tip/Gocrf.m | 20,881 | utf_8 | 23e5c23dc5a317fd86e441ff0a6a4faf | function [ob,m,mz] = Gocrf(k,fov,N,mdomswitch,dt,varargin)
% function [ob,m,mz] = Gocrf(k,fov,N,m0,mdomswitch,dt,varargin)
%
% Construct Gocrf object for fast optimal control large-tip-angle
% multidimensional (and parallel) MR RF pulse design. Used in
% conjunction with an optimization routine, this object can be
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.