Changeset 642


Ignore:
Timestamp:
May 23, 2013, 12:33:04 AM (8 years ago)
Author:
sommeria
Message:

civ_input improved and small bug corrections

Location:
trunk/src/series
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_input.m

    r637 r642  
    9797NomTypeNc='';
    9898switch FileType
    99          case {'image','multimage','video','mmreader'}
    100           NomTypeImaA=NomTypeInput;
     99    case {'image','multimage','video','mmreader'}
     100        NomTypeImaA=NomTypeInput;
     101        iview_image=1;%line # for the input images
    101102    case 'civdata'
    102103        if ~strcmp(Param.Action.ActionName,'civ_series')
     
    111112        else
    112113            set(handles.ListCompareMode,'Value',1)
    113 %            set(handles.RootFile_1,'Visible','Off');
     114            %            set(handles.RootFile_1,'Visible','Off');
    114115        end
    115116        imageinput='';
     
    117118        [PathCiv1_ImageA,Civ1_ImageA,FileExtA]=fileparts(Data.Civ1_ImageA);
    118119        [PathCiv1_ImageB,Civ1_ImageB,FileExtA]=fileparts(Data.Civ1_ImageB);
    119 %         set(handles.Civ1_ImageA,'String',Civ1_ImageA)
    120 %         set(handles.Civ1_ImageB,'String',Civ1_ImageB)
     120        %         set(handles.Civ1_ImageA,'String',Civ1_ImageA)
     121        %         set(handles.Civ1_ImageB,'String',Civ1_ImageB)
    121122        if ~isempty(Data.Civ2_ImageA)
    122         [PathCiv2_ImageA,Civ2_ImageA,FileExtA]=fileparts(Data.Civ2_ImageA);
    123         [PathCiv2_ImageB,Civ2_ImageB,FileExtA]=fileparts(Data.Civ2_ImageB);
    124 %         set(handles.Civ2_ImageA,'String',Civ2_ImageA)
    125 %         set(handles.Civ2_ImageB,'String',Civ2_ImageB)
     123            [PathCiv2_ImageA,Civ2_ImageA,FileExtA]=fileparts(Data.Civ2_ImageA);
     124            [PathCiv2_ImageB,Civ2_ImageB,FileExtA]=fileparts(Data.Civ2_ImageB);
     125            %         set(handles.Civ2_ImageA,'String',Civ2_ImageA)
     126            %         set(handles.Civ2_ImageB,'String',Civ2_ImageB)
    126127        end
    127128        hhseries=guidata(gcbf);
    128129        if size(Param.InputTable,1)==1
    129         series('display_file_name',hhseries,Data.Civ1_ImageA,'append');
    130         end
    131     if isfield(Data,'Txt')
    132         errormsg=Data.Txt;
    133         return
    134         %TODO: introduce the image in the input table of series
    135     end
     130            series('display_file_name',hhseries,Data.Civ1_ImageA,'append');
     131        end
     132        if isfield(Data,'Txt')
     133            errormsg=Data.Txt;
     134            return
     135            %TODO: introduce the image in the input table of series
     136        end
    136137        [RootPath,SubDir,RootFile,i1,i2,j1,j2,FileExt,NomTypeImaA]=fileparts_uvmat(Data.Civ1_ImageA);
    137138        [RootPath,SubDir,RootFile,i1,i2,j1,j2,FileExt,NomTypeImaB]=fileparts_uvmat(Data.Civ1_ImageB);
     139        iview_image=2;%line # for the input images
    138140    case 'civxdata'% case of  civx data,
    139141        NomTypeNc=NomTypeInput;
     
    142144        msgbox_uvmat('ERROR','old civX convention, use the GUI civ')
    143145        return
    144      
    145146end
    146147
     
    193194
    194195%%  set the menus of image pairs and default selection for civ_input   %%%%%%%%%%%%%%%%%%%
    195 MaxIndex_i=Param.IndexRange.MaxIndex_i(1);
    196 MinIndex_i=Param.IndexRange.MinIndex_i(1);
     196MaxIndex_i=Param.IndexRange.MaxIndex_i(iview_image);
     197MinIndex_i=Param.IndexRange.MinIndex_i(iview_image);
    197198MaxIndex_j=1;%default
    198199MinIndex_j=1;
    199200if isfield(Param.IndexRange,'MaxIndex_j')&&isfield(Param.IndexRange,'MinIndex_j')
    200 MaxIndex_j=Param.IndexRange.MaxIndex_j(1);
    201 MinIndex_j=Param.IndexRange.MinIndex_j(1);
     201MaxIndex_j=Param.IndexRange.MaxIndex_j(iview_image);
     202MinIndex_j=Param.IndexRange.MinIndex_j(iview_image);
    202203end
    203204CivInputData.MaxIndex_i=MaxIndex_i;
     
    12511252            end
    12521253        end
     1254       
    12531255    end
    12541256    [dtsort,indsort]=sort(dt);
  • trunk/src/series/merge_proj.m

    r640 r642  
    161161NomTypeOut=NomType;% output file index will indicate the first and last ref index in the series
    162162
     163%% mask (TODO: case of multilevels)
     164if Param.CheckMask
     165    MaskData=cell(NbView,1);
     166    MaskSubDir=regexprep(Param.InputTable{iview,2},'\..*','');%take the root part of SubDir, before the first dot '.'
     167    MaskName=fullfile(Param.InputTable{iview,1},[MaskSubDir '.mask'],'mask_1.png');
     168    if exist(MaskName,'file')
     169        [MaskData{iview},tild,errormsg] = read_field(MaskName,'image');
     170        if ~isempty(transform_fct) && nargin(transform_fct)>=2
     171            MaskData{iview}=transform_fct(MaskData,XmlData{iview});
     172        end
     173    end
     174end
     175
    163176%% Set field names and velocity types
    164177%use Param.InputFields for all views
     
    174187for index=1:NbField
    175188        update_waitbar(WaitbarHandle,index/NbField)
    176     if ~isempty(RUNHandle) &&ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     189    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    177190        disp('program stopped by user')
    178191        return
     
    196209            Data{iview}.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform
    197210        end
    198 
     211       
    199212        %% transform the input field (e.g; phys) if requested (no transform involving two input fields)
    200213        if ~isempty(transform_fct)
     
    206219        end
    207220       
    208          %% calculate tps coefficients if needed
     221        %% calculate tps coefficients if needed
    209222        check_proj_tps= isfield(Param,'ProjObject')&&~isempty(Param.ProjObject)&& strcmp(Param.ProjObject.ProjMode,'interp_tps')&&~isfield(Data{iview},'Coord_tps');
    210223        Data{iview}=tps_coeff_field(Data{iview},check_proj_tps);
    211 
     224       
    212225        %% projection on object (gridded plane)
    213226        if Param.CheckObject
     
    220233       
    221234        %% mask
    222         if isfield(Param,'Mask')
    223             %TODO: introduce a table of masks for multiple views
    224             [MaskData{iview},tild,errormsg] = read_field(Param.Mask,'image');
    225             if ~isempty(transform_fct) && nargin(transform_fct)>=2
    226                     MaskData{iview}=transform_fct(MaskData,XmlData{iview});
    227             end
    228             [Data{iview},errormsg]=mask_proj(Data{iview},MaskData{iview});
     235        if Param.CheckMask && ~isempty(MaskData{iview})
     236             [Data{iview},errormsg]=mask_proj(Data{iview},MaskData{iview});
    229237        end
    230238    end
  • trunk/src/series/sub_background.m

    r633 r642  
    113113    CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images
    114114    if ~CheckImage
    115         msgbox_uvmat('ERROR',['invalid file type input: ' FileType{1} ' not an image'])
     115        msgbox_uvmat('ERROR',['invalid file type input: ' FileType ' not an image'])
    116116        return
    117117    end
Note: See TracChangeset for help on using the changeset viewer.