Read HKL Technologies EBSD *.ctf

141 views
Skip to first unread message

David.M...@gmail.com

unread,
Oct 21, 2008, 2:51:35 AM10/21/08
to MTEX
I have written my first M-file (hence rather primative, but works !)
to read HKL technologies EBSD export file *.ctf . I am sure this could
be improved, it is rather slow at reading big data sets. The M-file
reads all the parameters in the *.ctf file, which includes the
crystallographic data for each phase, the phase number, the SEM kV
etc.

any comments welcome.

all the best David Mainprice

fl.ba...@googlemail.com

unread,
Oct 21, 2008, 5:24:56 AM10/21/08
to MTEX
may be faster
in read_ctf.m
[...]
% Data file line by line
% Phase X Y Bands Error Euler1 Euler2 Euler3 MAD BC BS
%
status = fclose(fid);
EBSD_Array = dlmread(filename,'\t',17,0);
%
% NG=0;
% while ~feof(fid)
% EBSD_Line=textscan(fid,'%u %f64 %f64 %u %u %f64 %f64 %f64 %f64
%u %u',1,'delimiter','\t');
% % check that cell EBSD_Line is not empty
% if ~isempty(EBSD_Line{1})
% NG=NG+1;
% % copy cell EBSD_Line into numerical array EBSD_Array(NG,k)
% for k = 1:11
% EBSD_Array(NG,k) = double(EBSD_Line{k});
% end
% end
% end

%% Close the *.ctf File
% status = fclose(fid);
%
%% Search for indexed EBSD orientation pixels

NG = numel(EBSD_Array(:,1));
NINDEX = numel(EBSD_Array(EBSD_Array(:,1) > 0));
PERCENT=100.0*NINDEX/NG;

% % Counter for number of indexed points - NINDEX
% NINDEX=0;
% % Counter for number of indexed points per phase
% for K=1:NPHASES{1}
% NPHASE(K)=0;
% end
% for N=1:NG
% % phase index number = EBSD_Array(N,1)
% if EBSD_Array(N,1)>0
% % Indexed point
% NINDEX=NINDEX+1;
% % Indexed point with composition given by EBSD_Array(N,1)
% NPHASE(EBSD_Array(N,1))=NPHASE(EBSD_Array(N,1))+1;
% end
% end
% % Percentage of Indexed Pixels
% PERCENT=100.0*NINDEX/NG;
[..]
% nicer percentage
disp(sprintf(' Percentage of Indexed Pixels = %4.2f', PERCENT))

fl.ba...@googlemail.com

unread,
Oct 21, 2008, 5:33:04 AM10/21/08
to MTEX
(seems that we can post only 13 lines)
later:
Reply all
Reply to author
Forward
0 new messages