Skip to content
Snippets Groups Projects
Commit ec36f680 authored by Laura Nervo's avatar Laura Nervo Committed by Nicola Vigano
Browse files

FED code debugging


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@130 4c865b51-4357-4376-afb4-474e03ccb993
parent 3f3829a3
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,8 @@ for grainid = first:last
% run the solver for this step
[gv,bl,err] = gtFedSolve(gv,bl,[],[],[],fedgrain);
save(err_name, 'err');
save(err_name,'err');
% make and save omega images
bl=gtFedMakeOmegaImages(bl, 0);
......@@ -180,4 +180,4 @@ for grainid = first:last
end % loop through grains
end % end of function
\ No newline at end of file
end % end of function
function bl = gtFedMakeOmegaImages(bl, display_flag)
function bl = gtFedMakeOmegaImages(bl, calculate_flag)
% bl = gtFedMakeOmegaImages(bl, [display_flag])
%
% display_flag = 1 display, don't calculate {1}
% 2 display and calculate ?
% calculate_flag = 0 display, don't calculate <logical> {0}
% 1 display and calculate
%
% tool for viewing blobs from FED
% add images to the bl structure
if ~exist('display_flag','var') || isempty(display_flag)
display_flag=1;
if ~exist('calculate_flag','var') || isempty(calculate_flag)
calculate_flag=0;
end
% omega centre of mass images
if display_flag~=2 % just display, don't calculate
if ~calculate_flag
for i=1:length(bl)
imm=nan(size(bl(i).intm, 1), size(bl(i).intm, 2));
imfed=nan(size(imm));
om=1:size(bl(i).intm, 3);
for x=1:size(bl(i).int0, 1)
for y=1:size(bl(i).int0, 2)
......@@ -40,7 +35,7 @@ if display_flag~=2 % just display, don't calculate
end
end
parameters=[];
% mask edges of the measured image, to reduce it to approx the size of
% the thresholded spot, rather than the dilated size used in the FED
% not appropriation for alumina where blobs come from DB
......@@ -53,6 +48,7 @@ if display_flag~=2 % just display, don't calculate
mask=imerode(mask, ones(10, 10));
imm=imm.*mask;
end
clear parameters
offset_m=min(imm(find(imm))); % smallest non-zero value
offset_fed=min(imfed(find(imfed)));
......@@ -66,11 +62,8 @@ if display_flag~=2 % just display, don't calculate
bl(i).imm_omega=imm;
bl(i).imfed_omega=imfed;
end
end
if display_flag
end % end for
else
grid=ceil(sqrt(length(bl)));
fh=figure;
fh595=figure;
......@@ -168,8 +161,7 @@ if display_flag
saveas(fh595, 'blob_omega_images_595.png', 'png');
fclose(fid);
end
end % end calculate_flag==true
end % end of function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment