Changeset 1125 for trunk


Ignore:
Timestamp:
Sep 29, 2023, 6:54:33 PM (15 months ago)
Author:
sommeria
Message:

set_slice modified with Matlab app, allow slice positions with unequal spacing

Location:
trunk/src
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1123 r1125  
    12111211Check_slice=0;
    12121212if isfield(UvData,'XmlData')
    1213     if isfield(UvData.XmlData{1},'GeometryCalib') && strcmp(UvData.XmlData{1}.GeometryCalib.CalibrationType(1:3),'3D_')
     1213    if isfield(UvData.XmlData{1},'GeometryCalib') && isfield(UvData.XmlData{1}.GeometryCalib,'CalibrationType')&& strcmp(UvData.XmlData{1}.GeometryCalib.CalibrationType(1:3),'3D_')
    12141214        Check_slice=1;
    12151215    end
     
    12251225end
    12261226% default input
    1227 if ~(isfield(Slice,'SliceCoord') && size(Slice.SliceCoord,2)==3)
    1228     Slice.SliceCoord=[0 0 0];
    1229 end
    1230 InterfaceCoord=min(Slice.SliceCoord(:,3));
    1231 if isfield(Slice,'InterfaceCoord')
    1232     InterfaceCoord=Slice.InterfaceCoord(1,3);
    1233 end
    1234 NbSlice=size(Slice.SliceCoord,1);
    1235 CheckVolumeScan=0;
    1236 if isfield(Slice,'CheckVolumeScan')
    1237     CheckVolumeScan=Slice.CheckVolumeScan;
    1238 end
    1239 RefractionIndex=1.33;
    1240 CheckRefraction=0;% default value of the check box refraction
    1241 if isfield(Slice,'RefractionIndex')
    1242     RefractionIndex=Slice.RefractionIndex;
    1243     CheckRefraction=1;
    1244 end
    1245 SliceAngle=[0 0 0];
    1246 if isfield(Slice,'SliceAngle')
    1247     SliceAngle=Slice.SliceAngle;
     1227app=set_slices;
     1228app.UIFigure.Name='set_slices';
     1229app.unequalintervalsCheckBox.Value=0;%default
     1230if (isfield(Slice,'SliceCoord') && size(Slice.SliceCoord,2)==3)
     1231    app.NbSliceEditField.Value=size(Slice.SliceCoord,1);
     1232    app.firstZEditField.Value=Slice.SliceCoord(1,3);
     1233    app.lastZEditField.Value=Slice.SliceCoord(end,3);
     1234    app.axispositionxEditField.Value=Slice.SliceCoord(1,1);
     1235    app.yEditField.Value=Slice.SliceCoord(1,2);
     1236    app.UITable.Data=zeros(size(Slice.SliceCoord,1),3);
     1237    app.UITable.Data(:,1)=Slice.SliceCoord(:,3);
     1238    shifts=diff(Slice.SliceCoord(:,3));
     1239    if min(shifts)<max(shifts)
     1240        app.unequalintervalsCheckBox.Value=1;
     1241    end
     1242    if isfield(Slice,'CheckVolumeScan')
     1243        app.volumescanCheckBox.Value=Slice.CheckVolumeScan;
     1244    end
     1245    app.indexEditField.Value=1.33;
     1246    app.refractionCheckBox.Value=0;% default value of the check box refraction
     1247    if isfield(Slice,'RefractionIndex')
     1248        app.refractionCheckBox.Value=1;
     1249        app.indexEditField.Value=Slice.RefractionIndex;
     1250        app.indexEditField.Visible='on';
     1251        app.indexEditFieldLabel.Visible='on';
     1252        app.surfaceEditField.Value=min(Slice.SliceCoord(:,3));%default free surface position
     1253        app.surfaceEditField.Visible='on';
     1254        app.surfaceEditFieldLabel.Visible='on';
     1255        if isfield(Slice,'InterfaceCoord')
     1256            app.surfaceEditField.Value=Slice.InterfaceCoord(1,3);
     1257        end
     1258    end
     1259    app.firstangleEditField.Value=0;
     1260    app.firstangleEditField_2.Value=0;
     1261    app.lastangleEditField.Value=0;
     1262    app.lastangleEditField_2.Value=0;
     1263    if isfield(Slice,'SliceAngle')
     1264        app.firstangleEditField.Value=Slice.SliceAngle(1,1);
     1265        app.firstangleEditField_2.Value=Slice.SliceAngle(1,2);
     1266        app.lastangleEditField.Value=Slice.SliceAngle(end,1);
     1267        app.lastangleEditField_2.Value=Slice.SliceAngle(end,2);
     1268        app.UITable.Data(:,2)=Slice.SliceAngle(:,1);
     1269        app.UITable.Data(:,3)=Slice.SliceAngle(:,2);
     1270        shift_x=diff(Slice.SliceAngle(:,1));
     1271        shift_y=diff(Slice.SliceAngle(:,2));
     1272        if min(shift_x)<max(shift_x)||min(shift_y)<max(shift_y)
     1273            app.unequalintervalsCheckBox.Value=1;
     1274        end
     1275    end
     1276end
     1277if app.unequalintervalsCheckBox.Value
     1278    app.UITable.Visible='on';
     1279else
     1280    app.UITable.Visible='off';
    12481281end
    12491282
    12501283%% create the GUI set_slice
     1284return
     1285'TEST'
     1286%%old version
    12511287set(0,'Units','points')
    12521288ScreenSize=get(0,'ScreenSize');% get the size of the screen, to put the fig on the upper right
     
    12561292Bottom=ScreenSize(4)-Height-40; %put fig at top right
    12571293hfig=findobj(allchild(0),'Tag','set_slice');
    1258 if ~isempty(hfig),delete(hfig), end %delete existing version of the GUI
     1294% if ~isempty(hfig),delete(hfig), end %delete existing version of the GUI
     1295% hfig=uifigure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',Slice);
     1296%
     1297%return
    12591298hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',Slice);
    12601299BackgroundColor=get(hfig,'Color');
     
    45594598
    45604599%------------------------------------------------------------------------
    4561 % --- read the data displayed for the input rootfile windows (new): TODO use read_GUI
     4600% --- read the data displayed for the input rootfile windows
    45624601%------------------------------------------------------------------------
    45634602function [RootPath,SubDir,RootFile,FileIndices,FileExt,NomType]=read_file_boxes(handles)
     
    45794618if isequal(get(handles.RootPath_1,'Visible'),'off') || isequal(RootPath_1,'"')
    45804619    RootPath_1=get(handles.RootPath,'String');
    4581 end;
     4620end
    45824621SubDir_1=get(handles.SubDir_1,'String');
    45834622if isequal(get(handles.SubDir_1,'Visible'),'off')|| isequal(SubDir_1,'"')
Note: See TracChangeset for help on using the changeset viewer.