This is what I have so far which seams to do fine:
d=dir('*.cma'); & find all files from the Pyrocam III
for ii= 1:length(d)% 1:1%
data=importdata(d(ii).name);
data=data(55:end,:); % remove bad pixels
data=data./max(data(:)).*exp(2); % normalize and multiply by e^2
% data(data<0)=0; % Remove negative values, (not needed here)
%
% figure(1);clf
% imagesc(data);
% axis image; hold on
% colormap('jet');
% pause(0.01) % to see that it looks reasonable
% Draw contour
[C,h] = contour(data,'LineWidth',2, 'LevelList',1, 'LineColor','r');
% Calculate Horizontal and Vertical extent multiply by 0.1 mm/px
Hw(ii)=(max(C(1,2:end))-min(C(1,2:end)))*.1;
Vw(ii)=(max(C(2,2:end))-min(C(2,2:end)))*.1;
end