Skip to content

Instantly share code, notes, and snippets.

@tonyfast
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyfast/683ed3dbbd0dc6a37087 to your computer and use it in GitHub Desktop.
Save tonyfast/683ed3dbbd0dc6a37087 to your computer and use it in GitHub Desktop.
Accessing Fiber Position Information for Anna E Scott and Hrishikesh Bale's Fiber CT Data

Parsing Fiber Composite Information

The below Matlab code reads the information I have shared on my Dropbox. I am testing the conversion of the data using Hrishi's data only. But the code, that exports the datapoints to the zip archive is the same for Hrishi's and Anna's data

Download

Fiber Analytics Information is shared on my Public Dropbox. In each file there is a boatload of of csv files. Each column respectively corresponds to

  1. X-position
  2. Y-position
  3. PHI
  4. THETA
  5. Voronia Volume (micron^2)
  6. Neighbor Change (1 if change and zero otherwise)

Visualization of SiC/SiC Fiber positions

SiC/SiC Fiber Position

The fiber positions within each layer are in units of microns. Each layer is represented as an index in the visualization.

Effect of Layer Indexing versus the Layer Metric space

In the calculations of inter-layer parameters, I have assured that codes work in the Eucledean metric space rather than using the layer indices.

%% 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
FiberIndex = [1 200 101 300];
for ii = 1 : 3000
% Loop over each layer
s = sprintf('%04i',ii);
% Full file name for the layer with the path include
fn = fullfile( loc,s(1),s(2),sprintf( '%s.csv',s));
if exist( fn, 'file')
% If the file exists
% Read all the data
D = csvread( fn );
% Structure the data
for jj = 1 : numel( FiberIndex );
[ data(jj).x(ii) data(jj).y(ii) data(jj).z(ii)] = ...
deal( D(FiberIndex(jj),1),D(FiberIndex(jj),2),ii );
end
% Output text
if mod(ii,100) == 0
disp(sprintf('File %i',ii));
end
else
% Break if it doesn't
disp( sprintf('There are %i total layers.',ii));
return
end
end
%% Visualize the Fiber Positions
for jj = 1 : numel( FiberIndex );
subplot(2,2,jj);
h = plot([data(jj).x; data(jj).y]', 'o-','LineWidth',3);
if jj == 4
legend( h, 'X-Position','Y-Position','Location','Best')
end
ylabel('In-Layer Position \mum','Fontsize',14)
xlabel('Layer in dimensions of voxels','Fontsize',14)
title( sprintf('Fiber Number %i', FiberIndex(jj)),'Fontsize',14)
grid on;
set( gca,'Fontsize',12)
end
set( gcf,'Position',get(0,'ScreenSize'))
saveas( gcf,'Hrishi-Test.png');
figure(gcf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment