Skip to content

Instantly share code, notes, and snippets.

@tonyfast
tonyfast / Pop-ND
Created April 10, 2014 20:38
Populate values in an N-D Matlab array from the indices
sz = [ 10 10 10 3];
N = prod(sz);
% Indices into elements - Absolute indices
uid = unique( round(N*rand(100,1)));
% Values of the elements
values = rand(numel(uid),1);
@tonyfast
tonyfast / Top-Values-No-Sort
Created April 16, 2014 01:14
A Masked N-D array containing only the first M lowest values
%% A code to find the N highest or lowest values in a N-D array without using sort.
N = [10 10 10];
% nbins is an approximate
% higher values improve accuracy but lower efficiency
nbins = 101;
chopto = 100; % Chop to the first hundred values approximately
@tonyfast
tonyfast / Fiber-Feature-Extraction.markdown
Created May 7, 2014 15:03
Extracting Features in Volumetric Fiber Datasets

Binary Volumetric Fiber Composite Datasets

These steps organize the approach to extracting information about fiber data in 3-D volumetric datasets where the fibers are isolated from the matrix and other features.

Feature Indentification

  1. Label the Fibers

Erode the binary 3-D volume to about half of the expected radius of the fibers. Use a watershed method or something similar to bwlabeln in Matlab to seed the fiber indices. Dilate the image with the same filter you used to erode it. Mask the dilated image with the binary image. The masking process will assure that the index fibers have the same shape of the original data. There will be an issue with touching fibers when you dilate them. Dilation takes the maximum value in a filter window and assigns that to the pixel of interest. The largest index of touching fibers will overtake the lower index, but this should be easy to fix. There is a bit of uncertainty here that should

@tonyfast
tonyfast / Matlab-Converter.m
Last active August 29, 2015 14:01
Accessing Fiber Position Information for Anna E Scott and Hrishikesh Bale's Fiber CT Data
%% Dropbox path information
% The data I am visualizing is unzipped to the following path
loc = './Data/export/Hrishi/';
data = struct; % Initialize export variable
%% Import the data
% The fiber index we will visualize
@tonyfast
tonyfast / readme.markdown
Last active August 29, 2015 14:01
Schematic for the meaning of the Interfacial Shape Distribution Function

The Interfacial Shape Distribtion

The ISD describes the distribution of grain interface curvatures in a 2/3-D material volume. The 2-tuple of the first and second principal curvatures define the genus of the interface. The following figure indicates the different genus of interfaces that are realized in a 3-D volume.

ISD

A 2-D volume will require one value to describe the curvature.

Interpretting the ISD

@tonyfast
tonyfast / READ_STRAIN.M
Created June 13, 2014 18:12
Reads Elastic Strain Files for MKS calibration data
function [ M, P, file_handle] = Read_Elastic_Strain_Files( directory_location, samp_num )
responseOI = 1;
% this function is used for reconstruction and calibration
evalin( 'base', 'method = ''Elastic'';');
[ dirtemp ] = textscan( directory_location, '%s','delimiter','\\');
directory_str = dirtemp{1}{end};
file_handle = directory_str;
@tonyfast
tonyfast / gh.html
Last active August 29, 2015 14:02
A HTML view of the Github Pages hosted by a User
---
---
<!--
This code can be hosted on a users Github pages repository ( username.github.io ) to
aggregate the homepages attached to their repositories. This code uses the
Create a simple bootstrap page to showcase a user's Github repository Homepages.
There is a statement that assumes the user's name is in their homepage name.
Hosting on Github pages (i.e. username.github.io) is perfect for this script.
-->
@tonyfast
tonyfast / simple_conv.m
Created June 25, 2014 14:34
Matlab N-D Simple Filtering Using Fourier Transforms
function convolved = simple_conv( Image, Filter )
% A simple Fourier Convolution Function written in matlab.
% It works on N-D arrays and N-D filters.
%%
% Dimensionality of input image
nDim = ndims( Image );
%% Make a filter the same size as the image
@tonyfast
tonyfast / readme.markdown
Last active August 29, 2015 14:03
A Github Stack for Templating Pre-competitive Research Metadata

Abstract

Collaborative sciences source lexicons from disparate domains. Collaborative research science can not only be machine readable, but it must be human readable and accessible with minimal transaction cost. This document outlines the use of YAML (A human readable markup language), Jekyll (A templating language), and Github Pages (A generous and cheap web server provided by Github) to deploy pre-competitive research results.

Templating + Markup Language

A markup language processes data to be used in a presentation layer. Template languages can take simmilar/dis-simmilar information and present it to the user as a document, webpage, or flat text file.

Example

@tonyfast
tonyfast / Lab-To-Cloud.md
Last active August 29, 2015 14:04
Lab to the cloud on a dime

Abstract

A simple stack for sharing research data on the fly using Windows 7 + SyncToy + Task Scheduler + Dropbox. This is information generated from a Agilent Nanoindentation machine; it include raw data, processed reports, and visualizations as metadata.

Motivation

Many users generate information from a single piece of experimental equipment. This machine is a standalone desktop system that is networked. Also, the equipment is available for general use with our Shared Resources Equipment at Georgia Tech. Often users move small packets of information with thumb drives or email; there is no reason to sacrifice expediency for something that can be automated. This description aims to expedite this process on a budget.

How it works