diff --git a/1_preprocessing/gtSetup_Utils/gtLoadAcquisitionXML.m b/1_preprocessing/gtSetup_Utils/gtLoadAcquisitionXML.m index 2e8bb59fb68230eef2599296a9a3d8e0f86236d9..550e4202112c7c25eea21bd8c16ca35e893e71a8 100644 --- a/1_preprocessing/gtSetup_Utils/gtLoadAcquisitionXML.m +++ b/1_preprocessing/gtSetup_Utils/gtLoadAcquisitionXML.m @@ -18,11 +18,11 @@ function acq = gtLoadAcquisitionXML(xmlfname, interactive) acq.date = tmpxml.date; acq.xdet = tmpxml.projectionSize.DIM_1; % pixels acq.ydet = tmpxml.projectionSize.DIM_2; % pixels - acq.nproj = tmpxml.tomo_N/2; + acq.nproj = tmpxml.tomo_N / 2; acq.refon = tmpxml.ref_On; acq.nref = tmpxml.ref_N; acq.ndark = tmpxml.dark_N; - acq.pixelsize = tmpxml.pixelSize/1000; % mm + acq.pixelsize = tmpxml.pixelSize / 1000; % mm acq.count_time = tmpxml.ccdtime; acq.energy = tmpxml.energy; % keV acq.dist = tmpxml.distance; % mm @@ -35,6 +35,14 @@ function acq = gtLoadAcquisitionXML(xmlfname, interactive) end acq.detroi_v_off = tmpxml.projectionSize.ROW_BEG; acq.detroi_u_off = tmpxml.projectionSize.COL_BEG; + + motors_xml = tmpxml.listMotors.motor; + for ii_m = 1:numel(motors_xml) + m = motors_xml(ii_m); + val = m.motorPosition.CONTENT; + unit = m.motorPosition.ATTRIBUTE.unit; + acq.motors.(m.motorName) = convert_to_mm_or_deg(val, unit); + end else %if .xml not found if interactive disp('No .xml file found!'); @@ -62,5 +70,19 @@ function acq = gtLoadAcquisitionXML(xmlfname, interactive) acq.detroi_u_off = 0; acq.detroi_v_off = 0; end - -end % end of function +end + +function x = convert_to_mm_or_deg(x, unit) + switch(lower(unit)) + case 'm' + x = 1e3 * x; + case {'mm', 'deg'} + case 'um' + x = 1e-3 * x; + case 'nm' + x = 1e-6 * x; + case 'rad' + x = x * 180 / pi; + end +end + diff --git a/zUtil_Parameters/build_list_v2.m b/zUtil_Parameters/build_list_v2.m index 3649440cb38fd0432baa043847dfddf43029322c..42a0bbdb3b7c4171ac3204afd52b73d07ad132e5 100644 --- a/zUtil_Parameters/build_list_v2.m +++ b/zUtil_Parameters/build_list_v2.m @@ -135,6 +135,18 @@ list.acq(end+1, :) = {'maxradius', ... '[Computed] Maximum active radius of the detector, for example in case of vignetting', 'double', 0}; list.acq(end+1, :) = {'online', ... 'Is the analysis online?', 'logical', 1}; +list.acq(end+1, :) = {'motors', ... + 'Scan motor information', 'struct', 2}; +list.acq(end+1, :) = {'sample_tilts', ... + 'Sample tilts (samr): y, x (in order)', 'double', 2}; +list.acq(end+1, :) = {'sample_shifts', ... + 'Sample shifts (samt): x, y, z (in order)', 'double', 2}; +list.acq(end+1, :) = {'nproj_basetilt', ... + 'Topotomo number of basetilt steps', 'double', 2}; +list.acq(end+1, :) = {'range_basetilt', ... + 'Topotomo basetilt range', 'double', 2}; +list.acq(end+1, :) = {'pl_ind', ... + 'Topotomo plane normal index, with respect to first acquisition', 'double', 2}; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%