Changeset 661
- Timestamp:
- Jul 5, 2013, 11:15:53 AM (11 years ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r656 r661 87 87 NomTypeInput=Param.InputTable{1,4}; 88 88 FileExt=Param.InputTable{1,5}; 89 FileType=SeriesData.FileType{1}; 89 FileType=SeriesData.FileType{1};%type of the first input file series 90 90 FileInfo=SeriesData.FileInfo{1}; 91 91 FileInput=SeriesData.RefFile{1}; … … 118 118 [PathCiv1_ImageA,Civ1_ImageA,FileExtA]=fileparts(Data.Civ1_ImageA); 119 119 [PathCiv1_ImageB,Civ1_ImageB,FileExtA]=fileparts(Data.Civ1_ImageB); 120 % set(handles.Civ1_ImageA,'String',Civ1_ImageA)121 % set(handles.Civ1_ImageB,'String',Civ1_ImageB)122 120 if ~isempty(Data.Civ2_ImageA) 123 121 [PathCiv2_ImageA,Civ2_ImageA,FileExtA]=fileparts(Data.Civ2_ImageA); 124 122 [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)127 123 end 128 124 hhseries=guidata(gcbf); 129 125 if size(Param.InputTable,1)==1 130 series('display_file_name',hhseries,Data.Civ1_ImageA,'append'); 126 series('display_file_name',hhseries,Data.Civ1_ImageA,'append');%append the image series to the input list 131 127 end 132 128 if isfield(Data,'Txt') … … 145 141 return 146 142 end 143 if numel(SeriesData.FileType)>=2 && strcmp(SeriesData.FileType{end-1},'image') && strcmp(SeriesData.FileType{end},'image') 144 set(handles.ListCompareMode,'Value',3)% we compare two image series term to term ('shift') 145 set(handles.PairIndices,'Visible','off') 146 end 147 147 148 148 %% TODO: get corresponding image in nc case … … 188 188 end 189 189 end 190 %list_operation={'CheckCiv1','CheckFix1','CheckPatch1','CheckCiv2','CheckFix2','CheckPatch2'};191 192 %set(handles.(ListOptions{min(ind_opening+1,6)}),'value',1)193 190 194 191 -
trunk/src/series/civ_series.m
r645 r661 94 94 else 95 95 FileType=get_file_type(filecell{1,1}); 96 iview_nc=0; 97 iview_A=0; 98 iview_B=0; 96 iview_nc=0;% series index (iview) for an input nc file (for civ2 or patch2) 97 iview_A=0;% series index (iview) for the first image series 98 iview_B=0;% series index (iview) for the second image series (only non zero for option 'shift' ) 99 99 switch FileType 100 100 case 'civdata';% =1 for images … … 118 118 displ(['ERROR: the file line ' num2str(iview_A) ' must be an image']) 119 119 end 120 RootPath =Param.InputTable{1,1};121 RootFile =Param.InputTable{1,3};122 SubDir =Param.InputTable{1,2};123 NomType =Param.InputTable{1,4};124 FileExt =Param.InputTable{1,5};120 RootPath_A=Param.InputTable{1,1}; 121 RootFile_A=Param.InputTable{1,3}; 122 SubDir_A=Param.InputTable{1,2}; 123 NomType_A=Param.InputTable{1,4}; 124 FileExt_A=Param.InputTable{1,5}; 125 125 end 126 126 if iview_B==0 127 127 FileType_B=FileType_A; 128 128 VideoObject_B=VideoObject_A; 129 PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1; 129 RootPath_B=RootPath_A; 130 RootFile_B=RootFile_A; 131 SubDir_B=SubDir_A; 132 NomType_B=NomType_A; 133 FileExt_B=FileExt_A; 130 134 PairCiv2=''; 131 if isfield(Param.ActionInput.PairIndices,'ListPairCiv2') 132 PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2; 133 end 134 [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=... 135 find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 136 if ~isempty(PairCiv2) 137 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=... 138 find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 139 check_bounds=check_bounds | check_bounds_Civ2; 140 end 141 i1_series_Civ1=i1_series_Civ1(~check_bounds); 142 i2_series_Civ1=i2_series_Civ1(~check_bounds); 143 j1_series_Civ1=j1_series_Civ1(~check_bounds); 144 j2_series_Civ1=j2_series_Civ1(~check_bounds); 145 if isempty(j_series{1}) 146 FrameIndex_A_Civ1=i1_series_Civ1; 147 FrameIndex_B_Civ1=i2_series_Civ1; 148 else 149 FrameIndex_A_Civ1=j1_series_Civ1; 150 FrameIndex_B_Civ1=j2_series_Civ1; 135 switch Param.ActionInput.ListCompareMode 136 case 'PIV' 137 PairCiv1=Param.ActionInput.PairIndices.ListPairCiv1; 138 if isfield(Param.ActionInput.PairIndices,'ListPairCiv2') 139 PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2; 140 end 141 [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=... 142 find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 143 if ~isempty(PairCiv2) 144 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=... 145 find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 146 check_bounds=check_bounds | check_bounds_Civ2; 147 end 148 i1_series_Civ1=i1_series_Civ1(~check_bounds); 149 i2_series_Civ1=i2_series_Civ1(~check_bounds); 150 j1_series_Civ1=j1_series_Civ1(~check_bounds); 151 j2_series_Civ1=j2_series_Civ1(~check_bounds); 152 case 'displacement' 153 i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i_series{1})); 154 i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1}; 155 j1_series_Civ1=ones(size(i_series{1}));% first j index is 1 156 if isempty(j_series{1}) 157 j2_series_Civ1=ones(size(i_series{1})); 158 else 159 j2_series_Civ1=j_series{1}; 160 end 161 i1_series_Civ2=i1_series_Civ1; 162 j1_series_Civ2=j1_series_Civ1; 163 j2_series_Civ2=j2_series_Civ1; 164 NomTypeNc=NomType; 151 165 end 152 166 if ~isempty(PairCiv2) … … 165 179 else 166 180 [FileType_B,FileInfo,VideoObject_B]=get_file_type(filecell{2,1}); 167 if isempty(find(strcmp(FileType_B,{'multimage','mmreader','video'}))) 168 displ(['ERROR: the file line ' num2str(iview_B) ' must be an image']) 169 end 170 %TODO : introduce the second file series if relevant: case %displacement 181 if ~ismember(FileType_B,{'image','multimage','mmreader','video'}) 182 displ_uvmat('ERROR',['the file line ' num2str(iview_B) ' must be an image']) 183 end 184 i1_series_Civ1=i_series{1};i1_series_Civ2=i_series{1}; 185 i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1}; 186 if isempty(j_series{1}) 187 j1_series_Civ1=ones(size(i_series{1})); 188 j2_series_Civ1=ones(size(i_series{1})); 189 else 190 j1_series_Civ1=j_series{1}; 191 j2_series_Civ1=j_series{1}; 192 end 193 j1_series_Civ2=j1_series_Civ1; 194 j2_series_Civ2=j2_series_Civ1; 195 NomTypeNc=NomType_A; 196 RootPath_B=Param.InputTable{2,1}; 197 RootFile_B=Param.InputTable{2,3}; 198 SubDir_B=Param.InputTable{2,2}; 199 NomType_B=Param.InputTable{2,4}; 200 FileExt_B=Param.InputTable{2,5}; 201 end 202 if isempty(j_series{1}) 203 FrameIndex_A_Civ1=i1_series_Civ1; 204 FrameIndex_B_Civ1=i2_series_Civ1; 205 else 206 FrameIndex_A_Civ1=j1_series_Civ1; 207 FrameIndex_B_Civ1=j2_series_Civ1; 171 208 end 172 209 end … … 189 226 190 227 %% get timing from the ImaDoc file or input video 191 XmlFileName=find_imadoc(RootPath ,SubDir,RootFile,FileExt);228 XmlFileName=find_imadoc(RootPath_A,SubDir_A,RootFile_A,FileExt_A); 192 229 time=[]; 193 230 if ~isempty(XmlFileName) … … 249 286 end 250 287 else 251 ImageName_A=fullfile_uvmat(RootPath ,SubDir,RootFile,FileExt,NomType,i1_series_Civ1(ifield),[],j1_series_Civ1(ifield));288 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(ifield),[],j1_series_Civ1(ifield)); 252 289 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(ifield)); 253 ImageName_B=fullfile_uvmat(RootPath ,SubDir,RootFile,FileExt,NomType,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield));290 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield)); 254 291 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(ifield)); 255 292 end 256 ncfile=fullfile_uvmat(RootPath,OutputDir,RootFile,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),... 293 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 294 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),... 257 295 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 296 else 297 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2_series_Civ1(ifield),[],... 298 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 299 end 258 300 par_civ1.ImageWidth=FileInfo_A.Width; 259 301 par_civ1.ImageHeight=FileInfo_A.Height;
Note: See TracChangeset
for help on using the changeset viewer.