This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% Motivation | |
| % This Matlab function is motivated by http://tonyfast.com/nsf-goali/2014/08/29/Peak-Finding/ | |
| %% Example use of Find_Peaks on a 2-D array | |
| N = 100; | |
| % Example Dataset | |
| T = peaks( N ); | |
| %% Find Peaks using the default filter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filename = 'macadamia.mat' | |
| if ~exist( filename, 'file' ); | |
| urlwrite( ... Write a url to a file | |
| 'https://dl.dropboxusercontent.com/u/22455492/natural-3d/macadamia.mat', ... The requested url | |
| filename ) | |
| end % if:~exist | |
| %% | |
| load( filename ); % Variable is input as structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function edge = binary_edge( image ) | |
| % An approximate algorithm for finding edges in binary images. | |
| % | |
| % The algorithm shifts the images one voxel in each direction. | |
| % It compares the difference betwee the original image and the shifted image. | |
| % Nonzero values indicate edge values | |
| DIMS = ndims(image); | |
| shifts = vertcat( eye(DIMS), ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d = cd | |
| paths = strsplit( genpath( d ), ':' ); | |
| fo = fopen( 'list.txt', 'w') | |
| for pp = 1 : numel( paths ) | |
| ff = dir( paths{ pp } ) | |
| [~,b] = fileparts(paths{pp}) | |
| if numel( ff ) > 0 & numel(strfind(paths{pp},'.git')) == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn = tempname; | |
| urlwrite( 'http://yamlmatlab.googlecode.com/files/YAMLMatlab_0.4.3.zip', ... YAMLUrl | |
| fn ); | |
| unzip( fn, './yaml-matlab' ) | |
| delete( fn ); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| normalize = @(A)( A-min(A(:)) ) ./ ( max(A(:)) - min(A(:)) ) | |
| adjust = @(A)reshape( ... back to original shape | |
| imadjust( ... adjust image | |
| reshape( ... flatten to 2-D image | |
| normalize(A), ... normalize from zero to one | |
| size(A,1), numel(A)./size(A,1))), ... Reshape to 2-D array | |
| size(A) ... Reshape back to original size | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% Example use of simplecluster | |
| X = rand(20,2); | |
| cutoff = .1; | |
| [ Xf, class ] =simplecluster( X, cutoff ); | |
| h(1) = scatter( X(:,1), X(:,2), 50, class, 'filled'); | |
| set(h(1), 'MarkerEdgeColor','k') | |
| hold on | |
| h(2) = plot( Xf(:,1), Xf(:,2), 'k+', ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [MF, bins ] = noneigen( X, xx ); | |
| %% | |
| % X :: values to be binned | |
| % xx :: cellarray for the local state space | |
| dims = cumprod(cellfun(@(x)numel(x),xx)); | |
| %% | |
| MF = zeros( size(X,1), ... | |
| dims(end) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % FASTRADIAL - Loy and Zelinski's fast radial feature detector | |
| % | |
| % An implementation of Loy and Zelinski's fast radial feature detector | |
| % | |
| % Usage: S = fastradial(im, radii, alpha, beta) | |
| % | |
| % Arguments: | |
| % im - Image to be analysed | |
| % radii - Array of integer radius values to be processed | |
| % suggested radii might be [1 3 5] |