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
ndwork/dworkLib-master
ifftshift2.m
.m
dworkLib-master/ifftshift2.m
670
utf_8
503d6e6cda162eb7dc9d1d2b1129edfa
function out = ifftshift2( in ) % out = ifftshift2( in ) % % Performs ifftshift on the first two dimensions of in % % Inputs: % in - input array of at least two dimensions % % Outputs: % out - output array % % Written by Nicholas Dwork - Copyright 2021 % % This software is offered under the G...
github
ndwork/dworkLib-master
wavShow.m
.m
dworkLib-master/wavShow.m
1,903
utf_8
fe9546a41f5972034dc5242cd9faa94d
function imH = wavShow( wt, varargin ) % imH = wavShow( wt [, scale, 'wavSplit', wavSplit, 'range', range ] ); % % shows the wavelet transform with individual scaling of each portion for % improved viewing % % Inputs: % img - 2D array representing the wavelet transform of the image % % Optional Input...
github
ndwork/dworkLib-master
plotTriangles.m
.m
dworkLib-master/plotTriangles.m
1,436
utf_8
df1146902759e65046b07e9228b9479c
function figure = plotTriangles( triangles ) % figure = plotTriangles( triangles ) % creates shown 3D figure from given triangles % % Inputs: % triangles - 3D array of size 3 x 3 x nTriangles % % Outputs: % figure - 3D figure of polyhedron with triangle faces made from given % triangle vert...
github
ndwork/dworkLib-master
alignDicoms.m
.m
dworkLib-master/alignDicoms.m
5,602
utf_8
a954da3f1e4adb40bc59f332bfa09df9
function [out1,out2] = alignDicoms( in1, in2, varargin ) % [out1,out2] = alignDicoms( in1, in2 [, info1, info2 ] ) % % Shifts and scales in2 to align it with in1 % % Inputs: % in1 - either an image array or a character array specifying a dicom filename or a directory % containing dicom files % in...
github
ndwork/dworkLib-master
homographyFromPts3D.m
.m
dworkLib-master/homographyFromPts3D.m
1,239
utf_8
7dbaa21c182b7b1c566a307e01996dae
function H = homographyFromPts3D( pts1, pts2 ) % H = homographyFromPts3D( pts1, pts2 ) % % Determine the homography that projects pts1 onto pts2 with the Direct % Linear Transformation. % % Written by Nicholas Dwork - Copyright 2016 % % This software is offered under the GNU General Public License 3....
github
ndwork/dworkLib-master
snrFromMagnitude.m
.m
dworkLib-master/snrFromMagnitude.m
1,628
utf_8
1964c98f5cabd0e83c78462f25dd72ec
function snr = snrFromMagnitude( in, noiseCoords ) % snr = snrFromMagnitude( in, noiseCoords ) % % Calculates the SNR of the underlying complex data with Guassian additive noise % from the magnitude data according to "The Rician Distribution of Noisy MRI Data" % by Gudbjartsson and Patz % % Inputs: % i...
github
ndwork/dworkLib-master
downsample2.m
.m
dworkLib-master/downsample2.m
1,300
utf_8
369c6267c6b9e07d806671024e833e68
function out = downsample2( img, D, varargin ) % out = downsample2( img, D [, 'S', S ] ) % Implements the adjoint of upsample2 % % Inputs: % img - two dimensional array % D - downsample factor. Either a scalar (assuming same factor in both dimensions) % or an array with two elements (one for each di...
github
ndwork/dworkLib-master
inplaceImg.m
.m
dworkLib-master/inplaceImg.m
2,868
utf_8
3b9b919684e82a5a871524d732b51792
function outImg = inplaceImg( subImg, nSubRows, nSubCols, subIndx, varargin ) % outImg = inplaceImg( subImg, nSubRows, nSubCols, subIndx [, inImg, ... % 'order', order, 'border', border, 'borderValue', borderValue ] ) % % Inputs: % subImg - the image to be put into the out image % nSubRows - the number o...
github
ndwork/dworkLib-master
rect.m
.m
dworkLib-master/rect.m
731
utf_8
9df45bfcbb503f9cd172042d8e88935c
function out = rect( x, a ) % out = rect( x, a ) % % outputs rect( x / a ); % % Inputs: % x - array of unscaled domain values % a - either a scalar or array same size as x % % Outputs: % out - array of rect values the same size as x % % Written by Nicholas Dwork - Copyright 2021 % % https:/...
github
ndwork/dworkLib-master
sigmoid.m
.m
dworkLib-master/sigmoid.m
405
utf_8
4a39ddd6f32fbd713042b11da4a0fc1c
function out = sigmoid( x ) % out = sigmoid( x ) % % Inputs: % A scalar or array % % Written by Nicholas - Copyright 2017 % % This software is offered under the GNU General Public License 3.0. It % is offered without any warranty expressed or implied, including the % implied warranties of merchant...
github
ndwork/dworkLib-master
normalizePts2D.m
.m
dworkLib-master/normalizePts2D.m
717
utf_8
0aa3b3ddc53f1bfd3831407e178cab6c
function [newPts,T] = normalizePts2D( pts ) % Inputs: % pts - 2D array of size Nx2 where N is the number of points % First/second column is x/y locations % % Outputs: % newPts - pts scaled and translated so that centroid is at 0 and average % distance from center is sqrt(2) % % Written by Nichola...
github
ndwork/dworkLib-master
totalVariation.m
.m
dworkLib-master/totalVariation.m
605
utf_8
54d1a325260ce661479c4586b9af59f8
function out = totalVariation( in ) % out = totalVariation( in ) % % Computes the L2L1 norm (the total variation) of in. % % Written by Nicholas Dwork - Copyright 2021 % % This software is offered under the GNU General Public License 3.0. It % is offered without any warranty expressed or implied, incl...
github
ndwork/dworkLib-master
poissonDisc2.m
.m
dworkLib-master/poissonDisc2.m
11,903
utf_8
9909691d67edbcb80bb41800f08feae3
function pts = poissonDisc2( r, varargin ) % pts = poissonDisc2( r [, 'bounds', bounds, 'bIncSize', bIncSize, 'nK', nK, ... % 'incSize', incSize, 'min_r', min_r ] ) % % For scalar (constant) r, the algorithm implemented is "Fast Poisson Disk Sampling in % Arbitrary Dimensions" by Robert Bridson and for a v...
github
ndwork/dworkLib-master
makeLowFreqWavMask.m
.m
dworkLib-master/makeLowFreqWavMask.m
1,774
utf_8
38ab6012c10f3c0d2eb25c5e38f3fe7b
function mask = makeLowFreqWavMask( sImg, varargin ) % mask = makeLowFreqWavMask( sImg [, split ] ) % % make an array of size sImg with 1s only in the lowest frequency bins of the wavelet transform % with recursion specified by split % % Inputs: % sImg - two element array specifying the size of the image...
github
ndwork/dworkLib-master
wavFusion.m
.m
dworkLib-master/wavFusion.m
1,050
utf_8
a9187dbf6d18f765e407b14241152956
function fused = wavFusion( cImg, mImg ) % fused = wavFusion( cImg, mImg ) % % Inputs: % cImg - color or monochrome image % mImg - monochrome image % % Written by Nicholas Dwork - Copyright 2016 % % This software is offered under the GNU General Public License 3.0. It % is offered without any warr...
github
ndwork/dworkLib-master
scatternice.m
.m
dworkLib-master/scatternice.m
1,386
utf_8
f290b9e8d86edfad06cfbca24c9532ed
function out = scatternice( in1, in2, varargin ) % scatternice( in1 [, in2, 'ax', ax, options ] ) % % Inputs: % in1 - domain values to plot % in2 - range values to plot % % Optional Inputs: % ax - the axis to plot onto (used with subplot) % options - all optional arguments that plot accepts ...
github
ndwork/dworkLib-master
wavScale.m
.m
dworkLib-master/wavScale.m
2,148
utf_8
b0b89c2a4ede9ed3bb28b9b0ec99b55e
function out = wavScale( wt, wavSplit, varargin ) % out = wavScale( wt, wavSplit [, 'range', range ] ); % % Applies scaleImg to each bin of the wavelet transform individually. % % Written by Nicholas Dwork - Copyright 2019 % % https://github.com/ndwork/dworkLib.git % % This software is offered under ...
github
ndwork/dworkLib-master
mse.m
.m
dworkLib-master/mse.m
762
utf_8
8eb916e4d845289b0b414b559db4154a
function out = mse( est, true ) % Calculates the mean squared error of an estimate % % out = mse( est, true ) % % Inputs: % est - the array of estimate values % true - an array of the same size as est that represents the correct values % % Outputs: % out - the mean square error value % % Writte...
github
ndwork/dworkLib-master
mri_findErnstAngle.m
.m
dworkLib-master/mri_findErnstAngle.m
828
utf_8
0282cfd32b5ff4d24d179882a5515fb3
function out = mri_findErnstAngle( T1, TR ) % out = mri_findErnstAngle( T1, TR ) % The Ernst angle is the angle for maximum signal of a GRE spoiled sequence % See Ernst RR, Anderson WA. Application of Fourier transform spectroscopy to magnetic resonance. % Rev Sci Instrum 1966; 37:93-102. % % Inputs: ...
github
ndwork/dworkLib-master
searchStruct.m
.m
dworkLib-master/searchStruct.m
3,356
utf_8
9a0ce9b525970d14275e22b40fc913a2
function matches = searchStruct( in, el2Match, varargin ) % matches = searchStruct( in, el2Match [, type ] ) % % Inputs: % in - the input struct % el2Match - the element to match % If el2Match is a string, then it searches the field names. % If el2Match is numeric, then it searches the values % %...
github
ndwork/dworkLib-master
pickRandomSubset.m
.m
dworkLib-master/pickRandomSubset.m
1,058
utf_8
d5402e8a654529078d7d2648cd0c4b6e
function [ subset, complement ] = pickRandomSubset( set, nSubset ) % [ subset, complement ] = pickRandomSubset( set, nSubset ) % % Picks a random subset from a set (and possibly identifies its complement) % % Inputs: % set - an array that is the set to select from % nSubset - the number of elements in t...
github
ndwork/dworkLib-master
whitenData.m
.m
dworkLib-master/whitenData.m
1,723
utf_8
000d611f997d924baf726e09524ba4e3
function out = whitenData( data, covMatrix, varargin ) % out = whitenData( data, covMatrix [, type ] ) % % Assumes data is zero mean % % Inputs: % data - a multidimensional array; it is assumed that the last dimension % is the random vector dimension % covMatrix - a covariance matrix % % Optional...
github
ndwork/dworkLib-master
mri_reconRoemer.m
.m
dworkLib-master/mri_reconRoemer.m
1,202
utf_8
c8765a560204d876ddfa57a01ce392d0
function [recon,sMaps] = mri_reconRoemer( coilRecons, varargin ) % [recon,sMaps] = mri_reconRoemer( coilRecons ) % % Perform an optimal coil combination according to equation [32] of % "NMR Phased Array" by Roemer et al. % % Inputs: % coilRecons is an array of size ( Ny, Nx, ..., nCoils ) of kSpace value...
github
ndwork/dworkLib-master
shearImg.m
.m
dworkLib-master/shearImg.m
1,033
utf_8
6bdcf21da24eecd9f9b931913a8a2a5b
function out = shearImg( in, theta, dim ) % out = shearImg( in, theta [, dim] ) % % shears the image along dimension dim % % Inputs: % in - 2D array % theta - rotation angle in radians % % Optional Inputs: % dim - index of dimension to shear % % Written by Nicholas Dwork - Copyright 2016 % ...
github
ndwork/dworkLib-master
findColorChannelWeights.m
.m
dworkLib-master/findColorChannelWeights.m
980
utf_8
88f1534f0fb711b902b94815c54f49c0
function w = findColorChannelWeights( M, C, varargin ) % w = findColorChannelWeights( M, C [, 'objective', objective ] ) % % Find w such that M = sum w(i) * C(:,:,i) % % Inputs: % M - monochrome image % C - color image % % Optional Inputs: % objective - either 'L2' or 'L1' % % Written by Nichol...
github
ndwork/dworkLib-master
epgGrad.m
.m
dworkLib-master/epgGrad.m
589
utf_8
47060c12c9f3d42aa2df75529505f7cb
function Qout = epgGrad( Qin, n ) % Qin is an 3xN array representing the magnetization state % The rows are F+, F-, and Z % N is the number of Fourier coefficients to store % n is 1 / -1 for a positive / negative gradient Qout = Qin; if abs(n)~=1, error('n must be 1 or -1'); end; if n>0 Qout(1,...
github
ndwork/dworkLib-master
proxConjL2L1.m
.m
dworkLib-master/proxConjL2L1.m
992
utf_8
db7d39bfba64fff859ad1d0559bda650
function out = proxConjL2L1( x, sigma, t ) % out = proxConjL2L1( x, sigma, t ) % % Calculates the proximal operator of sigma times the conjugate % of f(x) = t * L2L1( x ) % % Inputs: % x - an N Dimensional array where the last dimension represents the groups % sigma - scaling of proximal operator % t...
github
ndwork/dworkLib-master
lsqrTikhonov.m
.m
dworkLib-master/lsqrTikhonov.m
1,451
utf_8
e3b7ae4d52ba2983661aeddbdf131565
function out = lsqrTikhonov( A, b, gamma, varargin ) % out = lsqrTikhonov( A, b, gamma ) % % Uses lsqr to solve the following optimization problem: % minimize || A x - b ||_2^2 + gamma || x ||_2^2 % % Inputs: % A - matrix % b - vector % gamma - scalar regularization paramter % All inputs accepted b...
github
ndwork/dworkLib-master
findRotWithPCC.m
.m
dworkLib-master/findRotWithPCC.m
1,417
utf_8
dfa3ce4a155f45829f2f882c04f33014
function rotation = findRotWithPCC( img1, img2, varargin ) % rotation = findRotWithPCC( img1, img2 [, 'dTheta', dTheta] ) % Note: rotation must be -pi/2 and pi/2 % % Inputs: % dTheta - resolution of rotation angle (default is 1/180*pi radians) % % Output: % rotation - counterclockwise rotation to appl...
github
ndwork/dworkLib-master
ssim.m
.m
dworkLib-master/ssim.m
1,644
utf_8
fd0485f824c3d20794702a025aba9efd
function out = ssim( in1, in2, varargin ) % out = ssim( in1, in2 [, 'k1', k1, 'k2', k2, 'L', L ] ) % % Computes the structural similarity metric between inputs 1 and 2 according % to "Image Quality Assessment: From Error Visibility to Structural % Similarity" by Wang et al. % % Inputs: % in1 - the firs...
github
ndwork/dworkLib-master
nucNorm.m
.m
dworkLib-master/nucNorm.m
572
utf_8
4f96b52b34fb83adc415611954c8d665
function out = nucNorm( in ) % out = nucNorm( in ) % % Computes the nuclear norm of the input. The nuclear norm is the input % of the singular values of the matrix. % % Written by Nicholas Dwork - Copyright 2019 % % https://github.com/ndwork/dworkLib.git % % This software is offered under the GNU ...
github
ndwork/dworkLib-master
makeCoordinateImgs.m
.m
dworkLib-master/makeCoordinateImgs.m
701
utf_8
58cf79f749b7fdbcd0938e80e3238dac
function [xImg,yImg] = makeCoordinateImgs( sImg, center ) % makes an image where each point represents the distance from the center % % [xImg,yImg] = makeCoordinateImgs( sImg [, center] ) % % Inputs: % sImg - 2 element array specifying the (y,x) size of the image % center - 2 element array specifying the...
github
ndwork/dworkLib-master
withinTriangle.m
.m
dworkLib-master/withinTriangle.m
1,796
utf_8
9b926ab287010ae814f258e99a1b0bb2
function status = withinTriangle( triangle, p ) % status = withinTriangle( triangle, p ) % determines if a given number of points is within a triangle % % Inputs: % triangle - 2D array with 2 rows and n columns consisting of triangle % vertex coordinates % p - 2D array with 2 rows and n columns of poin...
github
ndwork/dworkLib-master
ispositive.m
.m
dworkLib-master/ispositive.m
609
utf_8
b7d8124cf8e42668927fa1c24a25d6f7
function out = ispositive( x ) % out = ispositive( x ) % % Inputs: % x - a scalar or array % % Output: % true if all elements of x are positive and false otherwise % % Written by Nicholas Dwork - Copyright 2019 % % https://github.com/ndwork/dworkLib.git % % This software is offered under the ...
github
ndwork/dworkLib-master
mri_gridRecon.m
.m
dworkLib-master/mri_gridRecon.m
1,200
utf_8
6f575f15b8a524ec87526f4c06f560f1
function recons = mri_gridRecon( kData, trajs, sImg, varargin ) % recons = mri_gridRecon( kData, trajs, sImg [, 'alpha', alpha, 'W', W, 'nC', nC, ... % 'weights', weights, 'verbose', verbose ] ) % % Performs a gridding recon for each coil % % Inputs: % kData - A complex N x C x D1 x D2 x ... x DN array...
github
ndwork/dworkLib-master
proxL2Sq.m
.m
dworkLib-master/proxL2Sq.m
1,358
utf_8
bbdf8086fe013e61459be59066bf6285
function out = proxL2Sq( v, t, b, A ) % out = proxL2Sq( v, t, b, A ) % % Evaluate the proximal operator of tf where f(x) = t/2 || A x - b ||_2^2 % % Inputs: % x - the argument of the proximal operator % Note: could be a scalar or multi-dimensional array % % Optional Inputs: % t - scaling of the...
github
ndwork/dworkLib-master
titlenice.m
.m
dworkLib-master/titlenice.m
706
utf_8
1dde6e04f29a75430f13706e0bd9cdcb
function titlenice( myTitle, varargin ) % titlenice( myTitle, varargin ) % % Inputs: % myTitle - String to name the graphic as well as the figure % % Optional Inputs: % varargin - all optional inputs accepted by title function % % Written by Nicholas Dwork - Copyright 2018 % % https://github.com/...
github
ndwork/dworkLib-master
columnize.m
.m
dworkLib-master/columnize.m
424
utf_8
a1b09143456b88721adf9c9b443fe06a
function out = columnize( in ) % Return in array as a column vector % % Written by Nicholas Dwork, Copyright 2021 % % https://github.com/ndwork/dworkLib.git % % This software is offered under the GNU General Public License 3.0. It % is offered without any warranty expressed or implied, including the ...
github
ndwork/dworkLib-master
pdhgAdaptive.m
.m
dworkLib-master/pdhgAdaptive.m
6,005
utf_8
24b61f4bec60e646ed4d88085bfd57e8
function [xStar,objValues] = pdhgAdaptive( x, proxf, proxgConj, tau, varargin ) % [xStar,objValues] = pdhgAdaptive( x, proxf, proxgConj, tau [, ... % 'alpha0', alpha0, 'eta', eta, 'Delta', Delta', 's', s, ... % adaptive variables % 'beta', beta', 'gamma', gamma, % backtracking parameters % 'A', A, 'f', ...
github
ndwork/dworkLib-master
movePointsToGrid.m
.m
dworkLib-master/movePointsToGrid.m
1,981
utf_8
6c5791e973c8249043fc253c99dbbbba
function [griddedPts,samples] = movePointsToGrid( pts, mins, maxs, Ns ) % [griddedPts,samples] = movePointsToGrid( pts, mins, maxs, Ns ) % % Moves points in an Real^N space to the points specified by grid % % Inputs: % pts - a NxM array (where M is the number of points) % mins - a 1D array of size N spec...
github
ndwork/dworkLib-master
denoiseTV.m
.m
dworkLib-master/denoiseTV.m
861
utf_8
e3a0082eec5f2d83607818f2854f723e
function [out,oValues] = denoiseTV( in, lambda, varargin ) % out = denoiseTV( in, lambda [, varargin ] ) % % perform total variation denoising on the input % % Inputs: % in - input array to be denoised % lambda - the regularization parameter % % Optional Inputs: % varargin - the same optional param...
github
ndwork/dworkLib-master
makeEllipticalImage.m
.m
dworkLib-master/makeEllipticalImage.m
1,486
utf_8
c31a34a3c1d71a6f753443d3ba131139
function out = makeEllipticalImage( sImg, varargin ) % out = makeEllipticalImage( sImg, [ rx, ry, rot ] ) % % Creates an elliptical image. The zero-levelset is where % x^2/rx + y^2/ry = 1 % % Inputs: % sImg - two element array specifying the size of the image [Ny,Nx] % rx - the length of the semimajo...
github
ndwork/dworkLib-master
findPeaks.m
.m
dworkLib-master/findPeaks.m
1,698
utf_8
2a00d43514ae12e357444ecf86dfd417
function corners = findPeaks( img, varargin ) % corners = findPeaksCorners( img [, N, 'buffer', buffer ] ) % % Inputs: % img - a 2D array % N - the number of features to identify (default is 50) % buffer - the minimum spacing between features (default is 20) % % Outputs: % corners - an Nx2 array. Th...
github
ndwork/dworkLib-master
plotBlandAltman.m
.m
dworkLib-master/plotBlandAltman.m
1,805
utf_8
21436ac1b661ab9c7520260a70709658
function plotBlandAltman( x, y, varargin ) % plotBlandAltman( x, y [, 'range', range ] ) % % Inputs: % x - array % y - array of same size as x % % Optional Inputs: % range - either 'nice' or an argument that is passed into axis command % By default, all data is shown % % Written by Nicholas Dwo...
github
ndwork/dworkLib-master
alignImagesWithHomography.m
.m
dworkLib-master/alignImagesWithHomography.m
1,075
utf_8
283ec1ed1df76773804357ccc8fd2f8e
function proj2 = alignImagesWithHomography( img1, img2, varargin ) % proj2 = alignVolumesWithHomography( img1, img2 [, distThresh] ) % % This function aligns img2 with img1 using a Homography. % The algorithm it employs is to: % - find features in img1 with Difference of Gaussians % - track features in...
github
ndwork/dworkLib-master
readOldMriDataOrgData.m
.m
dworkLib-master/readOldMriDataOrgData.m
876
utf_8
16533ce3e7174e851a9408019646d87f
function data = readOldMriDataOrgData(filenameBase) % function data = readReconData(filenameBase) % % Read in recon data stored in filenameBase.cfl (complex float) % based on dimensions stored in filenameBase.hdr. % Taken from old.mridata.org dims = readReconHeader( filenameBase ); filename = strcat(fi...
github
ndwork/dworkLib-master
volVectorProd.m
.m
dworkLib-master/volVectorProd.m
898
utf_8
ee075b25884b7794a767d3fd31b6bfc7
function out = volVectorProd( volume, vector, dim ) % This function performs a volume-vector product % % out = volVectorProd( volume, vector [, dim ] ) % % Inputs: % volume - an array % vector - a 1D array with number of elements equal to dimension of % vector product % % Optional Input: % dim ...
github
ndwork/dworkLib-master
stemnice.m
.m
dworkLib-master/stemnice.m
2,601
utf_8
40c68cb9e04c2728a1cabcc233051492
function out = stemnice( in1, varargin ) % out = stemnice( in1 [, in2, 'ax', ax, options ] ) % % Inputs: % in1 - 1D array to stem plot % in2 - if in2 is supplied, in1 are the domain values and in2 are the % range values % % Optional Inputs: % ax - the axis to plot onto (used with subplot) ...
github
ndwork/dworkLib-master
announceCompletion.m
.m
dworkLib-master/announceCompletion.m
1,829
utf_8
9585e8bb04d4a56fb6e285f2ab6bfbbc
function announceCompletion( varargin ) % announceCompletion( [ 'earlyTime', earlyTime, 'lateTime', lateTime ] ) % % This function makes an audible sound when the function is called. % Intended to be run at the end of the program to let you know it's done. % % Inputs: % earlyTime - specified as hh:mm 24 ...
github
ndwork/dworkLib-master
applyCT_2D.m
.m
dworkLib-master/applyCT_2D.m
1,719
utf_8
f5bea13ce1fdc7db0527837e4d0d2aa8
function out = applyCT_2D( f, domTraj, rangeTraj, kCy, kCx, Cy, Cx ) % out = applyCT_2D( f, domTraj, N, kCy, kCx, Cy, Cx ) % or % out = applyCT_2D( f, N, rangeTraj, kCy, kCx, Cy, Cx ) % or % out = applyCT_2D( f, domTraj, rangeTraj, kCy, kCx, Cy, Cx ) % % Applies a continuous circular convolution of a ker...
github
ndwork/dworkLib-master
proxL1Complex.m
.m
dworkLib-master/proxL1Complex.m
1,160
utf_8
370e2797ce47495734aaeac1c39b3520
function out = proxL1Complex( in, thresh, weights ) % out = proxL1Complex( in, thresh [, weights ] ) % % Returns the proximal operator of f(x) = thresh * L1( x ), where % x is a complex vector. % % Inputs: % in - an array of complex values % thresh - the thresholding value % % Optional Inputs: ...
github
ndwork/dworkLib-master
makeDftMatrix.m
.m
dworkLib-master/makeDftMatrix.m
1,173
utf_8
1d9be1cdb454750405e8721a42a1a294
% This software is offered under the GNU General Public License 3.0. It % is offered without any warranty expressed or implied, including the % implied warranties of merchantability or fitness for a particular % purpose. function out = makeDftMatrix( M, varargin ) % Make the (potentially non-square) DFT matrix o...
github
ndwork/dworkLib-master
proxConjNucNorm.m
.m
dworkLib-master/proxConjNucNorm.m
905
utf_8
67decd67c4df7071e72781ca91d6c5f7
function out = proxConjNucNorm( in, sigma, t ) % out = proxConjNucNorm( in, t ) % % Returns the proximal operator of the conjugate of f(X) = t || X ||_* % where X is the input matrix. % % Inputs: % in - an input matrix % t - the thresholding value % % Written by Nicholas Dwork - Copyright 2019 % ...
github
ndwork/dworkLib-master
calcErgasMetric.m
.m
dworkLib-master/calcErgasMetric.m
1,623
utf_8
c6f96ce20d9d0a0d352fec031c6b7fe4
function ergas = calcErgasMetric( color, monochrome, fused, varargin ) % ergas = calcErgasMetric( color, monochrome, fused, varargin ) % % Inputs: % color - an MxNx3 array, where the third dimension represents color % monochrome - an MxN array % fused - an MxNx3 array representing the fused image % % O...
github
ndwork/dworkLib-master
ctIRadon.m
.m
dworkLib-master/ctIRadon.m
3,298
utf_8
671599f34269894684db853ab8a956cb
function out = ctIRadon( sinogram, thetas, dSize, cx, cy, Nx, Ny, dx, dy, varargin ) % out = ctIRadon( sinogram, thetas, dSize, cx, cy, Nx, Ny, dx, dy [, ... % 'window', 'Hanning/none', 'type', 'iso/fast' ] ) % % Performs discrete inverse Radon transform with physical units of a Computed % Tomography...
github
ndwork/dworkLib-master
scaleImg.m
.m
dworkLib-master/scaleImg.m
2,664
utf_8
186d35b351283956d4d71d75a11f120f
function out = scaleImg( img, varargin ) % out = scaleImg( img [, outMinMax, inMinMax ] ) % % Function scaled image affinely so that inMinMax is scaled to outMinMax. % If img is complex, it scales the magnitude. % % Inputs: % outMinMax - 2 element array specifying output min and max % or an array fro...
github
ndwork/dworkLib-master
flipAboutIndx.m
.m
dworkLib-master/flipAboutIndx.m
974
utf_8
496386a9954108cff77e273a48b9504e
function out = flipAboutIndx( in, indx ) % out = flipAboutIndx( in, indx ) % % Flips the array in about the location of indx % % Inputs: % in - array (may be multi-dimensional) % indx - a 1D array specifying the index for each dimension of in % Note: if an element of indx is 0, the array is not flip...
github
ndwork/dworkLib-master
iGrid_2D.m
.m
dworkLib-master/iGrid_2D.m
2,680
utf_8
289194f9c4f2a061e3ddae521ca9ed5f
function F = iGrid_2D( data, traj, varargin ) % F = iGrid_2D( data, traj, [ 'alpha', alpha, 'W', W, 'nC', nC ] ) % % Inverse Gridding based on EE369C notes by John Pauly and Beatty et. al., IEEE TMI, 2005 % Definitions and details according to http://nicholasdwork.com/tutorials/dworkGridding.pdf % % Inputs...
github
ndwork/dworkLib-master
findFractionAboveValue.m
.m
dworkLib-master/findFractionAboveValue.m
157
utf_8
a03ca7342381bb86cac2ecb278c198af
function value = findFractionAboveValue( data, fraction ) error( 'This function has been deleted. Please use findValueBelowFraction instead.' ); end
github
ndwork/dworkLib-master
computeGradient.m
.m
dworkLib-master/computeGradient.m
1,807
utf_8
a5d089ec7a4b4de86a25763f9fad484b
function out = computeGradient( in, varargin ) % out = computeGradient( in [, op ] ] ) % % This function computes the gradient (or the derivative) of the input % with circular boundary conditions % % Inputs: % in - a multi-dimensional array % % Optional Inputs: % op - either 'transp' or 'notransp' ...
github
ndwork/dworkLib-master
rotateAndTranslateImg.m
.m
dworkLib-master/rotateAndTranslateImg.m
1,078
utf_8
bcf81303fc5383610b3266c0ec77653b
function out = rotateAndTranslateImg( R, t, img, varargin ) % out = rotateAndTranslateImg( R, t, img [, extrapVal] ) % % Inputs: % R - a 2x2 rotation matrix % t - a two element array specifying translation in pixels % img - a 2D array % % Optional Inputs: % extrapVal - value to put where extrapolatio...
github
ndwork/dworkLib-master
makeCrossProdMatrix.m
.m
dworkLib-master/makeCrossProdMatrix.m
658
utf_8
d4c8f43db64c6e5abe3842bf5790fdb1
function out = makeCrossProdMatrix( v ) % out = makeCrossProdMatrix( v ) % % makes the cross product matrix out so that cross(v,u) = out * u % % Inputs: % v - a 3 elements array % % Outputs: % out - a 3x3 matrix % % Written by Nicholas Dwork - Copyright 2016 % % This software is offered under...
github
ndwork/dworkLib-master
iwtHaar2.m
.m
dworkLib-master/iwtHaar2.m
2,481
utf_8
e48c76b5f933b4d3865a33f2ed45d501
function img = iwtHaar2( wt, varargin ) % img = iwtHaar2( wt[, split] ); % Performs an inverse Haar wavelet transform of an image % % Inputs: % img - 2D array representing the wavelet transform of the image % % Optional Inputs: % split - array specifying the number of levels of the wavelet transform. ...
github
ndwork/dworkLib-master
normalizePts3D.m
.m
dworkLib-master/normalizePts3D.m
791
utf_8
18827dbd4e0df1b7361e83af3fa03c73
function [newPts,T] = normalizePts3D( pts ) % Inputs: % pts - 2D array of size Nx3 where N is the number of points % First/second/third column is x/y/z locations % % Outputs: % newPts - pts scaled and translated so that centroid is at 0 and average % distance from center is sqrt(2) % % Written by...
github
ndwork/dworkLib-master
namePlottedPoints.m
.m
dworkLib-master/namePlottedPoints.m
1,531
utf_8
a0b80754aa9b321ec636954f6ada7c92
function namePlottedPoints( x, y, names, varargin ) % namePlottedPoints( x, y, names [, dx, dy, options ] ) % Names individual points in a plot; this function can be used with plot % or scatter. % % Inputs: % x - the domain values that were plotted % y - the range values that were plotted % names - a ...
github
ndwork/dworkLib-master
opticalFlow3D.m
.m
dworkLib-master/opticalFlow3D.m
14,906
utf_8
5a0d4b027af981556fe0bfb4bcfced12
function [du,dv,dw] = opticalFlow3D( data1, data2, varargin ) % [du,dv,dw] = opticalFlow3D( data1, data2 [, 'eta', eta, 'rho', rho ] ) % % Determines the Horn Schunck optical flow vectors using ADMM % % Inputs: % data1/data2 - 3D arrays. Optical flow vectors will point from voxels % in data1 to voxels...
github
ndwork/dworkLib-master
indicatorFunction.m
.m
dworkLib-master/indicatorFunction.m
885
utf_8
83f0bf9b69f5511eaf3497992782b488
function out = indicatorFunction( in, S ) % out = indicatorFunction( in, S ) % % outputs 0 if all the elments of the input are within S and Inf otherwise % % Inputs: % in - an array (of any size) % S - A two element array specifying the interval for the indicator function % If a single sided bound ...
github
ndwork/dworkLib-master
quarticRoots.m
.m
dworkLib-master/quarticRoots.m
2,403
utf_8
f172b01c0b21b5b4d926ae9f415da158
function roots = quarticRoots( poly, a, b, c, d ) % roots = quarticRoots( a, b, c, d, e ) or % roots = quarticRoots( b, c, d, e ) or % roots = quarticRoots( p ) % % Solves problems of the form: a x^4 + b x^3 + c x^2 + d x + e = 0 % Based on "An analytic solution to Wahba's problem" by Yang and Zhou % ...
github
ndwork/dworkLib-master
vecVolMatrixProd.m
.m
dworkLib-master/vecVolMatrixProd.m
689
utf_8
8d8b0215339962b33ff7cb81a53fd6f3
function out = vecVolMatrixProd( vec, vol ) % Each slice of vol is a matrix that will be left multiplied a row vector % % Inputs: % vec - an 1xM array that left multiplies each slice of vol % vol - an MxNxK array where vol(:,:,k) left multiplies vec % % Outputs: % out - an Mx1xK array % % Written b...
github
ndwork/dworkLib-master
evaluatePoly2.m
.m
dworkLib-master/evaluatePoly2.m
1,097
utf_8
b1bae7b3442afdcb18e74e244035ecae
function p = evaluatePoly2( c, x, y ) % p = evaluatePoly2( c, x, y ) % % This function evaluates the 2D polynomial defined by coefficients in c % at points (x,y). % % Inputs: % x - 1D array of values % y - 1D array of values % % Outputs: % p = a 2 dimensional array of polynomial coefficients. %...
github
ndwork/dworkLib-master
projectImage.m
.m
dworkLib-master/projectImage.m
1,278
utf_8
b0c46066c9ce51ceffb86766dbe7daac
function out = projectImage( img, H, varargin ) % out = projectImageWithHomography( img, H, [ range ] ) % % Inputs: % img - a 2D array (or a 3D array where the third dimension is color) of % data to project % H - the 3x3 homography % % Optional Inputs: % range - An optional 4D array specifying the ...
github
ndwork/dworkLib-master
iwtDaubechies2.m
.m
dworkLib-master/iwtDaubechies2.m
3,644
utf_8
a420341594b9b7d8cb8d1bb24cb41b4b
function img = iwtDaubechies2( wt, varargin ) % img = iwtDaubechies2( wt[, split] ); % Performs an inverse Daubechies wavelet transform of an image (with circular boundary conditions) % % Inputs: % img - 2D array representing the wavelet transform of the image % % Optional Inputs: % split - array speci...
github
ndwork/dworkLib-master
wtDaubechies2.m
.m
dworkLib-master/wtDaubechies2.m
4,176
utf_8
7e4d7b0e0faa011b96b6eae8d37c7230
function wt = wtDaubechies2( img, varargin ) % wt = wtDaubechies2( sig [, split] ); % % Performs a Daubechies wavelet transform of an image (with circular boundary conditions) % Based on the Wikipedia page on the Daubechies wavelet transform and % (http://wavelets.pybytes.com/wavelet/db2/) % % Inputs: ...
github
ndwork/dworkLib-master
ufft2.m
.m
dworkLib-master/ufft2.m
727
utf_8
8018f90b1b15159de895b06b44e83737
function out = ufft2( in ) % out = ufft2( in ) % % Compute the two-dimensional unitary fft of % the first two dimensions of in % % Written by Nicholas Dwork, Copyright 2019 % % https://github.com/ndwork/dworkLib.git % % This software is offered under the GNU General Public License 3.0. It % is ...
github
ndwork/dworkLib-master
insertValueIntoOrderedArray.m
.m
dworkLib-master/insertValueIntoOrderedArray.m
1,312
utf_8
327173155ddc12b4cca55824d20c2ed5
function newArray = insertValueIntoOrderedArray( array, value ) % newArray = insertValueIntoOrderedArray( array, value ) % % Insert a new value into an ordered array so that the new array remains % ordered. % If the value already exists in the array, nothing is inserted % % Inputs: % array - a 1D (colu...
github
ndwork/dworkLib-master
logBase.m
.m
dworkLib-master/logBase.m
565
utf_8
21698c5418fcd7666b3eadb13bb807cc
function out = logBase( in, base ) % out = logBase( in, base ) % % Compute the log to an arbitrary base % % Inputs: % in - an array of values % base - the base of the logarithm % % Written by Nicholas Dwork - Copyright 2020 % % https://github.com/ndwork/dworkLib.git % % This software is offer...
github
ndwork/dworkLib-master
makeEdgeMask.m
.m
dworkLib-master/makeEdgeMask.m
923
utf_8
3e223b2652f7aaa1ab16933eca1253b7
function mask = makeEdgeMask( sz, edge ) % mask = makeEdgeMask( sz, edge ) % % Inputs: % sz - two element vector specifying the size of the output image mask % edge - either a scalar specifying number of pixels in edge or a two % element array specifying the size of the edge in each dimension. % % O...
github
ndwork/dworkLib-master
huber.m
.m
dworkLib-master/huber.m
677
utf_8
43b5af2e41d75564a2b91225b333aceb
function out = huber( in, mu ) % out = huber( in, mu ) % % Calculates the Huber penalty loss of in % % Inputs: % in - a 1D array % mu - the scalar Huber parameter % % Written by Nicholas Dwork - Copyright 2021 % % This software is offered under the GNU General Public License 3.0. It % is offer...
github
ndwork/dworkLib-master
evalLaplacePDF.m
.m
dworkLib-master/evalLaplacePDF.m
1,352
utf_8
ff56d770c5f2167a5047e3f3608c0a93
function out = evalLaplacePDF( x, varargin ) % out = evalLaplacePDF( x [, 'LMean', LMean, 'LVar', LVar, 'LSig', LSig ] ) % % Evaluation the Laplace distribution at specific domain values % % Inputs: % x - an array of evaluation points % % Optional Inputs: % LMean - a 1D array or scalar specifying th...
github
ndwork/dworkLib-master
fft2h.m
.m
dworkLib-master/fft2h.m
588
utf_8
8db99f43197a35946445183efa5735ee
function out = fft2h( in ) % out = fft2h( in ) % % Compute the adjoint of the two dimensional fft % % Written by Nicholas Dwork, Copyright 2022 % % https://github.com/ndwork/dworkLib.git % % This software is offered under the GNU General Public License 3.0. It % is offered without any warranty exp...
github
ndwork/dworkLib-master
downsize2.m
.m
dworkLib-master/downsize2.m
1,473
utf_8
f8477182e36cfee1196950711955fa8b
function out = downsize2( img, newSize, varargin ) % Does nearest neighbor interpolation for image downsizing % % out = downsize2( img, newSize [, op ] ) % % Inputs: % img - 2D array % newSize - two element array specifying new size of image % % Optional Inputs: % op - either 'transp' or 'notransp'...
github
ndwork/dworkLib-master
randRician.m
.m
dworkLib-master/randRician.m
1,157
utf_8
60e915ab0fbc84557f0435967a496ae7
function out = randRician( rNu, rSig, varargin ) % Generate a Rician distribution with parameters rNu and rSig according to % https://en.wikipedia.org/wiki/Rice_distribution#Related_distributions % % out = randRician( rNu, rSig [, theta ] ) % % Inputs: % rNu - a single element or an array parameterizing ...
github
ndwork/dworkLib-master
epgTest.m
.m
dworkLib-master/epgTest.m
201
utf_8
caaa8eaa4c4f6ffb2d68b97ddc605f0c
function epgTest t = 50; T1 = 1000; T2 = 200; alpha = 35; Q = zeros(3, 10); Q(3,1) = 1; Q = epgRF( Q, alpha ); Q = epgGrad( Q, 3 ); Q = epgRelax( Q, t, T1, T2 ); disp(Q); end
github
ndwork/dworkLib-master
csReconLASSO.m
.m
dworkLib-master/csReconLASSO.m
10,301
utf_8
5f88b2528e8d32073a1908d9f6aa50b1
function [recon,oValues,lambda] = csReconLASSO( samples, varargin ) % recon = csReconLASSO( samples [, 'lambda', lambda, 'nIter', nIter, 'nReweightIter', nReweightIter, ... % 'printEvery', printEvery, 'transformType', transformType, 'verbose', verbose, ... % 'waveletType', waveletType, 'w', w, 'wavSplit', wa...
github
ndwork/dworkLib-master
cube2Gif.m
.m
dworkLib-master/cube2Gif.m
2,052
utf_8
d06f2a85043e4973cf6305be2930e71d
function cube2Gif( cube, varargin ) % cube2Gif( cube, [ outFile, delayTime, 'dim', dim, 'loopCount', loopCount ] ) % % This function converts a 3D array of data into a gif. The third dimension % is converted into the temporal dimension. % % Inputs: % cube - a 3D array. The dynamic range of cube must b...
github
ndwork/dworkLib-master
fista_wLS.m
.m
dworkLib-master/fista_wLS.m
7,622
utf_8
a4226a92afa7a042713b2daef584c7c0
function [xStar,objectiveValues,relDiffs] = fista_wLS( x, g, gGrad, proxth, varargin ) % [xStar,objValues,relDiffs] = fista_wLS( x, g, gGrad, proxth [, ... % 'h', h, 'innerProd', innerProd, 'minStep', minStep, 'N', N, 'r', r, 's', s, 't0', t0, ... % 'restart', true/false, 'tol', tol, 'verbose', verbose ] ) ...
github
ndwork/dworkLib-master
volVolMatrixProd.m
.m
dworkLib-master/volVolMatrixProd.m
1,303
utf_8
b5b1ffb3571ca07c76370649286774ab
function out = volVolMatrixProd( A, B ) % out = volVolMatrixProd( A, B ) % % Matrix multiplies each slice of A by each slice of B % % Inputs: % A - Either a 3D array or a 2D array. % If a 2D array, each row is considered a matrix multiply % B - Either a 3D array or a 2D array. % If a 2D array...
github
ndwork/dworkLib-master
makeKbKernel.m
.m
dworkLib-master/makeKbKernel.m
2,281
utf_8
952425b7e720590f4c5c78298a2da241
function [kC,C,c] = makeKbKernel( G, varargin ) % [kc,C,c] = makeKbKernel( G, [, N, 'alpha', alpha, 'W', W, 'nC', nC ] ) % % This function makes the Kaiser Bessel kernel; this kernel is a % fundamental part of the Gridding (and inverse Gridding) algorithm. % Consider reviewing "Selection of a Convolution Fu...
github
ndwork/dworkLib-master
fitLineToData.m
.m
dworkLib-master/fitLineToData.m
673
utf_8
130fe96d0e223f83164032c85ab811a6
function [m,b] = fitLineToData( x, y ) % [m,b] = fitLineToData( x, y ) or % [m,b] = fitLineToData( y ) % % This function finds m and b so that ||y-(mx+b)||_2 is minimized % % Inputs: % x - (optional) domain values % y - range values % % Written by Nicholas Dwork - Copyright 2016 % % This softwa...
github
ndwork/dworkLib-master
mri_doubleAngleMapB1.m
.m
dworkLib-master/mri_doubleAngleMapB1.m
5,068
utf_8
ffe034f0eac98973577002f47a9938f6
function b1ScaleMap = mri_doubleAngleMapB1( dataCube, sliceThickness, varargin ) % b1ScaleMap = mri_doubleAngleMapB1( dataCube, sliceThickness [, angles, 'mask', mask, 'alg', alg, ... % 'verbose', verbose' ] ) % % Performs double angle B1 mapping % % Inputs: % dataCube - a 3D array of size MxNx2. The ...
github
ndwork/dworkLib-master
restart.m
.m
dworkLib-master/restart.m
1,529
utf_8
bd585bde5792487af31c8e4a017be038
function restart( varargin ) % restart % % closes all windows, clears variables, clears the command window, ends debug % mode, and deletes any parforProgess files that were created by the current % instance of Matlab % % Written by Nicholas Dwork - Copyright 2017 % % https://github.com/ndwork/dworkLi...
github
ndwork/dworkLib-master
ctFan2Para.m
.m
dworkLib-master/ctFan2Para.m
1,823
utf_8
02d8ffcc5fd628aee4e61e9fa76ca04e
function out = ctFan2Para( sinogram, gammas, betas, d, oThetas, oLines ) % out = ctFan2Para( sinogram, gammas, betas, d, oThetas, oLines ) % % Interpolates a sinogram created by a fan projection into a parallel projection % sinogram using physical units of a computed tomography detector % % Inputs: ...
github
ndwork/dworkLib-master
mri_makeRF.m
.m
dworkLib-master/mri_makeRF.m
1,453
utf_8
c4221b3117bbaaab30efe54d3863e1d5
function R = mri_makeRF( alphas, phis ) % R = mri_makeRF( alphas, phis ) % determine the tip-angle rotation matrix applied to (Mx,My,Mz) % % Inputs: % alphas - the tip angles in radians % % Optional Inputs: % phis - the phases of the RF pulse in radians (default is 0) % % Outputs: % the 3x3 rotat...
github
ndwork/dworkLib-master
gridT_2D.m
.m
dworkLib-master/gridT_2D.m
1,467
utf_8
e115d724c84a79a1f7c6c3e6c0f220c7
function out = gridT_2D( in, traj, weights, varargin ) % out = gridT_2D( in, traj, weights, [ 'alpha', alpha, 'W', W, 'nC', nC ] ) % % Adjoint of gridding operation. Definitions and details according to % http://nicholasdwork.com/tutorials/dworkGridding.pdf % % Inputs: % in is a 1D array representing ...
github
ndwork/dworkLib-master
ofInterp2D.m
.m
dworkLib-master/ofInterp2D.m
346
utf_8
c2213be0be44744797c1fff12d6f9ed9
function interped = ofInterp2D( img, du, dv ) [M N] = size(img); xIndxs = ones(M,1) * (1:N); yIndxs = (1:M)' * ones(1,N); interped = interp2( xIndxs, yIndxs, img, ... xIndxs+du, yIndxs+dv, 'linear', 0 ); %nanIndxs = find( ~isfinite( interped ) ); %if numel(nanIndxs) > 0 % interped(nanIndxs) = ...
github
ndwork/dworkLib-master
normL2L1.m
.m
dworkLib-master/normL2L1.m
974
utf_8
76ee8cdd492a8534c970d30dc016a38c
function out = normL2L1( in, varargin ) % out = normL2L1( in, [ 'ws', ws ] ) % % Calculates the L_{2,1} norm of the input. It is assumed that % the last dimension of in represents the groups % % Inputs: % in: a multi-dimensional array. The last dimension of in represents % the groups. That is, t...
github
ndwork/dworkLib-master
mri_makeIntensityMask.m
.m
dworkLib-master/mri_makeIntensityMask.m
2,262
utf_8
47aca077cb8c1ffa9e20422ac609c60c
function mask = mri_makeIntensityMask( kData, varargin ) % mask = mri_makeIntensityMask( kData [, 'thresh', thresh, ... % 'm', m, 'morphScale', morphScale, 'noiseCoords', noiseCoords' ] ) % % Created using the method of "SENSE: Sensitivity Encoding for Fast MRI" by % Pruessmann et al., 1999 % % Inputs:...
github
ndwork/dworkLib-master
proxL2.m
.m
dworkLib-master/proxL2.m
552
utf_8
e9cbdc73af9e0af8127d382cb1a7a847
function out = proxL2( x, t ) % out = proxL2( x, t ) % % Calculates the proximal operator of f(x) = t * L2( x ) % % Inputs: % x - a 1D array % t - a scalar % % Written by Nicholas Dwork - Copyright 2020 % % This software is offered under the GNU General Public License 3.0. It % is offered with...
github
ndwork/dworkLib-master
svdDenoise.m
.m
dworkLib-master/svdDenoise.m
1,210
utf_8
5dc172043a9742c343ab70a667ba07f1
function out = svdDenoise( data, newRank ) % out = svdDenoise( data, newRank ) % % Implements the denoising method of "Application of low-rank approximation using % truncated singular value decomposition for noise reduction in hyperpolarized 13C % NMR spectroscopy" by Francischello et al. % % Inputs: ...
github
ndwork/dworkLib-master
bilateralFilter.m
.m
dworkLib-master/bilateralFilter.m
3,789
utf_8
f4bb90012af0cefcaede6a68c101fd8b
function out = bilateralFilter( img, varargin ) % out = bilateralFilter( img, [ 'S', S, 'sigmaD', sigmaD, ... % 'sigmaR', sigmaR, 'verbose', verbose ] ); % % Inputs % img: the input image to be denoised % either a MxN 2D grayscale image or a MxNx3 color image % % Optional Inputs: % S: the l...