Changeset 39 for trunk/src/civ.m
- Timestamp:
- Mar 9, 2010, 5:46:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r36 r39 91 91 end 92 92 93 if exist('ext','var') && length(ext)>1 && (~isempty(imformats(ext( [2:end])))|...94 isequal( ext,'.avi')||isequal(ext,'.AVI'));%if an image file has been opened by uvmat93 if exist('ext','var') && length(ext)>1 && (~isempty(imformats(ext(2:end)))||... 94 isequal(lower(ext),'.avi'));%if an image file has been opened by uvmat 95 95 set(handles.ext_ima,'String',ext) 96 96 if exist('nom_type_read','var') … … 259 259 filebase=get(handles.displ_filebase,'String'); 260 260 oldfile=''; %default 261 if isempty(filebase)| isequal(filebase,'')%loads the previously stored file name and set it as default in the file_input box261 if isempty(filebase)|| isequal(filebase,'')%loads the previously stored file name and set it as default in the file_input box 262 262 dir_perso=prefdir; 263 263 profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); … … 448 448 field_count=1;%default 449 449 nom_type_nc=[]; 450 npx=[];%default451 npy=[];450 % npx=[];%default 451 % npy=[]; 452 452 time=[]; 453 453 TimeUnit=[]; %default … … 478 478 end 479 479 first_j=str2num(get(handles.first_j,'String')); 480 if isempty(first_j)| first_j < 1480 if isempty(first_j)|| first_j < 1 481 481 first_j=1; %default first_j 482 482 end 483 483 last_j=str2num(get(handles.last_j,'String')); 484 if isempty(last_j)| last_j < first_j484 if isempty(last_j)|| last_j < first_j 485 485 last_j=first_j; %default last_j 486 486 end 487 487 incr_i=str2num(get(handles.incr_i,'String')); 488 if isempty(incr_i) | incr_i < 1;488 if isempty(incr_i) || incr_i < 1; 489 489 set(handles.incr_i,'String','1') %default incr_i 490 490 end 491 491 incr_j=str2num(get(handles.incr_j,'String')); 492 if isempty(incr_j) | incr_j < 1;492 if isempty(incr_j) || incr_j < 1; 493 493 set(handles.incr_j,'String','1') %default incr_j 494 494 end … … 554 554 if isfield(XmlData,'Heading')&&isfield(XmlData.Heading','ImageName')&&ischar(XmlData.Heading.ImageName)% get image nom type and extension from the xml file 555 555 [PP,FF,fc,str2,str_a,str_b,ext_ima_read,nom_type_read]=name2display(XmlData.Heading.ImageName); 556 fullname=fullfile(fileparts(filebase),XmlData.Heading.ImageName) %full name (including path) of the first image defined by the xmle file,556 fullname=fullfile(fileparts(filebase),XmlData.Heading.ImageName); %full name (including path) of the first image defined by the xmle file, 557 557 if exist(fullname,'file') 558 558 testima_xml=1; … … 1318 1318 last_i=str2num(get(handles.last_i,'String'));%last index i 1319 1319 incr=str2num(get(handles.incr_i,'String'));% increment 1320 num 1=[first_i:incr:last_i];% list of i indices (reference values for each pair)1320 num_i=[first_i:incr:last_i];% list of i indices (reference values for each pair) 1321 1321 if isequal(get(handles.first_j,'Visible'),'on') 1322 1322 first_j=str2num(get(handles.first_j,'String'));%first index j … … 1331 1331 list_civ1=get(handles.list_pair_civ1,'String'); 1332 1332 index_civ1=get(handles.list_pair_civ1,'Value'); 1333 [num_i,num_j]=meshgrid(num_i,num_j); 1333 1334 str_civ1=list_civ1{index_civ1};%string defining the image pairs for civ1 1334 1335 if isempty(str_civ1)||isequal(str_civ1,'') … … 1345 1346 if isempty(first_i)||isempty(first_j), msgbox_uvmat('ERROR','first field number not defined'),... 1346 1347 return,end; 1347 if isequal(last_i,[])| isequal(last_j,[]),msgbox_uvmat('ERROR','last field number not defined'),...1348 if isequal(last_i,[])|| isequal(last_j,[]),msgbox_uvmat('ERROR','last field number not defined'),... 1348 1349 return,end; 1349 if isequal(incr,[])| isequal(incr_j,[]),msgbox_uvmat('ERROR','increment in field number not defined'),...1350 if isequal(incr,[])|| isequal(incr_j,[]),msgbox_uvmat('ERROR','increment in field number not defined'),... 1350 1351 return,end; 1351 if last_i < first_i | last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),...1352 if last_i < first_i || last_j < first_j , msgbox_uvmat('ERROR','last field number must be larger than the first one'),... 1352 1353 return,end; 1353 1354 if isequal (mode,'series(Di)') … … 1362 1363 d2=str2num(str_civ1([indsel(indsepar)+1:indsel(indsepar+1)-1])); 1363 1364 end 1364 num1_civ1=num 1-d1;% set of first image numbers1365 num2_civ1=num 1+d2;1365 num1_civ1=num_i-d1;% set of first image numbers 1366 num2_civ1=num_i+d2; 1366 1367 num_a_civ1=num_j; 1367 1368 num_b_civ1=num_j; … … 1378 1379 end 1379 1380 if isempty(d1) 1380 num1_civ2=num 1;1381 num1_civ2=num_i; 1381 1382 else 1382 num1_civ2=num 1-d1;% set of first image numbers1383 num1_civ2=num_i-d1;% set of first image numbers 1383 1384 end 1384 1385 if isempty(d2) 1385 num2_civ2=num 1;1386 num2_civ2=num_i; 1386 1387 else 1387 num2_civ2=num 1+d2;1388 num2_civ2=num_i+d2; 1388 1389 end 1389 1390 num_a_civ2=num_j; … … 1400 1401 firstind=indsel(1); 1401 1402 lastind=indsel(end); 1402 set(handles.first_i,'String',num2str(num 1(firstind)))%update the display of first and last fields1403 set(handles.last_i,'String',num2str(num 1(lastind)))1404 num 1=num1(indsel);1403 set(handles.first_i,'String',num2str(num_i(firstind)))%update the display of first and last fields 1404 set(handles.last_i,'String',num2str(num_i(lastind))) 1405 num_i=num_i(indsel); 1405 1406 num1_civ1=num1_civ1(indsel); 1406 1407 num1_civ2=num1_civ2(indsel); … … 1410 1411 elseif isequal (mode,'series(Dj)') 1411 1412 lastfield_j=str2num(get(handles.nb_field2,'String')); 1412 num1_civ1=num 1;% set of first image numbers1413 num2_civ1=num 1;1413 num1_civ1=num_i;% set of first image numbers 1414 num2_civ1=num_i; 1414 1415 num_a_civ1=num_j-floor(index_civ1/2)*ones(size(num_j)); 1415 1416 num_b_civ1=num_j+ceil(index_civ1/2)*ones(size(num_j)); 1416 num1_civ2=num 1;1417 num2_civ2=num 1;1417 num1_civ2=num_i; 1418 num2_civ2=num_i; 1418 1419 num_a_civ2=num_j-floor(index_civ2/2)*ones(size(num_j)); 1419 1420 num_b_civ2=num_j+ceil(index_civ2/2)*ones(size(num_j)); … … 1436 1437 end 1437 1438 elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 1438 num1_civ1=num 1;1439 num1_civ2=num 1;1439 num1_civ1=num_i; 1440 num1_civ2=num_i; 1440 1441 displ_num=get(handles.list_pair_civ1,'UserData'); 1441 num2_civ1=num 1;1442 num2_civ1=num_i; 1442 1443 num_a_civ1=displ_num(1,index_civ1); 1443 1444 num_b_civ1=displ_num(2,index_civ1); 1444 num2_civ2=num 1;1445 num2_civ2=num_i; 1445 1446 num_a_civ2=displ_num(1,index_civ2); 1446 1447 num_b_civ2=displ_num(2,index_civ2); 1447 1448 elseif isequal(mode,'displacement') 1448 num1_civ1=num 1;1449 num2_civ1=num 1;1449 num1_civ1=num_i; 1450 num2_civ1=num_i; 1450 1451 num_a_civ1=num_j; 1451 1452 num_b_civ1=num_j; 1452 num1_civ2=num 1;1453 num2_civ2=num 1;1453 num1_civ2=num_i; 1454 num2_civ2=num_i; 1454 1455 num_a_civ2=num_j; 1455 1456 num_b_civ2=num_j; 1456 1457 end 1457 'TESTfind'1458 num1_civ11459 num2_civ11460 num_a_civ11461 num_b_civ11462 1458 1463 1459 %------------------------------------------------------------------------ … … 1664 1660 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... 1665 1661 set_civ_filenames(handles,compare,box_test); 1666 'TESTnbre_RUN' 1667 nbfield=size(num1_civ1,2) 1668 nbslice=size(num1_civ1,1) 1662 nbfield=size(num1_civ1,2); 1663 nbslice=size(num1_civ1,1); 1669 1664 1670 1665 if isempty(filecell) … … 2185 2180 set_civ_filenames(handles,compare,box_test); 2186 2181 display('files OK, processing...') 2187 'TESTnbre' 2188 nbfield=size(num1_civ1,2) 2189 nbslice=size(num1_civ1,1) 2182 nbfield=size(num1_civ1,2); 2183 nbslice=size(num1_civ1,1); 2190 2184 2191 2185 %GET PARAMETERS: … … 2678 2672 cmd=char({cmd;[Civ_exe ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]}); 2679 2673 end 2680 2681 2674 % create the .bat file: 2682 2675 if sge … … 2688 2681 filename_bat(end-2:end)='bat'; 2689 2682 fid=fopen(filename_bat,'w'); 2690 fprintf(fid,cmd) 2691 fclose(fid) 2683 fprintf(fid,cmd); 2684 fclose(fid); 2692 2685 %dlmwrite(filename_bat,cmd,'');%write commands in filename_bat 2693 2686 if sge … … 2772 2765 [num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2]=... 2773 2766 find_pair_indices(handles,mode); 2774 2775 2767 %determine the new filebase for 'displacement' mode (comparison of two series) 2776 2768 filebase_B=filebase;% root name of the second field series for stereo … … 3458 3450 term_b=num2stra(num_b(j),nom_type_nc);% 3459 3451 if test_grid && ~isempty(nbslice_grid) 3460 num1_grid=mod(num1(ifile)-1,nbslice_grid)+1 3452 num1_grid=mod(num1(ifile)-1,nbslice_grid)+1; 3461 3453 gridname=[filebase '_' name_generator(gridname,num1_grid,1,'.grid','_i')]; 3462 3454 if ~exist(gridname,'file') … … 3652 3644 filename_nc1([end-2:end])=[]; % remove '.nc' 3653 3645 if test_grid && ~isempty(nbslice_grid) 3654 num1_grid=mod(num1(ifile)-1,nbslice_grid)+1 3646 num1_grid=mod(num1(ifile)-1,nbslice_grid)+1; 3655 3647 gridname=[filebase '_' name_generator(gridname,num1_grid,1,'.grid','_i')]; 3656 3648 if ~exist(gridname,'file') … … 4214 4206 if value 4215 4207 filebase=get(handles.displ_filebase,'String'); 4216 [nbslice, flag_grid]=get_grid(filebase,handles) 4208 [nbslice, flag_grid]=get_grid(filebase,handles); 4217 4209 if isequal(flag_grid,1) 4218 4210 filegrid=[num2str(nbslice) 'grid']; … … 4264 4256 if value 4265 4257 filebase=get(handles.displ_filebase,'String'); 4266 [nbslice, flag_grid]=get_grid(filebase,handles) 4258 [nbslice, flag_grid]=get_grid(filebase,handles); 4267 4259 if isequal(flag_grid,1) 4268 4260 mask_displ=[num2str(nbslice) 'grid'];
Note: See TracChangeset
for help on using the changeset viewer.