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

Change function from

params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive)
to
params_acq = gtLoadAcquisitionXML(acq, list_acq, xmlfname, interactive)

General commenting for the other functions

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

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@393 4c865b51-4357-4376-afb4-474e03ccb993
parent ee6137c9
No related branches found
No related tags found
No related merge requests found
function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive) function params_acq = gtLoadAcquisitionXML(acq, list_acq, xmlfname, interactive)
% FUNCTION gtLoadAcquisitionXML % FUNCTION gtLoadAcquisitionXML
% params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive) % params_acq = gtLoadAcquisitionXML(acq, list_acq, xmlfname, interactive)
% ---------------------------------------------------------------------- % -----------------------------------------------------------------------
% %
% Version 002 02/05/2012 by LNervo % Version 002 02/05/2012 by LNervo
% Add acq.beamchroma default value to 'mono' % Add acq.beamchroma default value to 'mono'
...@@ -17,24 +17,22 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive) ...@@ -17,24 +17,22 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive)
tmpxml = xml_read(xmlfname); tmpxml = xml_read(xmlfname);
tmpxml = tmpxml.acquisition; tmpxml = tmpxml.acquisition;
parameters.acq.name = tmpxml.scanName; % shouldn't change! acq.name = tmpxml.scanName; % shouldn't change!
parameters.acq.date = tmpxml.date; acq.date = tmpxml.date;
parameters.acq.xdet = tmpxml.projectionSize.DIM_2; acq.xdet = tmpxml.projectionSize.DIM_2;
parameters.acq.ydet = tmpxml.projectionSize.DIM_1; acq.ydet = tmpxml.projectionSize.DIM_1;
parameters.acq.nproj = tmpxml.tomo_N/2; acq.nproj = tmpxml.tomo_N/2;
parameters.acq.refon = tmpxml.ref_On; acq.refon = tmpxml.ref_On;
parameters.acq.nref = tmpxml.ref_N; acq.nref = tmpxml.ref_N;
parameters.acq.ndark = tmpxml.dark_N; acq.ndark = tmpxml.dark_N;
parameters.acq.pixelsize = tmpxml.pixelSize/1000; % mm acq.pixelsize = tmpxml.pixelSize/1000; % mm
parameters.acq.count_time = tmpxml.ccdtime; acq.count_time = tmpxml.ccdtime;
parameters.acq.energy = tmpxml.energy; acq.energy = tmpxml.energy;
parameters.acq.dist = tmpxml.distance; % mm acq.dist = tmpxml.distance; % mm
parameters.acq.sensortype = tmpxml.cameraName; acq.sensortype = tmpxml.cameraName;
parameters.acq.type = [num2str(tmpxml.scanRange) 'degree']; acq.type = [num2str(tmpxml.scanRange) 'degree'];
parameters.acq.orig_xdet = 2048; acq.roi_x_off = tmpxml.projectionSize.ROW_BEG;
parameters.acq.orig_ydet = 2048; acq.roi_y_off = tmpxml.projectionSize.COL_BEG;
parameters.acq.roi_x_off = tmpxml.projectionSize.ROW_BEG;
parameters.acq.roi_y_off = tmpxml.projectionSize.COL_BEG;
else %if .xml not found else %if .xml not found
if interactive if interactive
disp('No .xml file found! Are you sure you are correctly in the acquistion directory?') disp('No .xml file found! Are you sure you are correctly in the acquistion directory?')
...@@ -46,61 +44,62 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive) ...@@ -46,61 +44,62 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive)
end end
end end
% guess some default values % guess some default values
parameters.acq.date = date(); acq.date = date();
parameters.acq.xdet = 2048; acq.xdet = 2048;
parameters.acq.ydet = 2048; acq.ydet = 2048;
parameters.acq.nproj = 7200; acq.nproj = 7200;
parameters.acq.refon = 200; acq.refon = 200;
parameters.acq.nref = 5; acq.nref = 5;
parameters.acq.ndark = 11; acq.ndark = 11;
parameters.acq.pixelsize = 0.0014; acq.pixelsize = 0.0014;
parameters.acq.count_time = 2; acq.count_time = 2;
parameters.acq.energy = 20; acq.energy = 20;
parameters.acq.dist = 5; acq.dist = 5;
parameters.acq.sensortype = 'frelon'; acq.sensortype = 'frelon';
parameters.acq.type = '360degree'; acq.type = '360degree';
parameters.acq.orig_xdet = 2048; acq.roi_x_off = 0;
parameters.acq.orig_ydet = 2048; acq.roi_y_off = 0;
parameters.acq.roi_x_off = 0;
parameters.acq.roi_y_off = 0;
clear check clear check
end end
acq.orig_xdet = 2048;
acq.orig_ydet = 2048;
% interlacing parameters % interlacing parameters
% try to guess whether the scan is interlaced % try to guess whether the scan is interlaced
if exist([parameters.acq.name '0_0000.edf'], 'file') if exist([acq.name '0_0000.edf'], 'file')
parameters.acq.interlaced_turns = true; % assume one extra turn is reasonable guess acq.interlaced_turns = true; % assume one extra turn is reasonable guess
disp('This looks like an interlaced scan! Doubling nproj...') disp('This looks like an interlaced scan! Doubling nproj...')
parameters.acq.nproj = parameters.acq.nproj*2; acq.nproj = acq.nproj*2;
else else
parameters.acq.interlaced_turns = false; acq.interlaced_turns = false;
end end
% mono tuned during scan? % mono tuned during scan?
parameters.acq.mono_tune = false; acq.mono_tune = false;
% if we have a horizontal rotation axis we turn the images during the copying process % if we have a horizontal rotation axis we turn the images during the copying process
parameters.acq.rotation_axis = 'vertical'; acq.rotation_axis = 'vertical';
parameters.acq.distortion = 'none'; acq.distortion = 'none';
% deal with flips and rotations % deal with flips and rotations
% subsequently, deal with flips and rotations, scans without direct beam % subsequently, deal with flips and rotations, scans without direct beam
parameters.acq.flip_images = false; acq.flip_images = false;
parameters.acq.no_direct_beam = false; acq.no_direct_beam = false;
% rotate images to the gt coordinate system !!! Help !!! % rotate images to the gt coordinate system !!! Help !!!
parameters.acq.rotation_direction = 'clockwise'; acq.rotation_direction = 'clockwise';
parameters.acq.rotu = parameters.acq.xdet/2+0.5; % Images will be shifted in gtCreateFullLive to have rotation axis in center... acq.rotu = acq.xdet/2+0.5; % Images will be shifted in gtCreateFullLive to have rotation axis in center...
parameters.acq.rotx = parameters.acq.rotu; acq.rotx = acq.rotu;
parameters.acq.maxradius = max(parameters.acq.xdet,parameters.acq.ydet)/2*sqrt(2); acq.maxradius = max(acq.xdet,acq.ydet)/2*sqrt(2);
parameters.acq.beamchroma = 'mono'; acq.beamchroma = 'mono';
% if it is 360degree data, we need a pair table % if it is 360degree data, we need a pair table
if strcmpi(parameters.acq.type, '360degree') if strcmpi(acq.type, '360degree')
% pair tablename can be derived from the scan name % pair tablename can be derived from the scan name
parameters.acq.pair_tablename = [parameters.acq.name 'spotpairs']; acq.pair_tablename = [acq.name 'spotpairs'];
parameters.acq.calib_tablename = [parameters.acq.name 'paircalib']; acq.calib_tablename = [acq.name 'paircalib'];
end end
if interactive if interactive
...@@ -111,10 +110,10 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive) ...@@ -111,10 +110,10 @@ function params = gtLoadAcquisitionXML(parameters, list, xmlfname, interactive)
else else
header='Check all values. All "(?)" should be removed:'; header='Check all values. All "(?)" should be removed:';
end end
parameters.acq = gtModifyStructure(parameters.acq, list.acq(:,1:2), header); acq = gtModifyStructure(acq, list_acq(:,1:2), header);
end end
params = parameters; params_acq = acq;
end % end of function end % end of function
%
% FUNCTION par_match = gtMatchDefaultParametersGUI()
%
% Stores and provides the default parameters for Friedel pair matching.
%
%
function par_match = gtMatchDefaultParametersGUI() function par_match = gtMatchDefaultParametersGUI()
% GTMATCHDEFAULTPARAMETERSGUI Stores and provides the default parameters for Friedel pair matching.
% par_match = gtMatchDefaultParametersGUI()
% -----------------------------------------
%
par_match.thr_theta = 0.2; par_match.thr_theta = 0.2;
par_match.thr_theta_scale = 0; par_match.thr_theta_scale = 0;
...@@ -26,4 +23,4 @@ par_match.thr_meanerror = Inf; ...@@ -26,4 +23,4 @@ par_match.thr_meanerror = Inf;
par_match.thetalimits = [0 90]; par_match.thetalimits = [0 90];
end end % end of function
\ No newline at end of file \ No newline at end of file
...@@ -125,16 +125,12 @@ if isreflections ...@@ -125,16 +125,12 @@ if isreflections
title = lower(title); title = lower(title);
title = strrep(title,'.',''); title = strrep(title,'.','');
title = regexprep(title,'[^a-zA-Z]',''); title = regexprep(title,'[^a-zA-Z]','');
%title = regexprep(title,'theta','tt');
title = regexprep(title,'theta','twotheta'); title = regexprep(title,'theta','twotheta');
if length(title)==1 if length(title)==1
title = regexprep(title,'m','mult'); title = regexprep(title,'m','mult');
%title = regexprep(title,'^f','F');
title = regexprep(title,'^f','formfactor'); title = regexprep(title,'^f','formfactor');
end end
title = strtrim(title); title = strtrim(title);
%title = strrep(title,'dspacing','d0');
%title = strrep(title,'dspc','d0');
title = strrep(title,'dspc','dspacing'); title = strrep(title,'dspc','dspacing');
if ~strcmpi(title,'no') if ~strcmpi(title,'no')
reflections.(title)=C{i}; reflections.(title)=C{i};
...@@ -142,9 +138,7 @@ if isreflections ...@@ -142,9 +138,7 @@ if isreflections
end end
reflections.hkl=[reflections.h reflections.k reflections.l]; reflections.hkl=[reflections.h reflections.k reflections.l];
reflections=rmfield(reflections,'h'); reflections=rmfield(reflections,{'h','k','l'});
reflections=rmfield(reflections,'k');
reflections=rmfield(reflections,'l');
xop = reflections; xop = reflections;
ind=strfind(file,filesep); ind=strfind(file,filesep);
......
...@@ -265,9 +265,9 @@ list.labgeo{23,1} = 'reflabY'; list.labgeo{23,2} = ''; ...@@ -265,9 +265,9 @@ list.labgeo{23,1} = 'reflabY'; list.labgeo{23,2} = '';
list.labgeo{23,3} = 'char'; list.labgeo{23,3} = 'char';
list.labgeo{24,1} = 'reflabZ'; list.labgeo{24,2} = ''; list.labgeo{24,1} = 'reflabZ'; list.labgeo{24,2} = '';
list.labgeo{24,3} = 'char'; list.labgeo{24,3} = 'char';
list.labgeo{25,1} = 'detsizeu'; list.labgeo{25,2} = ''; list.labgeo{25,1} = 'detsizeu'; list.labgeo{25,2} = 'Number of pixels along the u direction';
list.labgeo{25,3} = 'double'; % scalar list.labgeo{25,3} = 'double'; % scalar
list.labgeo{26,1} = 'detsizev'; list.labgeo{26,2} = ''; list.labgeo{26,1} = 'detsizev'; list.labgeo{26,2} = 'Number of pixels along the v direction';
list.labgeo{26,3} = 'double'; % scalar list.labgeo{26,3} = 'double'; % scalar
list.labgeo{27,1} = 'rotcomp'; list.labgeo{27,2} = 'Rotation matrix components [computed]'; list.labgeo{27,1} = 'rotcomp'; list.labgeo{27,2} = 'Rotation matrix components [computed]';
list.labgeo{27,3} = 'struct'; list.labgeo{27,3} = 'struct';
......
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