Skip to content
Snippets Groups Projects
Commit 3398d248 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

gtFedTestLoadData: added the possibility to specify the blobs to project

parent 8719046f
No related branches found
No related tags found
No related merge requests found
...@@ -223,10 +223,21 @@ grain.proj(1:num_dets) = struct( ... ...@@ -223,10 +223,21 @@ grain.proj(1:num_dets) = struct( ...
'gvb', []); 'gvb', []);
for n = 1:num_dets for n = 1:num_dets
ondet = find(grain.allblobs.detector(n).ondet); % Checking if we should just project all of them, or wether the user
nbl = numel(ondet); % has something to say abou it.
if (isfield(fedpars, 'detector'))
ondet = fedpars.detector(n).ondet;
included = fedpars.detector(n).included;
selected = fedpars.detector(n).selected;
else
ondet = find(grain.allblobs.detector(n).ondet);
included = (1:nbl)';
selected = true(size(included));
end
nbl = numel(included);
is_nearfield = norm(detgeo(n).detrefpos) < 30; is_nearfield = norm(detgeo(n).detrefpos) < 90;
% If it is farfield, we should adjust the voxel size to be 1/4 of the % If it is farfield, we should adjust the voxel size to be 1/4 of the
% pixel size % pixel size
if (~is_nearfield) if (~is_nearfield)
...@@ -242,9 +253,6 @@ for n = 1:num_dets ...@@ -242,9 +253,6 @@ for n = 1:num_dets
bl = repmat(gtFedBlobDefinition(), nbl, 1); bl = repmat(gtFedBlobDefinition(), nbl, 1);
gvb = []; gvb = [];
included = (1:nbl)';
selected = true(size(included));
for ii = 1:nbl for ii = 1:nbl
% Load diffraction paramaters of blobs % Load diffraction paramaters of blobs
ii_b = ondet(included(ii)); ii_b = ondet(included(ii));
...@@ -282,7 +290,11 @@ for n = 1:num_dets ...@@ -282,7 +290,11 @@ for n = 1:num_dets
bl(ii).u0im = grain.allblobs.detector(n).uvw(ii_b, :); bl(ii).u0im = grain.allblobs.detector(n).uvw(ii_b, :);
% Padding around blob volume % Padding around blob volume
bl(ii).addbl = fedpars.blobsizeadd(n, :); if (isfield(fedpars, 'detector'))
bl(ii).addbl = fedpars.detector(n).blobsizeadd;
else
bl(ii).addbl = fedpars.blobsizeadd(n, :);
end
end end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -331,7 +343,6 @@ for n = 1:num_dets ...@@ -331,7 +343,6 @@ for n = 1:num_dets
gvcs = gv.cs; gvcs = gv.cs;
for ii = nbl:-1:1 for ii = nbl:-1:1
% gvb(ii).uc0bl = zeros(size(gvcs), fedpars.gvtype);
gvb(ii).uc = zeros(size(gvcs), fedpars.gvtype); gvb(ii).uc = zeros(size(gvcs), fedpars.gvtype);
gvb(ii).ucd = zeros(size(gvcs), fedpars.gvtype); gvb(ii).ucd = zeros(size(gvcs), fedpars.gvtype);
gvb(ii).ucblmod = zeros(size(gvcs), fedpars.gvtype); gvb(ii).ucblmod = zeros(size(gvcs), fedpars.gvtype);
...@@ -394,20 +405,6 @@ for n = 1:num_dets ...@@ -394,20 +405,6 @@ for n = 1:num_dets
bl(ii).mbbw(2) - bl(ii).mbbw(1) + 1 ]; bl(ii).mbbw(2) - bl(ii).mbbw(1) + 1 ];
end end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Angle between consecutive blobs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for ii = 1:nbl
nii = mod(ii, nbl) + 1;
fedpars.blobnextang(ii) = abs(bl(ii).plsam*bl(nii).plsam');
fedpars.blobnextang(ii) = min(fedpars.blobnextang(ii), 1);
fedpars.blobnextang(ii) = acosd(fedpars.blobnextang(ii));
fedpars.blobnextdet(ii) = abs(det(bl(ii).U0*bl(nii).U0'));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Transform into single %%% Transform into single
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
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