Skip to content
Snippets Groups Projects
Commit 78cb64bd authored by Wolfgang Ludwig's avatar Wolfgang Ludwig
Browse files

defining detector reference position defined by separate function

parent ef9ebba8
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,8 @@ if (~isfield(parameters.labgeo, 'omstep') || isempty(parameters.labgeo.omstep))
end
% Updating recgeo with a consistent set of parameters
parameters.recgeo = gtGeoRecDefaultParameters(parameters.detgeo, parameters.samgeo, parameters.acq);
%parameters.recgeo = gtGeoRecDefaultParameters(parameters.detgeo, parameters.samgeo);
% parameters.recgeo = gtGeoRecDefaultParameters(parameters.detgeo, parameters.samgeo, parameters.acq);
parameters.recgeo = gtGeoRecDefaultParameters(parameters.detgeo, parameters.samgeo);
gtSaveParameters(parameters);
gtDBConnect();
......
......@@ -52,7 +52,7 @@ elseif (~acq.no_direct_beam)
% Should take sample envelope from sample bbox (parameters.acq.bb) if
% exists, otherwise in gtPreprocessing
if (isfield(acq, 'bb') && ~isempty(acq.bb))
par_detgeo.detrefpos(2:3) = sfDetrefpos(acq.bb, par_detgeo);
par_detgeo.detrefpos(2:3) = gtGeoDetRefPos(acq.bb, par_detgeo);
end
elseif (acq.no_direct_beam && strcmp(acq.detector_definition, 'inline'))
......@@ -70,7 +70,7 @@ elseif (acq.no_direct_beam && strcmp(acq.detector_definition, 'inline'))
acq.bb = [acq.xdet/2-50 acq.ydet/2-50 100 100];
end
if (isfield(acq,'bb') && ~isempty(acq.bb))
par_detgeo.detrefpos(2:3) = sfDetrefpos(acq.bb, par_detgeo);
par_detgeo.detrefpos(2:3) = gtGeoDetRefPos(acq.bb, par_detgeo);
end
disp('Choose a squared sample bounding box in the center of the image...')
end
......@@ -83,18 +83,15 @@ end % end of function
%%%%%%%%%%%%%%%%%%%%%
% SUB-FUNCTIONS
%%%%%%%%%%%%%%%%%%%%%
% has been moved to gtGeoDetRefPos
function d_yz = sfDetrefpos(acq_bb, par_labgeo)
% Returns the detector lateral (Y) and vertical (Z) positions which approximately
% account for an offset of the sample bounding box position:
% Y lateral: It assumes that the projection of the rotation axis is at the
% center of the sample bounding box.
% Z vertical: By definition we set the detector center as 0 position
%
% NB: Obsolete definition: Vertical center of the sample bounding (beam center) corresponds to Z=0.
% Vertical center of the sample bounding (beam center) corresponds to Z=0.
% It assumes rotpos = [0 0 0] and view into the beam.
d_yz(1) = -((acq_bb(1) + acq_bb(3)/2) - par_labgeo.detrefu - 0.5) * par_labgeo.pixelsizeu;
%d_yz(2) = ((acq_bb(2) + acq_bb(4)/2) - par_labgeo.detrefv - 0.5) * par_labgeo.pixelsizev;
d_yz(2) = 0; % By definition
d_yz(2) = ((acq_bb(2) + acq_bb(4)/2) - par_labgeo.detrefv - 0.5) * par_labgeo.pixelsizev;
end
\ No newline at end of file
function d_yz = gtGeoDetRefPos(acq_bb, detgeo)
% Returns the detector lateral (Y) and vertical (Z) positions which approximately
% account for an offset of the sample bounding box position:
% Y lateral: It assumes that the projection of the rotation axis is at the
% center of the sample bounding box.
% Vertical center of the sample bounding (beam center) corresponds to Z=0.
% It assumes rotpos = [0 0 0] and view into the beam.
d_yz(1) = -((acq_bb(1) + acq_bb(3)/2) - detgeo.detrefu - 0.5) * detgeo.pixelsizeu;
d_yz(2) = ((acq_bb(2) + acq_bb(4)/2) - detgeo.detrefv - 0.5) * detgeo.pixelsizev;
end
\ No newline at end of file
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