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 | iGridT_2D.m | .m | dworkLib-master/iGridT_2D.m | 3,000 | utf_8 | a57141349e6d71bc2600b09e4681ea64 |
function out = iGridT_2D( F, traj, N, varargin )
% out = iGridT_2D( F, traj, N, [ 'alpha', alpha, 'W', W, 'nC', nC ] )
%
% Gridding (without density correction) is the adjoint of MRI encoding
% with inverse gridding. This function applies the transpose of
% inverse gridding to the input data.
% Based on E... |
github | ndwork/dworkLib-master | proxConjL1.m | .m | dworkLib-master/proxConjL1.m | 1,335 | utf_8 | d410357dc4e8290d0b8b3bfdb239323b |
function out = proxConjL1( in, sigma, t )
% out = proxConjL1( v, sigma, t )
%
% Returns the proximal operator of sigma times the conjugate function of
% f(x) = t * || x ||_1.
% The conjugate function of a norm is the indicator function of the unit ball of
% the dual norm. The dual of the L1 norm is the L_... |
github | ndwork/dworkLib-master | trackFeatures.m | .m | dworkLib-master/trackFeatures.m | 3,411 | utf_8 | f1f5014524ee938935ae2a2b36230e24 |
function pts2 = trackFeatures( pts1, img1, img2, varargin )
% pts2 = trackFeatures( pts1, img1, img2 [, 'searchWidth', searchWidth, ...
% 'kernelWidth', kernelWidth, 'offset', offset] )
%
% Algorithm tracks points from img1 into img2 using Normalized Cross
% correlation according to "Fast Normalized Cross ... |
github | ndwork/dworkLib-master | plotnice.m | .m | dworkLib-master/plotnice.m | 798 | utf_8 | b71bd0a549f1de4283ac58ce2fdd8427 |
function plotnice( in1, varargin )
% plotnice( in1 [, in2, 'ax', ax, options ] )
%
% Inputs:
% in1 - 1D array to 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)
% options - al... |
github | ndwork/dworkLib-master | eulerAnglesFromRotationMatrix3D.m | .m | dworkLib-master/eulerAnglesFromRotationMatrix3D.m | 1,762 | utf_8 | 9fed265e43a03d529c66a972e2206a55 |
function [angles,angles2] = eulerAnglesFromRotationMatrix3D( R )
% Finds the euler angles (phi,theta,psi) from a 3x3 rotation matrix R
% where R(phi,theta,psi) = Rz(phi) Ry(theta) Rx(psi) according to
% http://www.gregslabaugh.net/publications/euler.pdf
%
% Inputs:
% R - a 3x3 rotation matrix
%
% Outpu... |
github | ndwork/dworkLib-master | ffth.m | .m | dworkLib-master/ffth.m | 747 | utf_8 | f580ba6ffc822107c430190923187eac |
function out = ffth( in, varargin )
% out = ffth( in )
%
% Compute the adjoint of the FFT
%
% Written by Nicholas Dwork, Copyright 2023
%
% 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 o... |
github | ndwork/dworkLib-master | calcAutofocusMetric.m | .m | dworkLib-master/calcAutofocusMetric.m | 1,128 | utf_8 | 1edef9b89c237302c0d17a92562f8de0 |
function out = calcAutofocusMetric( in, varargin )
% Calculates the autofocus metric according to "Blind retrospective motion correction of
% MR images" by Loktyushin et al.
%
% Input:
% in - an array of any number of dimensions
%
% Output:
% out - the value of the autofocus metric
%
% Written by N... |
github | ndwork/dworkLib-master | figureExists.m | .m | dworkLib-master/figureExists.m | 448 | utf_8 | 5417ee9260453d67b8d4ad9093c48a85 |
function out = figureExists()
% out = figureExists()
%
% Returns true if a figure exists and false otherwise
%
% Written by Nicholas Dwork - Copyright 2020
%
% 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 | colorImageWithMap.m | .m | dworkLib-master/colorImageWithMap.m | 830 | utf_8 | 9c6761f75dc7a963339817f9731e6223 |
function colorImg = colorImageWithMap( img, varargin )
% colorImg = colorImageWithMap( img [, cmap ] )
%
% Inputs:
% img - 2D array representing the image
%
% Optional Inputs:
% cmap - the colormap (default is hot)
%
% Written by Nicholas - Copyright 2019
%
% This software is offered under the GN... |
github | ndwork/dworkLib-master | mri_reconLowRankPlusJointSparse.m | .m | dworkLib-master/mri_reconLowRankPlusJointSparse.m | 7,778 | utf_8 | 4abe427aa41c2845e1762295894d231c |
function [recon,objValues] = mri_reconLowRankPlusJointSparse( data, trajs, sImg, ...
lambda, sigma, varargin )
% [recon,objValues] = mri_reconLowRankPlusJointSparse( data, trajs, sImg, ...
% lambda, sigma [, 'alpha', alpha, 'W', W, 'nC', nC ] )
%
% Inputs:
% data - an NxCxT array of data values where N ... |
github | ndwork/dworkLib-master | projSubgrad.m | .m | dworkLib-master/projSubgrad.m | 1,825 | utf_8 | 0e525e330e97fd413cee2eeeb7e6d04d |
function [xStar,objValues] = projSubgrad( x, gGrad, proj, varargin )
% [xStar,objValues] = projSubgrad( x, gGrad, proj [, 'g', g, 'N', N, 't', t ] )
%
% This function implements the projected subgradient method
%
% Inputs:
% x - the starting point
% gGrad - a function handle that returns a (sub)gradient ... |
github | ndwork/dworkLib-master | add2Diag.m | .m | dworkLib-master/add2Diag.m | 792 | utf_8 | 42789045166225f54ed164c87c3d2048 |
function out = add2Diag( A, v )
% out = add2Diag( A, v )
%
% Adds vector v to the diagonal elements of matrix A
%
% Inputs:
% A - a matrix of size M x N
% v - either a scalar or a vector with min(M,N) elements in it
%
% Written by Nicholas Dwork - Copyright 2019
%
% https://github.com/ndwork/dwor... |
github | ndwork/dworkLib-master | findTransWithPCC.m | .m | dworkLib-master/findTransWithPCC.m | 785 | utf_8 | 9c99b26183f5295b01745576c48daa00 |
function [vShift,hShift] = findTransWithPCC( img1, img2 )
% [vShift,hShift] = findTransWithPCC( img1, img2 )
%
% Outputs:
% vShift - the vertical shift to apply to img1 so that it is aligned
% with image 2
% hShift - the horizontal shift to apply to img1 so that it is aligned
% with ima... |
github | ndwork/dworkLib-master | showLibFiles.m | .m | dworkLib-master/showLibFiles.m | 3,270 | utf_8 | ece59f637b61c34adfd3930c57997733 |
function showLibFiles( varargin )
% showLibFiles( [ libName, pattern ] )
% libName - an optional argument specifying the library name of interest
% By default, this function shows all libraries.
% If a library name is specified, then this function shows all the files
% in that library.
%
% Optional Input... |
github | ndwork/dworkLib-master | findLineInFile.m | .m | dworkLib-master/findLineInFile.m | 1,484 | utf_8 | 02f262854c936d5456dd2485c686e268 |
function [ out, matchIndx ] = findLineInFile( file, exp, varargin )
% [ outLine, matchIndx ] = findLineInFile( file, exp [, 'nLines', nLines ] )
%
% Finds the first line in the file that matches expression
%
% Inputs:
% file - a string with the file to open
% exp - the experession to match
%
% Option... |
github | ndwork/dworkLib-master | showLibs.m | .m | dworkLib-master/showLibs.m | 328 | utf_8 | 0d0d59ef40e12b5555250f8d4a7c73be |
function showLibs( )
% Shows all libraries available
myPath = path;
pathDirs = strsplit( myPath, ':' );
for i=1:numel(pathDirs)
if pathDirs{i} == '.'
continue;
elseif ~isempty( regexp( pathDirs{i}, '^/Applications/MATLAB_', 'ONCE' ) )
continue
else
disp(pathDirs{i});
end
e... |
github | ndwork/dworkLib-master | alignVolumesWithHomography.m | .m | dworkLib-master/alignVolumesWithHomography.m | 1,093 | utf_8 | 4aa976d86866964a03e286271ffae600 |
function proj2 = alignVolumesWithHomography( vol1, vol2, varargin )
% proj2 = alignVolumesWithHomography( vol1, vol2 [, distThresh] )
%
% This function aligns vol2 with vol1 using a Homography.
% The algorithm it employs is to:
% - find features in vol1 with Difference of Gaussians
% - track features i... |
github | ndwork/dworkLib-master | nSigDims.m | .m | dworkLib-master/nSigDims.m | 583 | utf_8 | aa92fdfeb5b700aed05b9b2f82333439 |
function out = nSigDims( arrayIn )
% out = nSigDims( arrayIn )
% Determines the number of dimensions with size greater than 1
%
% Input:
% arrayIn - the array to be evaluated
%
% Output:
% out - the number of significant dimensions
%
% Written by Nicholas Dwork - Copyright 2017
%
% This softwar... |
github | ndwork/dworkLib-master | lassoCPwLS.m | .m | dworkLib-master/lassoCPwLS.m | 1,903 | utf_8 | 3b82efa2454f67659d4973c80c4f79f2 |
function [x,residuals] = lassoCPwLS( K, b, gamma, varargin )
% x = lasso_CPwLS( K, b, gamma [, 'nIter', nIter ] );
%
% Minimizes the Lasso problem:
% minimize (1/2)|| K x - b ||_2 + gamma || x ||_1
% Uses Chambolle-Pock (Primal-Dual Algorithm) with line search based on A First-Order
% Primal-Dual Algorit... |
github | ndwork/dworkLib-master | csReconLASSO_msbpd.m | .m | dworkLib-master/csReconLASSO_msbpd.m | 2,668 | utf_8 | 40239d06ceb0f9dac9e766d698a7e428 |
function [recon,oValues,lambda] = csReconLASSO_msbpd( samples, varargin )
% recon = csReconLASSO_msbpd( samples, lambda [, 'debug', debug, ...
% 'nIter', nIter, 'printEvery', printEvery, 'wavSplit', wavSplit, ...
% 'verbose', verbose, 'waveletType', waveletType ] )
%
% This routine minimizes 0.5 * || Ax ... |
github | ndwork/dworkLib-master | findAndTrackPeaks.m | .m | dworkLib-master/findAndTrackPeaks.m | 2,488 | utf_8 | 8f4d19802ee848e56b3de7b68d20f6e8 |
function [pts1,pts2] = findAndTrackPeaks( img1, img2, varargin )
% [pts1,pts2] = findAndTrackPeaks( img1, img2 ...
% [, 'N', N, 'buffer', buffer, 'w', w, 'k', k, ...
% 'searchWidth', searchWidth, 'offset', offset ] )
%
% Inputs:
% img1/img2 - 2D arrays; find features in img1 and track into img2
% N ... |
github | ndwork/dworkLib-master | undoRadialDistortion.m | .m | dworkLib-master/undoRadialDistortion.m | 2,388 | utf_8 | bb7ccc053d272526bdc67cc203d76320 |
function out = undoRadialDistortion( img, ks, varargin )
% out = undoRadialDistortion( img, k [, 'c', c, 'space', 'full',[] ] )
%
% Written according to section 7.4 of Multiple View Geometry, 2nd edition
% by Hartley and Zisserman
%
% Inputs:
% img - a 2D array or 3D array where the third dimension is co... |
github | ndwork/dworkLib-master | stochasticProxGrad.m | .m | dworkLib-master/stochasticProxGrad.m | 4,094 | utf_8 | b0311f48c3be0d451495caf629195070 |
function [ xStar, oValues, relDiffs ] = stochasticProxGrad( x0, stepSize, gGrad, proxth, varargin )
% Implements the stochastic proximal gradient method as detailed in
% "Convergence of stochastic proximal gradient algorithm" by Rosasco et al.
% for a function where the gradient has the form of a summation: gGr... |
github | ndwork/dworkLib-master | segImgByTransduction.m | .m | dworkLib-master/segImgByTransduction.m | 4,245 | utf_8 | 7893679d6ce02bd49ad8fc56eb712bbb |
function out = segImgByTransduction( img, ins, outs, varargin )
% out = segByTransduction( img, ins, outs [, 'lambda', lambda, 'nbhdSize', nbhdSize ] )
%
% Implements the algorithm of "Segmentation by Transduction" by Duchenne et al.
%
% Inputs:
% img - an array
% ins - a 1D array of indices into img for... |
github | ndwork/dworkLib-master | hsiFusion.m | .m | dworkLib-master/hsiFusion.m | 821 | utf_8 | 217c7eaf82f30059da8d5b33ddd0d2b8 |
function fused = hsiFusion( colorImg, monoImg )
% fused = ihsFusion( colorImg, monoImg )
%
% performs the fast IHS fusion algorithm of "A New Intensity-Hue-Saturation
% Fusion Approach to Image Fusion With a Tradeoff Parameter" by Choi,
% 2006
%
% Written by Nicholas Dwork - Copyright 2016
%
% T... |
github | ndwork/dworkLib-master | applyRadialDistortion2Pts.m | .m | dworkLib-master/applyRadialDistortion2Pts.m | 2,047 | utf_8 | 6d080d7a6d69810da3c0b5430b7e79c4 |
function outPts = applyRadialDistortion2Pts( pts, ks, c, varargin )
% out = applyRadialDistortion2Pts( pts, k, c [, 'dir', dir ] )
%
% Written according to section 7.4 of Multiple View Geometry, 2nd edition
% by Hartley and Zisserman
%
% Inputs:
% pts - an MxN array of points where M is the number of poi... |
github | ndwork/dworkLib-master | makeAnaglyph.m | .m | dworkLib-master/makeAnaglyph.m | 800 | utf_8 | 478516b4702c379f63d453a6ac59304a |
function out = makeAnaglyph( imgL, imgR )
% This function makes an anaglyph from two individual images
%
% out = makeAnaglyph( imgL, imgR )
%
% Inputs:
% imgL - the image that will become red
% imgR - the image that will become blue
%
% Outputs:
% out - the anaglyph image
%
% Written by Nichola... |
github | ndwork/dworkLib-master | makeAGif.m | .m | dworkLib-master/makeAGif.m | 2,417 | utf_8 | 5473c04353c792ee345d88838fd5f9eb |
function makeAGif( varargin )
% makeAGif( [ inDir, outFile, delayTime, 'loopCount', loopCount ] )
%
% This function makes a gif out of a set of images
% It assumes that all images are stored in their own directory (and
% no other files are stored in the directory with them).
% The images must be na... |
github | ndwork/dworkLib-master | projectOntoProbSimplex.m | .m | dworkLib-master/projectOntoProbSimplex.m | 1,043 | utf_8 | 8733396db8428507b477809eadd7fbd6 |
function out = projectOntoProbSimplex( y )
% out = projectOntoProbSimplex( y )
%
% This function performs a Euclidean projection of y onto the probability simplex.
% That is, out is the nearest point to y such that out is non-negative and it
% sums to 1.
%
% This function is based on "Projection onto the... |
github | ndwork/dworkLib-master | makeImagePyramid.m | .m | dworkLib-master/makeImagePyramid.m | 1,077 | utf_8 | 2454e27aadd2b04ae28a4ba67d524af9 |
function pyramid = makeImagePyramid( img, nLevels, spacing )
% pyramid = makeImagePyramid( img, nLevels, spacing )
%
% Inputs:
% img - 2D array to make a pyramid of
% nLevels - number of levels of the pyramid
% spacing - relative size of each pyramid level
%
% Outputs:
% pyramid - a cell array with o... |
github | ndwork/dworkLib-master | proxHuber.m | .m | dworkLib-master/proxHuber.m | 987 | utf_8 | b60ddbd0f3002cb0daa5a827e68ed5b7 |
function out = proxHuber( x, t, mu, b )
% out = proxHuber( x, t, mu, b )
%
% Calculates the proximal operator of f(x) = t * Huber( x - b, mu ).
% If x is an array, proxHuber operates on each element of the array
% individually.
%
% Inputs:
% x - an
% t - a scalar
% mu - the Huber penalty paramete... |
github | ndwork/dworkLib-master | ransacDltHomographyFromPts3D.m | .m | dworkLib-master/ransacDltHomographyFromPts3D.m | 1,743 | utf_8 | 8088bdf5020c7b2fc627fc2a86a2a907 |
function [H,inlierIndxs,outlierIndxs] = ransacDltHomographyFromPts3D( ...
pts1, pts2, thresh )
% [H,inlierIndxs,outlierIndxs] = ransacDltHomographyFromPts2D( ...
% pts1, pts2, thresh )
% This function finds the 4x4 homography H such that pt2 = H( pt1 );
% It implements RANSAC with the Direct Linear Transfo... |
github | ndwork/dworkLib-master | pogm.m | .m | dworkLib-master/pogm.m | 4,405 | utf_8 | 918871a67a496b08cc598754e15a6c54 |
function [xStar,objectiveValues,relDiffs] = pogm( x, gGrad, proxth, varargin )
% [xStar,objectiveValues,relDiffs] = pogm( x, g, gGrad, proxth [, N, ...
% 'g', g, 'h', h, 't', t, 'verbose', verbose ] )
%
% This function implements the POGM optimization algorithm
% POGM finds the x that minimizes functions o... |
github | ndwork/dworkLib-master | retinexLCE.m | .m | dworkLib-master/retinexLCE.m | 2,025 | utf_8 | 24e5ce8156e6a1e127184ae4964c80d7 |
function out = retinexLCE( img, varargin )
% out = retinexLCE( img )
%
% Performs local contrast enhancement according to "Retinex Processing for Automatic Image
% Enhancement" by Rahman, Jobson, and Woodell in Journal of Electronic Imaging in 2004.
%
% Inputs:
% img - a 2D array representing an image. ... |
github | ndwork/dworkLib-master | size2imgCoordinates.m | .m | dworkLib-master/size2imgCoordinates.m | 865 | utf_8 | 603f29cbc48505a4efabc941f78adf53 |
function coords = size2imgCoordinates( N )
% coords = size2imgCoordinates( N )
%
% Inputs:
% N is an an array specifying the number of elements in each dimension.
% For example, N can be a two element array [Ny Nx] specifying the
% number of row and columns of the data.
%
% Outputs:
% If N ... |
github | ndwork/dworkLib-master | clsFusion.m | .m | dworkLib-master/clsFusion.m | 1,778 | utf_8 | 9dab28e1b9959c3d6b2d2490f75328cf |
function fused = clsFusion( colorImg, monochromeImg, varargin )
%
% fused = clsFusion( color, monochrome [, gamma ] )
%
% Inputs:
% colorImg - a 3D array
% monochromeImg - a 2D array
%
% Written by Nicholas Dwork, Copyright 2017
%
% This software is offered under the GNU General Public License 3.0.... |
github | ndwork/dworkLib-master | contoursToPolyhedron.m | .m | dworkLib-master/contoursToPolyhedron.m | 5,972 | utf_8 | 0af262559d0ce7b63168f846248797dc | function triangles = contoursToPolyhedron( contours, varargin )
% triangles = contourToPolyhedron( contours, [ 'nPointsPerContour', nPointsPerContour ] )
%
% Inputs:
% contours - cell array, where each element of the cell is a 2D matrix
% that specifies the points of the contour of the corresponding slice.
... |
github | ndwork/dworkLib-master | epgRF.m | .m | dworkLib-master/epgRF.m | 389 | utf_8 | f32aacf045cc30734e098b14ced23538 |
function Qout = epgRF( Qin, alpha, varargin )
% Qout = epgRF( Qin, alpha [, phi] )
% 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
% alpha is the tip angle in radians
% phi is the phase of the rotation axis in ra... |
github | ndwork/dworkLib-master | segVolByTransduction.m | .m | dworkLib-master/segVolByTransduction.m | 5,036 | utf_8 | 0984230af3a72f7048669485f824de8f |
function out = segVolByTransduction( vol, ins, outs, varargin )
% out = segVolByTransduction( vol, ins, outs [, 'lambda', lambda, 'nbhdSize', nbhdSize ] )
%
% Implements the algorithm of "Segmentation by Transduction" by Duchenne et al. for a
% three-dimensional volume
%
% Inputs:
% vol - a three-dimensi... |
github | ndwork/dworkLib-master | proxNucNorm.m | .m | dworkLib-master/proxNucNorm.m | 1,249 | utf_8 | b38adf1d8621204a0ea7d9b894d09adb |
function [ out, u ] = proxNucNorm( in, thresh, varargin )
% [ out, u ] = proxNucNorm( in, thresh )
%
% Returns the proximal operator of the nuclear norm of the input matrix
%
% Inputs:
% in - an input matrix
% thresh - the thresholding value
%
% Optional Inputs:
% u - the u matrix of the SVD decomp... |
github | ndwork/dworkLib-master | binarySearch.m | .m | dworkLib-master/binarySearch.m | 1,527 | utf_8 | 2b2b8704cb5744b6ee4dbbdf804862bc |
function out = binarySearch( f, LB, UB, varargin )
% out = binarySearch( f, LB, UB [, 'tol', tol, 'nMax', nMax ] )
%
% finds the root of the function f using a binary search
%
% Inputs:
% f - function handle
% LB - the lower bound of the root
% UB - the upper bound of the root
%
% Optional Inputs:
... |
github | ndwork/dworkLib-master | makeRadialImg.m | .m | dworkLib-master/makeRadialImg.m | 500 | utf_8 | cfe7af8264c2fc1ae0051afe3afdbbc6 |
function out = makeRadialImg( sImg, varargin )
% makes an image where each point represents the distance from the center
%
% out = makeRadialImg( sImg [, center] )
%
% Inputs:
% sImg - 2 element array specifying the (y,x) size of the image
% center - 2 element array specifying the (y,x) coordinate of the... |
github | ndwork/dworkLib-master | falseColorize.m | .m | dworkLib-master/falseColorize.m | 770 | utf_8 | 14f9db965b3ebc7f965846bc6a87dffc |
function out = falseColorize( img, varargin )
% out = falseColorize( img [, colormapName ] )
%
% Inputs:
% img - array with values between 0 and 1
%
% Optional Inputs:
% colormapName - the name of the colormap to use (default is jet)
%
% Written by Nicholas Dwork - Copyright 2020
%
% This softwar... |
github | ndwork/dworkLib-master | mri_mapOffResSimple.m | .m | dworkLib-master/mri_mapOffResSimple.m | 1,452 | utf_8 | 372cbc6928d838fd4ec01059780f7f74 |
function [ offResMap, phaseOffsetMap ] = mri_mapOffResSimple( dataCube, TEs, varargin )
% [ offResMap, phaseOffsetMap ] = mri_mapOffRes( dataCube, TEs [, 'mask', mask ] )
%
% Inputs:
% dataCube - an MxNxK array of data where each k index represents an
% image captured at a different echo time.
% TEs - a ... |
github | ndwork/dworkLib-master | mri_mapT2.m | .m | dworkLib-master/mri_mapT2.m | 4,965 | utf_8 | aac9ce5c26d54e7fad0952c1c9ea51a3 |
function [t2Map,m0Map,RSquared] = mri_mapT2( dataCube, TEs, varargin )
% [t2Map,m0Map] = mri_mapT2( dataCube, TEs, [, 'alg', alg, ...
% 'b1ScaleMap', b1ScaleMap, 'mask', mask, 'verbose', verbose ] )
%
% Determines T2 values by fitting data to a model.
% This objective function is taken from "Errors in ... |
github | ndwork/dworkLib-master | colorbarnice.m | .m | dworkLib-master/colorbarnice.m | 2,120 | utf_8 | 3705638435d22387f783b97f97018e3b |
function cb = colorbarnice( varargin )
% cb = colorbarnice( [ 'FontSize', FontSize, 'Label', Label', ...
% 'LineWidth', LineWidth ] );
%
% Inputs:
% FontSize - (default is 20)
% Label - the label of the colorbar (default is no label)
% LineWidth - (default is 2)
%
% Outputs:
% cb - the colorbar's... |
github | ndwork/dworkLib-master | bilinInterp2.m | .m | dworkLib-master/bilinInterp2.m | 4,431 | utf_8 | b79abb716405a36cc26560132d9ded60 |
function out = bilinInterp2( X, Y, V, Xq, Yq, varargin )
% out = bilinInterp2( X, Y, V, Xq, Yq [, 'op', 'notransp' ] )
%
% out = bilinInterp2( X, Y, V, Xq, Yq [, 'op', 'transp' ] )
%
% Performs a two dimensional bilinear interpolation. Extrapolated values
% are all set to 0.
%
% Inputs:
% X - an ord... |
github | ndwork/dworkLib-master | checkAdjoint.m | .m | dworkLib-master/checkAdjoint.m | 3,536 | utf_8 | fc064f5d1a1020203889a76034e6f760 |
function [out,err] = checkAdjoint( x, f_in, varargin )
% [out,err] = checkAdjoint( x, f [, fAdj, 'tol', tol, 'y', y, 'nRand', nRand, ...
% 'innerProd', innerProd ] )
%
% Check whether the adjoint of f is implemented correctly
%
% Inputs:
% x - a sample input (specifies size) of the function; it will be... |
github | ndwork/dworkLib-master | proxGrad_wExtrap.m | .m | dworkLib-master/proxGrad_wExtrap.m | 5,417 | utf_8 | 3084ec5d64430a7f5c7e79b29aa6418b |
function [xStar,objectiveValues,relDiffs,extrapolated] = proxGrad_wExtrap( x, gGrad, proxth, varargin )
% [xStar,objectiveValues,relDiffs] = proxGrad_wExtrap( x, gGrad, proxth [, ...
% 'g', g, 'h', h, 'N', N, 'q', q, 't', t, 'tol', tol, 'verbose', verbose ] )
%
% This function implements the proximal gradien... |
github | ndwork/dworkLib-master | linInterp.m | .m | dworkLib-master/linInterp.m | 2,511 | utf_8 | 397b6e32964bd8635db6693c8130db79 |
function out = linInterp( X, V, Xq, varargin )
% out = linInterp( X, V, Xq [, 'op', 'notransp' ] )
%
% out = linInterp( X, V, Xq [, 'op', 'transp' ] )
%
% Performs a 1 dimensional linear interpolation. Extrapolated values
% are all set to 0.
%
% Inputs:
% X - an ordered 1D array of domain values
%... |
github | ndwork/dworkLib-master | proxConjL2Sq.m | .m | dworkLib-master/proxConjL2Sq.m | 826 | utf_8 | 83225bc0d9ba47fc1ec208c6e3e37d7b |
function out = proxConjL2Sq( x, sigma, c, b )
% out = proxConjL2Sq( x, sigma, c, b );
%
% Let g(x) = (c/2) || x - b ||_2^2. This function returns the
% proximal operator of sigma times the conjugate function of g.
%
% Written by Nicholas Dwork - Copyright 2019
%
% https://github.com/ndwork/dworkLib.gi... |
github | ndwork/dworkLib-master | evalGaussPDF.m | .m | dworkLib-master/evalGaussPDF.m | 1,424 | utf_8 | be14e1f4a8ddf9bac504e36b79e23b16 |
function out = evalGaussPDF( x, varargin )
% out = evalGaussPDF( x [, 'gMean', gMean, 'gVar', gVar, 'gSig', gSig ] )
%
% Evaluation the normal distribution at specific domain values
%
% Inputs:
% x - an array of evaluation points
%
% Optional Inputs:
% gMean - a 1D array or scalar specifying the mea... |
github | ndwork/dworkLib-master | euc2Hom.m | .m | dworkLib-master/euc2Hom.m | 416 | utf_8 | 4dabee3e4d3da9f9239cd32e0b3893e5 |
function hom = euc2Hom( euc )
% hom = hom2Euc( euc )
% Convert Euclidean coordinates to homogeneous coordinates
%
% Inputs:
% euc - 2D array of size NxM where M is the number of points and N is
% the number dminensions.
%
% Outputs:
% hom - 2D array of size (N+1)xM.
%
% Written by Nicholas Dwor... |
github | ndwork/dworkLib-master | rotImg.m | .m | dworkLib-master/rotImg.m | 1,297 | utf_8 | 09d8cba8b1bef1877729b9acfb049fb6 |
function out = rotImg( img, angle, varargin )
% out = rotImg( img, angle [, center, 'op', 'notransp'/'transp' ] )
%
% Inputs:
% img - a 2D array
% angle - the angle to rotate in radians
%
% Optional Inputs:
% center - a 2 element array specifying the center to rotate about
% op - either 'notransp' o... |
github | ndwork/dworkLib-master | upsampleData.m | .m | dworkLib-master/upsampleData.m | 1,634 | utf_8 | 8d33bcf1bbcde63166c0c693dee495c6 |
function out = upsampleData( data, U, varargin )
% out = upsampleData( data, U [, 'S', S, 'sOut', sOut ] )
%
% Inputs:
% data - array
% U - upsample factor. Either an scalar integer (assuming same factor in all dimensions)
% or an array of integers (one for each dimension)
%
% Optional Inputs:
%... |
github | ndwork/dworkLib-master | pickAPoint.m | .m | dworkLib-master/pickAPoint.m | 1,603 | utf_8 | f19a9456b548704f234085c3e03b63cb |
function pt = pickAPoint( varargin )
% pt = pickAPoint( [ arg1, arg2, 'range', range ] )
%
% Find the coordinates of a point in an image
%
% Opitonal Inputs:
% arg1 - can either be an image or a scalar specifying the scale of the
% display
% arg2 - can either be an image or a scalar specifying the sc... |
github | ndwork/dworkLib-master | getNCores.m | .m | dworkLib-master/getNCores.m | 535 | utf_8 | 84122c170bb3b633d6d58be4fa505a84 |
function nCores = getNCores
% nCores = getNCores()
%
% Get the number of logical cores available on the computer for parallel processing
%
% Written by Nicholas Dwork - Copyright 2023
%
% https://github.com/ndwork/dworkLib.git
%
% This software is offered under the GNU General Public License 3.0. I... |
github | ndwork/dworkLib-master | proxConjL2.m | .m | dworkLib-master/proxConjL2.m | 572 | utf_8 | 2e6072062118bbb5033271a2cd2234ad |
function out = proxConjL2( x, t )
% out = proxConjL2( x, t )
%
% Calculates the proximal operator of the conjugate 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... |
github | ndwork/dworkLib-master | mri_makeSensitivityMaps.m | .m | dworkLib-master/mri_makeSensitivityMaps.m | 4,668 | utf_8 | 1eff27409c4d8834e8df9c07635c68c0 |
function senseMaps = mri_makeSensitivityMaps( kData, varargin )
% senseMaps = mri_makeSensitivityMaps( kData [, 'L', L, ...
% 'mask', mask, 'sigma', sigma, 'verbose', true/false ] )
%
% Created using the method of "SENSE: Sensitivity Encoding for Fast MRI" by
% Pruessmann et al., 1999
%
% Inputs:
% k... |
github | ndwork/dworkLib-master | fista_wAdaptiveRestartGradient.m | .m | dworkLib-master/fista_wAdaptiveRestartGradient.m | 5,213 | utf_8 | 9ad41dac8199d4e850df59838acd0af6 |
function [xStar,objectiveValues,relDiffs, restarts] = fista_wAdaptiveRestartGradient( x, gGrad, proxth, varargin )
% [xStar,objectiveValues,relDiffs] = fista_wAdaptiveRestartGradient( x, gGrad, proxth [, ...
% 'g', g, 'h', h, 'N', N, 't', t, 'tol', tol, 'verbose', verbose ] )
%
% This function implements the... |
github | ndwork/dworkLib-master | zeroOuterRegion.m | .m | dworkLib-master/zeroOuterRegion.m | 1,924 | utf_8 | 97ed716379231f0f51ba48c60178e780 |
function out = zeroOuterRegion( data, N )
% out = zeroOuterRegion( data, N )
% zeros outside of the center region of the data.
% (0,0) is defined according to fftshift
%
% Inputs:
% data - array to be cropped
% N - specified the size of the retained image portion
% If N is a scalar, then a cube is ex... |
github | ndwork/dworkLib-master | mri_ifftRecon.m | .m | dworkLib-master/mri_ifftRecon.m | 1,325 | utf_8 | 1dabfe6d086096e9d99afa70845ed74a |
function recons = mri_ifftRecon( kData, varargin )
% recons = mri_ifftRecon( kData [, 'multiSlice', true/false ] )
%
% Performs an inverse FFT of each coil
%
% Inputs:
% kData is an array of size ( Ny, Nx, nSlices, ..., nCoils )
%
% Output:
% recons is the reconstructed image, an array of the same si... |
github | ndwork/dworkLib-master | applyRadialDistortion.m | .m | dworkLib-master/applyRadialDistortion.m | 1,509 | utf_8 | 8cc1825d1a1a63cf4668e927ac7d72e2 |
function out = applyRadialDistortion( img, ks, varargin )
% out = applyRadialDistortion( img, k [, c ] )
%
% Written according to section 7.4 of Multiple View Geometry, 2nd edition
% by Hartley and Zisserman
%
% Inputs:
% img - a 2D array or 3D array where the third dimension is color
% ks - the radial... |
github | ndwork/dworkLib-master | isEven.m | .m | dworkLib-master/isEven.m | 1,801 | utf_8 | 982a4763c34814b1cf6e8d6b49831db5 |
function [out,error] = isEven( data, varargin )
% out = isEven( data, [ threshold ] )
%
% Determines whether or not data is even (with circular boundary conditions)
% Indexes are defined according to fftshift
%
% Inputs:
% data is a 1D or 2D array
% threshold is an optional input. The relative error b... |
github | ndwork/dworkLib-master | getSubFeaturesFromImg.m | .m | dworkLib-master/getSubFeaturesFromImg.m | 1,942 | utf_8 | 8a5174a410a0025d52207ce5d69ff613 |
function [features,values] = getSubFeaturesFromImg( img, n, varargin )
% features = getSubFeaturesFromImg( img, n [, scale ] )
%
% Inputs:
% n - the number of features to select
% scale - the scale of the displayed image (default is 1)
%
% Output:
% features - a 2 column array. The first column are th... |
github | ndwork/dworkLib-master | jinc.m | .m | dworkLib-master/jinc.m | 399 | utf_8 | 293945e71ac9efdd32763c02d1d9ae55 |
function out = jinc(r)
% out = jinc( r )
%
% Written by Nicholas Dwork - Copyright 2016
%
% 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
% ... |
github | ndwork/dworkLib-master | boundedOpticalFlow3D.m | .m | dworkLib-master/boundedOpticalFlow3D.m | 16,343 | utf_8 | 4fb61e60d6d2250a1253486d8eb39409 |
function [du,dv,dw] = boundedOpticalFlow3D( data1, data2, varargin )
% [du,dv,dw] = boundedOpticalFlow3D( data1, data2, [, 'bound', bound, ...
% 'eta', eta, 'rho', rho ] )
%
% Computes optical flow vectors
%
% Inputs:
% data1/data2 - 3D arrays; optical flow vectors will point from voxels
% in data1... |
github | ndwork/dworkLib-master | labelImgPts.m | .m | dworkLib-master/labelImgPts.m | 1,562 | utf_8 | e4af4b610cbccc187157d92c5e65fd24 |
function labelImgPts( pts, varargin )
% labelImgPts( pts [, 'scale', scale, 'inlierIndxs', inlierIndxs] )
% This function puts the index of the point onto the image
% It assumes that the image is already displayed and the figure
% is set to the current figure.
% pts - an Nx2 array where the first column is... |
github | ndwork/dworkLib-master | projectVolume.m | .m | dworkLib-master/projectVolume.m | 951 | utf_8 | bf4cf7a61af646f27e0a968a8becdf00 |
function out = projectVolume( vol, H, varargin )
% out = projectImageWithHomography( img, H, [ range ] )
%
% Inputs:
% vol - a 3D array of data to project
% H - the 4x4 homography
% range - An optional 4D array specifying the range to project to
% [xmin xmax ymin ymax zmin zmax]
%
% Written by Nich... |
github | ndwork/dworkLib-master | ctTest.m | .m | dworkLib-master/ctTest.m | 1,763 | utf_8 | dae5b54c3902c469939f9723e47ee746 |
function ctTest
% Demo routine for ct Codes
%
% Written by Nicholas Dwork and Uzair Sikora, Copyright 2013
%
% 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 t... |
github | ndwork/dworkLib-master | imshowscale.m | .m | dworkLib-master/imshowscale.m | 5,592 | utf_8 | 191d3efea346800b6b45efbaea5d26ab |
function imH = imshowscale( img, varargin )
% imshowscale( img, [ scale, 'method', method, 'range', range, 'border', border ] )
% displays figure to the screen where size of image is scaled by scale
%
% Inputs:
% img - 2D array representing the grayscale image or 3D array
% representing the color ima... |
github | ndwork/dworkLib-master | shiftImg.m | .m | dworkLib-master/shiftImg.m | 1,233 | utf_8 | bc3987848bcea93fb7a0833506ed0df8 |
function out = shiftImg( img, shifts )
% out = shiftImg( img, shifts )
%
% Shift the image; shifts are defined according to circshift
% Regions with unknown data are zero filled.
%
% Inputs:
% img - an array of any number of dimensions
% shifts - a 2 element array specifying vertical and horiztonal shi... |
github | ndwork/dworkLib-master | makeC_2D.m | .m | dworkLib-master/makeC_2D.m | 4,761 | utf_8 | 1795bdff2d6dae1eada8a9c1d4e5a416 |
function out = makeC_2D( domTraj, rangeTraj, kCy, kCx, Cy, Cx )
% out = makeC_2D( domTraj, N, kCy, kCx, Cy, Cx )
% or
% out = makeC_2D( N, rangeTraj, kCy, kCx, Cy, Cx )
% or
% out = makeC_2D( domTraj, rangeTraj, kCy, kCx, Cy, Cx )
%
% Makes the circular convolution matrix C as detailed in
% http://nich... |
github | ndwork/dworkLib-master | scatterIntensity.m | .m | dworkLib-master/scatterIntensity.m | 1,114 | utf_8 | 4ba186689f65d15c36bcb32a3b352316 |
function out = scatterIntensity( x, y, z, varargin )
% out = scatterIntensity( x, y, z, options )
%
% Inputs:
% x - 1D array of horizontal values of the scatter points
% y - 1D array of vertical values of the scatter points
% z - 1D array of the intensities of each scatter point
%
% Optional Inputs:
... |
github | ndwork/dworkLib-master | upsample2.m | .m | dworkLib-master/upsample2.m | 2,011 | utf_8 | c41d60748e002cb453fadb0b00b47d32 |
function out = upsample2( img, U, varargin )
% out = upsample2( img, U [, 'S', S, 'sOut', sOut, 'op', op ] )
%
% Inputs:
% img - two dimensional array
% U - upsample factor. Either a scalar (assuming same factor in both dimensions)
% or an array with two elements (one for each dimension)
%
% Optio... |
github | ndwork/dworkLib-master | testDworkLib.m | .m | dworkLib-master/testDworkLib.m | 34,362 | utf_8 | 1f83384a54f6ea03f2b24bc4f862c872 |
function testDworkLib
clear; close all; rng(2);
%% admm
fprintf( '\nTesting admm: \n' );
%minimize ||Ax - b||_2^2 + lambda ||x||+1fa
A = rand( 7, 3 ) * 100;
x = rand( 3, 1 ) * 100;
x0 = zeros( size( x ) );
b = A * x;
lambda = 15;
f = @(x) lambda * norm( x, 1 );
g = @(x) 0.5 * norm( x - b, 2 )^2;... |
github | ndwork/dworkLib-master | calculateVoronoiAreas.m | .m | dworkLib-master/calculateVoronoiAreas.m | 1,155 | utf_8 | 5dd95e33e7843eefdfd7ea2aae31cebe |
function areas = calculateVoronoiAreas( kTraj, bounds )
% areas = calculateVoronoiAreas( kTraj [, bounds ] )
%
% Calculate the areas of each Voronoi cell
%
% Optional Inputs:
% bounds - [ xMin xMax yMin yMax ]
if max( abs( imag( kTraj ) ) ) > 0
kTraj = [ real( kTraj ) imag( kTraj ) ];
end
nTraj ... |
github | ndwork/dworkLib-master | minMax.m | .m | dworkLib-master/minMax.m | 446 | utf_8 | 2c0943592cecce90e1863a23d299487c |
function out = minMax( in )
% out = minMax( in )
% Return the minimum and maximum of the input data as a two element array
%
% Written by Nicholas - Copyright 2016
%
% This software is offered under the GNU General Public License 3.0. It
% is offered without any warranty expressed or implied, including ... |
github | ndwork/dworkLib-master | uifft.m | .m | dworkLib-master/uifft.m | 1,002 | utf_8 | f1884ae1c84284376554db0a150ca95a |
function out = uifft( in, varargin )
% out = uifft( in [, dim ] )
% or
% out = uifft( in [, n, dim ] )
%
% Compute the unitary inverse fft
%
% Written by Nicholas Dwork, Copyright 2019
%
% https://github.com/ndwork/dworkLib.git
%
% This software is offered under the GNU General Public License 3... |
github | ndwork/dworkLib-master | proxGrad.m | .m | dworkLib-master/proxGrad.m | 2,395 | utf_8 | 067eaef2a9c3b2abe0a6b116be8e5944 |
function [xStar,objectiveValues] = proxGrad( x, g, gGrad, proxth, varargin )
% [xStar,objectiveValues] = proxGrad( x, g, gGrad, proxth [, ...
% 't', 'h', h, 'N', N, 'verbose', verbose ] )
%
% This function implements the proximal gradient method.
% This method finds the x that minimizes functions of form g... |
github | ndwork/dworkLib-master | mri_reconSSQ.m | .m | dworkLib-master/mri_reconSSQ.m | 1,153 | utf_8 | 4850868506457853e463e293143050a5 |
function recon = mri_reconSSQ( kData, varargin )
% recon = mri_reconSSQ( kData [, 'multiSlice', true/false ] )
%
% Perform a sum of squared reconstruction
%
% Inputs:
% kData is an array of size ( Ny, Nx, nSlices, ..., nCoils ) of kSpace values
%
% Optional Inputs:
% multiSlice - if set to true, assu... |
github | ndwork/dworkLib-master | calcMetricMDM.m | .m | dworkLib-master/calcMetricMDM.m | 1,044 | utf_8 | 6019fca3b93bdb904d742c500f5eac9d |
function mdm = calcMetricMDM( img, varargin )
% mdm = calcMetricMDM( img [, 'p', p, 'q' q ] )
%
% Calculates the MDM metric based on the Minkowski distance as described
% in "Efficient No-Reference Quality Assessment and Classification Model
% for Contrast Distorted Images" by Nafchi and Cheriet, 2018
%
... |
github | ndwork/dworkLib-master | mri_makeSigConversionMatrix_c2r.m | .m | dworkLib-master/mri_makeSigConversionMatrix_c2r.m | 584 | utf_8 | 436a11722e9ee7d4b63f15fc10cc6639 |
function M = mri_makeSigConversionMatrix_c2r
% M = mri_makeSigConversionMatrix_c2r()
% Create the matrix such that [ Mx; My; z; ] = M [ M_{xy}; M_{xy}^*; Mz; ]
%
% Outputs:
% M - the 3x3 matrix
%
% Written by Nicholas Dwork - Copyright 2018
%
% This software is offered under the GNU General Public Li... |
github | ndwork/dworkLib-master | uifft2.m | .m | dworkLib-master/uifft2.m | 633 | utf_8 | e638be0732d14bd9d93a58d9e1bedfe8 |
function out = uifft2( in )
% out = uifft2( in )
%
% Compute the two-dimensional unitary inverse 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. I... |
github | ndwork/dworkLib-master | ransacRotAndTrans.m | .m | dworkLib-master/ransacRotAndTrans.m | 2,065 | utf_8 | 8df5e8b585bc60b13e5746ee3069cbce |
function [R,t,inlierIndxs] = ransacRotAndTrans( pts1, pts2, thresh )
% [R,t,inlierIndxs] = ransacRotAndTrans( pts1, pts2, thresh )
% This function finds the rotation matrix R and the translation matrix t
% such that pt2 = R * pt1 + t;
% It implements RANSAC with the Kabsch algorithm
% https://en.wikipedia.... |
github | ndwork/dworkLib-master | polyFit2.m | .m | dworkLib-master/polyFit2.m | 2,239 | utf_8 | 51e539f0398b14e28b543f1e4d444fb6 |
function c = polyFit2( x, y, z, xOrder, yOrder, varargin )
% c = polyFit2( x, y, z, xOrder, yOrder [, 'w', w, 'cMask', cMask ] )
%
% Determines the matrix c that minimizes
% || z - \sum_{u=0,v=0}^{xOrder,yOrder} c_{u,v} x^u y^v ||_2
%
% Inputs:
% x - a 1D array specifying the x coordinates
% y - a 1... |
github | ndwork/dworkLib-master | checkProxConj.m | .m | dworkLib-master/checkProxConj.m | 1,784 | utf_8 | 0df2e9df65c2d6f58256829e0d710da8 |
function [ out, err ] = checkProxConj( x, prox, proxConj, varargin )
% [ out, err ] = checkProxConj( x, prox, proxConj [, 'tol', tol, 'nRand', nRand )
%
% Uses the Moreau decomposition to see if the proximal operator and the proximal
% operation of the conjugate function are correctly related.
%
% Written ... |
github | ndwork/dworkLib-master | proxConjHuber.m | .m | dworkLib-master/proxConjHuber.m | 1,101 | utf_8 | 5ff0a72c1b811993a8d4581f73847791 |
function out = proxConjHuber( x, sigma, t, mu, b )
% out = proxConjHuber( x, sigma, t, mu )
%
% Calculates the proximal operator of sigma times the conjugate of f(x) = t * huber( x - b, mu ).
% It uses the Moreau decomposition to calculate the proximal operator of the conjugate.
%
% Inputs:
% x - an
% ... |
github | ndwork/dworkLib-master | findHarrisCorners.m | .m | dworkLib-master/findHarrisCorners.m | 2,195 | utf_8 | a1dd36329aff752e43612078a156d8fe |
function corners = findHarrisCorners( img, varargin )
% corners = findHarrisCorners( img [, N, 'buffer', buffer, 'w', w, 'k', k ] )
%
% Inputs:
% img - a 2D array
% N - the number of features to identify (default is 50)
% buffer - the minimum spacing between features (default is 20)
% w - the width of t... |
github | ndwork/dworkLib-master | fftnh.m | .m | dworkLib-master/fftnh.m | 549 | utf_8 | 027d14f4858757c05b0ad6678ae64b08 |
function out = fftnh( in )
% out = fftnh( in )
%
% Compute the adjoint of the n 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 expre... |
github | ndwork/dworkLib-master | goldenSectionSearch.m | .m | dworkLib-master/goldenSectionSearch.m | 2,455 | utf_8 | 23fbda72a2abcd29c9fcc63a482a7b23 |
function [out,iterationIndx] = goldenSectionSearch( f, LB, UB, varargin )
% [out,iterationIndx] = goldenSectionSearch( f, LB, UB [, ...
% 'tol', tol, 'nMax', nMax ] )
%
% finds the minimal point of the function f using a binary search
% Written according to the notes written by Wotao Yin at
% http://www.... |
github | ndwork/dworkLib-master | withinPolyhedron.m | .m | dworkLib-master/withinPolyhedron.m | 2,801 | utf_8 | 582c887a23e4cfb5bf8cfbd73dc6c961 |
function status = withinPolyhedron( triangles, p )
% status = withinPolyhedron( polyhedron, p )
% determines if a given number of points is within a polyhedron
%
% Inputs:
% triangles - concatenated n triangles that each have 3 rows and 3
% columns, which are polyhedron vertex coordinates of triangula... |
github | ndwork/dworkLib-master | dworkLib.m | .m | dworkLib-master/dworkLib.m | 536 | utf_8 | 1b369a157106d0be3fe871cf8c3f7533 |
function dworkLib( varargin )
% dworkLib( [ pattern, inFilename ] )
%
% Optional Inputs
% pattern - file must contain this search pattern in order to be listed.
% inFilename - only search filenames
%
% Written by Nicholas - Copyright 2016
%
% This software is offered under the GNU General Public Lice... |
github | ndwork/dworkLib-master | mri_makeSigConversionMatrix_r2c.m | .m | dworkLib-master/mri_makeSigConversionMatrix_r2c.m | 569 | utf_8 | 41576b97989e9b3f55ee9d854767e0f6 |
function M = mri_makeSigConversionMatrix_r2c
% M = mri_makeSigConversionMatrix_r2c()
% Create the matrix such that [ M_{xy}; M_{xy}^*; Mz; ] = M [ Mx; My; z; ]
%
% Outputs:
% M - the 3x3 matrix
%
% Written by Nicholas Dwork - Copyright 2018
%
% This software is offered under the GNU General Public Li... |
github | ndwork/dworkLib-master | isHermitian.m | .m | dworkLib-master/isHermitian.m | 1,527 | utf_8 | 82f18dbe199af876ef45754a0f56f1e6 |
function [out,error] = isHermitian( data, varargin )
% [out,error] = isHermitian( data, [ threshold ] )
% Determines whether or not the real part of data is even and the
% imaginary part is odd (with circular boundary conditions)
% Indexes are defined according to fftshift
%
% Inputs:
% data is a 1D or... |
github | ndwork/dworkLib-master | structuralBilateralFilter.m | .m | dworkLib-master/structuralBilateralFilter.m | 6,066 | utf_8 | 9d5d58b5c071c0570d536de02156223c | function out = structuralBilateralFilter( img, varargin )
%out = structuralBilateralFilter( img, [ 'kSize', kSize, ...
% 'searchSize', searchSize, 'sigmaS', sigmaS, 'sigmaD', sigmaD ] );
%
% Inputs
% img: the input image to be denoised (a 2D array)
% kSize: (optional) the length of each side of the kerne... |
github | ndwork/dworkLib-master | findTransRotWithPCC.m | .m | dworkLib-master/findTransRotWithPCC.m | 1,172 | utf_8 | 29b53200777e3a41393443550cb455f5 |
function [vShift, hShift, rotation] = findTransRotWithPCC( img1, img2, ...
varargin )
% [vShift, hShift, rotation] = findTransRotWithPCC( img1, img2 [, ...
% 'dTheta', dTheta] )
%
% Finds translation and rotation so that
% img2 = Rotation( Translation( img1 ) )
%
% Output:
% vShift = the vertical... |
github | ndwork/dworkLib-master | findDistsBetweenPtsAndLine.m | .m | dworkLib-master/findDistsBetweenPtsAndLine.m | 1,046 | utf_8 | 51bd59e2962e0c98ba1042fbf5d45d76 |
function dists = findDistsBetweenPtsAndLine( pts, line )
% dist = findDistBetweenPtsAndLine( pts, line )
%
% Inputs:
% pts - a MxN real array specifying the coordinates of the points
% M is the dimension of the space; N is the number of points
% line - a structure containing two elements: pt and vec
% ... |
github | ndwork/dworkLib-master | lsqrTV.m | .m | dworkLib-master/lsqrTV.m | 3,780 | utf_8 | 185b4c34b05d15b9da96a9e2f1f2ffed |
function [xStar,oValues] = lsqrTV( applyA, b, x0, lambda, varargin )
% xStar = lsqrTV( A, b, x0, lambda [, sigma, tau, 'theta', theta, ...
% 'nIter', nIter ] );
%
% Solves the following regularized least squares optimization problem
% minimize (1/2)|| A x - b ||_2^2 + lambda TV(x)
% Uses Chambolle-Pock... |
github | ndwork/dworkLib-master | proxShiftScale.m | .m | dworkLib-master/proxShiftScale.m | 692 | utf_8 | df5c29ff484d723d5869d297942aee26 |
function out = proxShiftScale( f, x, a, b )
% Computes the proximal operator of f( a x - b )
%
% Inputs:
% f - a function handle to the proximal operator
% x - the domain value for proximal operator evaluation
% a - (scalar) the scaling of the domain variable
% b - the shifting of the domain variable
%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.