diff --git a/zUtil_ForwardSim/gtSetupForwardSimulation.m b/zUtil_ForwardSim/gtSetupForwardSimulation.m index 35f0dd49564b49cb60f69ec82d7dd023eaf9ee01..daa483a907675bd976e452a1da111ac9755cab9d 100644 --- a/zUtil_ForwardSim/gtSetupForwardSimulation.m +++ b/zUtil_ForwardSim/gtSetupForwardSimulation.m @@ -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(); diff --git a/zUtil_Geo/gtGeoDetDefaultParameters.m b/zUtil_Geo/gtGeoDetDefaultParameters.m index ed267cb3618d0456a8c8cdf8730a7e19a6f5199c..8bc9da259705c3dc37e6e4dc9e3c2320d1aa85cf 100644 --- a/zUtil_Geo/gtGeoDetDefaultParameters.m +++ b/zUtil_Geo/gtGeoDetDefaultParameters.m @@ -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 diff --git a/zUtil_Geo/gtGeoDetRefPos.m b/zUtil_Geo/gtGeoDetRefPos.m new file mode 100644 index 0000000000000000000000000000000000000000..7436c982d2b880ef189e7ed2a9d63157c7c13c25 --- /dev/null +++ b/zUtil_Geo/gtGeoDetRefPos.m @@ -0,0 +1,11 @@ +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