Changeset 683


Ignore:
Timestamp:
Sep 4, 2013, 9:19:06 AM (8 years ago)
Author:
sommeria
Message:

bug for movie reading correcteed in uvmat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r682 r683  
    927927    if ~isempty(XmlDataRead)
    928928        ImaDoc_str=['view ' DocExt];  % DocExt= '.xml' or .civ (obsolete case)
    929         XmlData=XmlDataRead;
    930         if isfield(XmlData,'TimeUnit')
    931             if isfield(XmlData,'TimeUnit')&& ~isempty(XmlData.TimeUnit)
    932                 TimeUnit=XmlData.TimeUnit;
    933             end
    934         end
    935         set(handles.view_xml,'BackgroundColor',[1 1 1])% paint black to white
     929        %XmlData=XmlDataRead;     
     930            if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit)
     931                TimeUnit=XmlDataRead.TimeUnit;
     932            end
     933                    if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time)
     934                XmlData.Time=XmlDataRead.TimeUnit;
     935            end
     936        set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white
    936937        drawnow
    937         if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib)
     938        if isfield(XmlDataRead, 'GeometryCalib') && ~isempty(XmlDataRead.GeometryCalib)
     939            XmlData.GeometryCalib=XmlDataRead.GeometryCalib;
    938940            if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y')
    939941                set (handles.slices,'String','volume')
    940942            end
     943            % check whether the GUI geometry_calib is opened
    941944            hgeometry_calib=findobj('tag','geometry_calib');
    942             if ~isempty(hgeometry_calib)
     945            if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param
    943946                GUserData=get(hgeometry_calib,'UserData');
    944947                if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName))
    945                     answer=msgbox_uvmat('INPUT_Y-N','replace the display of geometry_calib with the new input data?');
     948                    answer=msgbox_uvmat('INPUT_Y-N','refresh the display of the GUI geometry_calib with the new input data?');
    946949                    if strcmp(answer,'Yes')
    947950                        geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib
     
    15761579FileExt=InputFile.FileExt;
    15771580NomType=InputFile.NomType;
    1578 %NomType=get(handles.NomType,'String');
    15791581% i1=str2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
    15801582% i2=[];%default
     
    15911593% end
    15921594[tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(InputFile.FileIndex);% check back the indices used
    1593 
     1595if isempty(i1)
     1596    i1=str2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
     1597elseif isempty(j1) && strcmp(get(handles.j1,'Visible'),'on')
     1598    j1=str2num(get(handles.j1,'String'));%case of indexed movie
     1599end
    15941600sub_value= get(handles.SubField,'Value');
    1595 if sub_value % a second input file has been entered 
    1596      [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles);   
     1601if sub_value % a second input file has been entered
     1602    [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles);
    15971603    [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1);% the indices for the second series taken from FileIndex_1
     1604    if isempty(i1_1)
     1605        i1_1=str2num(get(handles.i1,'String'));%read the field indices (for movie, it is not given by the file name)
     1606    elseif isempty(j1_1) && strcmp(get(handles.j1,'Visible'),'on')
     1607        j1_1=str2num(get(handles.j1,'String'));%case of indexed movie
     1608    end
    15981609else
    15991610    filename_1=[];
    1600 end   
     1611end
    16011612
    16021613%% increment (or decrement) the field indices and update the input filename(s)
     
    20762087    case {'video','mmreader'}
    20772088        ParamIn=UvData.MovieObject{1};     
    2078         if ~strcmp(NomType,'*')
    2079             frame_index=num_j1;%frame index for movies or multimage
     2089        if strcmp(NomType,'*')
     2090            frame_index=num_i1;%frame index from a single movies or multimage
    20802091        else
    2081             frame_index=num_i1;
     2092            frame_index=num_j1;% frame index from a set of indexed movies
    20822093        end
    20832094    case 'multimage'
Note: See TracChangeset for help on using the changeset viewer.