Skip to content

Instantly share code, notes, and snippets.

@tonyfast
tonyfast / .description.markdown
Last active August 29, 2015 14:07
A naive segmentation function for N-D datasets

A non-thresholding method for image segment

This naive function:

  • Computes the PDF and CDF of a 2-D or 3-D images with nbins in the histogram.
  • Fit npeaks number of peaks to the PDF
  • Compute the probability of each voxel belonging to each phase.
  • Decide on the phase based on the greatest probability.

Usage

@tonyfast
tonyfast / remove.git
Created October 14, 2014 20:24
Remove a single file from the Git history
git filter-branch --tree-filter 'rm -f _data/Cropped_fiber_matrix_400_400.mat' HEAD
@tonyfast
tonyfast / Spatial-Statistics.ipynb
Last active August 29, 2015 14:08
Spatial Statistics Start
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tonyfast
tonyfast / tasks.md
Created October 25, 2014 13:54
An example using the Checklist Syntax for Markdown
  • Pick the flowers
  • Call John 9303032332
  • Cancel cable subscription
  • Book the flight tickets
@tonyfast
tonyfast / flick_json2static.m
Created November 20, 2014 01:49
Use Flickr API Explorer response to parse raw flickr image URLs
function url = flick_json2static( response )
% Convert flickr json app response into a static image url.
% Go to flickr's app garden and generate a jsonified list of a photosets
% contents.
%
% https://www.flickr.com/services/api/explore/flickr.photosets.getPhotos
%
% The id for the photoset can be found the url for the set.
%
% response is the contents of set.photoset.photo{%i}
@tonyfast
tonyfast / README.md
Last active August 29, 2015 14:10
A Javascript Sandbox for YAML.

YAML Sandbox in Javascript

A javascript tool to explore YAML usage and syntax. YAML is a simple data serialization language that is parsed into JSON. It provides comments and more canonical syntax than JSON.

How to Use

@tonyfast
tonyfast / iPCA.m
Created November 30, 2014 13:31
Iterative Principal Component Analysis
function [Un, mn, An, S, nr] = iPCA(x, U, m, A, max_dim)
% Execute incremental PCA analysis
% Input
% x - new input vector (Dx1)
% Uo - Last basis (Dxd)
% mo - last mean (Dx1)
% Ao - last coefficients (dxn)
% max_dim - maximum number of dimensions to consider, if this not
% prescribed or null then the function augments the basis accorindgly
@tonyfast
tonyfast / README.md
Last active March 5, 2022 18:56
Mermaid - Markdown for diagrams

Mermaid - Markdown for Diagrams

Mermaid has been popping up in my Github Daily Emails. It is used for "Generation of diagram and flowchart from text in a similar manner as markdown".

Example Usage

In index.html, a Mermaid diagram is defined within a <div class="mermaid">. A chuck of Mermaid syntax is place in between the block element. The syntax determines the shape, connections, and text annotating the diagram. Below is some syntax that generates the graph on bl.ocks.org.

Example Syntax

@tonyfast
tonyfast / blog-to-data.ipynb
Last active August 29, 2015 14:10
Using Jekyll blog posts as data in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tonyfast
tonyfast / README.md
Last active August 29, 2015 14:11
test

First Section

Here is some text and this is some data about camels {{joe.camel}}

Next section

Glossary {{records.glossary.title}}

New Experiment