Skip to content
Snippets Groups Projects
Commit ab6bad35 authored by preischig's avatar preischig
Browse files

gtMatchInitialize: removed resetting labgeo parameters (very bad to do it...

gtMatchInitialize: removed resetting labgeo parameters (very bad to do it within this function) and saving backup parameters file.
The labgeo.detrefpos values are now set in the preprocessing. Enabled parameters check again.

Signed-off-by: default avatarpreischig <preischig@gmail.com>
parent 8dc539c1
No related branches found
No related tags found
No related merge requests found
function handles = gtMatchInitialize(handles) function handles = gtMatchInitialize(handles)
% Set initial values for the main GUI's constants, handles, tables % Sets initial values for the main GUI's constants, handles, tables
% and figures. Loads difspot data from database. % and figures. Loads difspot data from database.
%
% It should not modify labgeo or any other parameter! All required
% parameters should be set upstream or from within the GUI.
gtMatchSetBusy(handles,'on') gtMatchSetBusy(handles,'on')
...@@ -27,25 +30,20 @@ if strcmpi(check, 'y') ...@@ -27,25 +30,20 @@ if strcmpi(check, 'y')
parameters.match = gtMatchDefaultParametersGUI(); parameters.match = gtMatchDefaultParametersGUI();
parameters.match.thetalimits = 0.5*[parameters.labgeo.detanglemin, ... parameters.match.thetalimits = 0.5*[parameters.labgeo.detanglemin, ...
parameters.labgeo.detanglemax]; parameters.labgeo.detanglemax];
save('parameters.mat','parameters'); % Do not change parameters file sneakily! (PR)
disp('Match parameters have been reset to default values') %save('parameters.mat','parameters');
end disp('Match parameters have been reset to default values.')
% fix bounding box centering for the detector position along Z
if ~isempty(parameters.acq.bb)
parameters.labgeo.detrefpos(3) = ((parameters.acq.bb(2)+parameters.acq.bb(4)/2)-parameters.labgeo.detrefv)*parameters.acq.pixelsize;
parameters.labgeo.detrefpos(2) = -((parameters.acq.bb(1)+parameters.acq.bb(3)/2)-parameters.labgeo.detrefu)*parameters.acq.pixelsize;
disp('corrected detrefpos with acq.bb')
end end
if 0 if 1
% checking parameters first % checking parameters first: adds missing parameters as new fields
parameters = gtCheckParameters(parameters, 'acq'); parameters = gtCheckParameters(parameters, 'acq');
parameters = gtCheckParameters(parameters, 'match'); parameters = gtCheckParameters(parameters, 'match');
parameters = gtCheckParameters(parameters, 'labgeo'); parameters = gtCheckParameters(parameters, 'labgeo');
save('parameters.mat','parameters'); % Do not change parameters file sneakily! (PR)
%save('parameters.mat','parameters');
else else
disp('skipping gtCheckParameters - very slow?') disp('Skipping gtCheckParameters - very slow (!?)')
end end
handles.parfilename = []; handles.parfilename = [];
...@@ -365,7 +363,12 @@ for ip = 1:handles.nof_phases ...@@ -365,7 +363,12 @@ for ip = 1:handles.nof_phases
handles.CompPhaseThetas{ip} = asind(0.5*lambda_true./dsp_comp); handles.CompPhaseThetas{ip} = asind(0.5*lambda_true./dsp_comp);
handles.CompThetaIndices{ip} = 1:length(handles.CompPhaseThetas{ip}); handles.CompThetaIndices{ip} = 1:length(handles.CompPhaseThetas{ip});
% added by LNervo : keeping trace of used families % added by LNervo : keeping trace of used families
% !!! Notes by PReischig:
% This part is to be improved. The used families should be stored and read from
% parameters.match only. Plus, double check the use of CompThetasTicked and others
% here when multiple phases have overlapping reflections!
filename = gtLastFileName(fullfile('3_pairmatching',['match_' date() '_']),'existing'); filename = gtLastFileName(fullfile('3_pairmatching',['match_' date() '_']),'existing');
if isempty(filename) if isempty(filename)
list = dir(fullfile('3_pairmatching','match_*.mat')); list = dir(fullfile('3_pairmatching','match_*.mat'));
...@@ -511,12 +514,10 @@ handles.fitsaved = false; ...@@ -511,12 +514,10 @@ handles.fitsaved = false;
%% Save parameters backup file %% Save parameters backup file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
filename = gtLastFileName(sprintf('%s/3_pairmatching/parameters_old_%s_',... % Disabled saving backup file; it's not needed anymore - PR
handles.workingdir,date),'new'); %filename = gtLastFileName(sprintf('%s/3_pairmatching/parameters_old_%s_',...
% handles.workingdir,date),'new');
system(sprintf('cp parameters.mat %s',filename)); %system(sprintf('cp parameters.mat %s',filename));
set(handles.Text_Progress,'String','-'); set(handles.Text_Progress,'String','-');
gtMatchSetBusy(handles,'off') gtMatchSetBusy(handles,'off')
...@@ -524,8 +525,3 @@ gtMatchSetBusy(handles,'off') ...@@ -524,8 +525,3 @@ gtMatchSetBusy(handles,'off')
end end
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