Changeset 42 for trunk/src/civ_3D.m
- Timestamp:
- Mar 10, 2010, 7:43:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_3D.m
r2 r42 158 158 end 159 159 if exist(name_todo,'file')~=2 160 hwarn=warndlg(['no batch distributed processing available, queue file ' name_todo ' absent']);160 msgbox_uvmat('ERROR',['no batch distributed processing available, queue file ' name_todo ' absent']); 161 161 % test_batch=0; % Problems to detect file on linux/nfs filesystems 162 162 end … … 571 571 if isempty(nom_type_read) 572 572 nom_type_ima='_i_j'; 573 warndlg_uvmat('no ImageName defined in ImaDoc/Heading, take _i_j indexing by default','WARNING')573 msgbox_uvmat('WARNING','no ImageName defined in ImaDoc/Heading, take _i_j indexing by default') 574 574 else 575 575 nom_type_ima=nom_type_read; … … 603 603 field_i=field_i+1; 604 604 % imagename_last=imagename; 605 [imagename,idetect]=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 605 imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 606 idetect=exist(imagename,'file'); 606 607 if isequal(nom_type_ima,'none') 607 608 idetect=0; %stop if the same image is repeated (if nom_type='none') … … 617 618 while idetect==1 618 619 field_i=field_i-1; 619 [imagename,idetect]=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 620 imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 621 idetect=exist(imagename,'file'); 620 622 if isequal(nom_type_ima,'none') 621 623 idetect=0; %stop if the same image is repeted (if nom_type='none') … … 974 976 dirname=fullfile(filepath,subdir_civ1,ext_dir); 975 977 if ~exist(fullfile(filepath,subdir_civ1,ext_dir),'dir') 976 hwarn=warndlg_uvmat(['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist'],'ERROR');978 msgbox_uvmat('ERROR',['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist']); 977 979 set(handles.list_pair_civ1,'String',{}); 978 980 return 979 981 end 980 982 for ipair=1:nbpair 981 [filename,select(ipair)]=name_generator(filebase,ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair),'.nc',nom_type_nc,1,...983 filename=name_generator(filebase,ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair),'.nc',nom_type_nc,1,... 982 984 ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair),subdir_civ1); 985 select(ipair)=exist(filename,'file'); 983 986 end 984 987 if ~exist('select','var') | isequal(select,zeros(size(1:nbpair))) … … 988 991 num_j1=ref_j-floor(browse.incr_pair(2)/2); 989 992 num_j2=ref_j+ceil(browse.incr_pair(2)/2); 990 [filename,select(1)]=name_generator(filebase,num_i1,num_j1,'.nc',nom_type_nc,1,num_i2,num_j2,subdir_civ1); 993 [filename]=name_generator(filebase,num_i1,num_j1,'.nc',nom_type_nc,1,num_i2,num_j2,subdir_civ1); 994 select(1)=exist(filename,'file'); 991 995 testpair=1; 992 996 else 993 997 if isequal(mode,'series(Dj)') | isequal(mode,'st_series(Dj)') 994 hwarn=warndlg_uvmat(['no civ1 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ1],'ERROR'); 995 set(hwarn,'WindowStyle','modal'); 998 msgbox_uvmat('ERROR',['no civ1 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ1]); 996 999 else 997 hwarn=warndlg_uvmat(['no civ1 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ1],'ERROR'); 998 set(hwarn,'WindowStyle','modal'); 1000 msgbox_uvmat('ERROR',['no civ1 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ1]); 999 1001 end 1000 1002 set(handles.list_pair_civ1,'String',{''}); … … 1159 1161 end 1160 1162 for ipair=1:nbpair 1161 [filename ,select(ipair)]=name_generator(filebase,ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair),'.nc',nom_type_nc,1,...1163 [filename]=name_generator(filebase,ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair),'.nc',nom_type_nc,1,... 1162 1164 ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair),subdir_civ1); 1165 select(ipair)=exist(filename,'file'); 1163 1166 end 1164 1167 if isequal(select,zeros(size(1:nbpair))) … … 1168 1171 num_j1=ref_j-floor(browse.incr_pair(2)/2); 1169 1172 num_j2=ref_j+floor((browse.incr_pair(2)+1)/2); 1170 [filename,select(1)]=name_generator(filebase,num_i1,num_j1,'.nc',nom_type_nc,1,num_i2,num_j2,subdir_civ2); 1173 filename=name_generator(filebase,num_i1,num_j1,'.nc',nom_type_nc,1,num_i2,num_j2,subdir_civ2); 1174 select(1)=exist(filename,'file'); 1171 1175 else 1172 1176 if isequal(mode,'series(Dj)') | isequal(mode,'st_series(Dj)') 1173 errordlg(['no civ2 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ2])1177 msgbox_uvmat('ERROR',['no civ2 file available for the selected reference index j=' num2str(ref_j) ' and subdirectory ' subdir_civ2]) 1174 1178 else 1175 errordlg(['no civ2 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ2])1179 msgbox_uvmat('ERROR',['no civ2 file available for the selected reference index i=' num2str(ref_i) ' and subdirectory ' subdir_civ2]) 1176 1180 end 1177 1181 set(handles.list_pair_civ2,'String',{}); … … 1540 1544 end 1541 1545 else 1542 warndlg_uvmat('batch system not available','ERROR')1546 msgbox_uvmat('ERROR','batch system not available') 1543 1547 return 1544 1548 end … … 1570 1574 end 1571 1575 else 1572 warndlg_uvmat('for BATCH option, UBC file names, beginning by \\, are needed','ERROR');1576 msgbox_uvmat('ERROR','for BATCH option, UBC file names, beginning by \\, are needed'); 1573 1577 set(handles.BATCH, 'Enable','On') 1574 1578 set(handles.BATCH,'BackgroundColor',[1 0 0]) … … 1599 1603 [Path_ima,Name]=fileparts(filebase);%Path of the image files (.civ_3D) 1600 1604 if ~exist(Path_ima,'dir') 1601 warndlg_uvmat(['path to images ' Path_ima ' not found'],'ERROR')1605 msgbox_uvmat('ERROR',['path to images ' Path_ima ' not found']) 1602 1606 return 1603 1607 end … … 1630 1634 for ifile=1:nbfield 1631 1635 % for j=1:nbslice 1632 [filename,detect]=name_generator(filebase,num1_civ1(ifile),[],'.nc',...1636 filename=name_generator(filebase,num1_civ1(ifile),[],'.nc',... 1633 1637 nom_type_nc,1,num2_civ1(ifile),[],subdir_civ1);% 1634 if detect==1% if a netcdf file already exists 1638 detect=exist(filename,'file') 1639 if detect% if a netcdf file already exists 1635 1640 subdir_civ1=[subdir_civ1 '.0']; 1636 1641 subdir_civ2=subdir_civ1; … … 1638 1643 end 1639 1644 filecell_nc1(ifile)={filename}; 1640 if detect ==1% if a netcdf file already exists1645 if detect% if a netcdf file already exists 1641 1646 break 1642 1647 end … … 1652 1657 %get image names 1653 1658 for ifile=1:nbfield 1654 [filecell_ima1_civ1{ifile},idetect]=name_generator(filebase, num1_civ1(ifile),[],ext_ima,nom_type_ima);%first image1655 [filecell_ima2_civ1{ifile},idetect_1]=name_generator(filebase, num2_civ1(ifile),[],ext_ima,nom_type_ima); %second image1656 if idetect==01657 warndlg_uvmat([filecell_ima1_civ1{ifile} ' not found'],'ERROR')1659 filecell_ima1_civ1{ifile}=name_generator(filebase, num1_civ1(ifile),[],ext_ima,nom_type_ima);%first image 1660 filecell_ima2_civ1{ifile}=name_generator(filebase, num2_civ1(ifile),[],ext_ima,nom_type_ima); %second image 1661 if ~exist(filecell_ima1_civ1{ifile},'file') 1662 msgbox_uvmat('ERROR',[filecell_ima1_civ1{ifile} ' not found']) 1658 1663 set(handles.BATCH, 'Enable','On') 1659 1664 set(handles.BATCH,'BackgroundColor',[1 0 0]) 1660 1665 cd(currentdir) 1661 1666 return 1662 end 1663 if idetect_1==0,1664 errordlg([filecell_ima2_civ1{ifile} ' not found'])1667 end 1668 if ~exist(filecell_ima2_civ1{ifile},'file') 1669 msgbox_uvmat('ERROR',[filecell_ima2_civ1{ifile} ' not found']) 1665 1670 set(handles.BATCH, 'Enable','On') 1666 1671 set(handles.BATCH,'BackgroundColor',[1 0 0]) … … 1692 1697 waitbar(ifile/nbfield); 1693 1698 Atot=[]; 1694 [filename_A,idetect_cur]=name_generator(filebase,num1_civ1(ifile),1,'.png','_i');%A VOIR 1699 filename_A=name_generator(filebase,num1_civ1(ifile),1,'.png','_i');%A VOIR 1700 idetect_cur=exist(filename_A,'file'); 1695 1701 for j=1:nbslice 1696 1702 if idetect_cur==0 … … 1703 1709 %filecell_ima1_civ1(ifile,j)={filename}; 1704 1710 Atot=[]; 1705 [filename_B,idetect_cur]=name_generator(filebase, num2_civ1(ifile),1,'.png','_i'); 1711 filename_B=name_generator(filebase, num2_civ1(ifile),1,'.png','_i'); 1712 idetect_cur=exist(filename_B,'file'); 1706 1713 for j=1:nbslice 1707 1714 if idetect_cur==0 … … 1742 1749 end 1743 1750 end 1744 1751 'TESTciv3D' 1752 nbfield 1745 1753 for ifile=1:nbfield 1746 1754 i_cmd=0; … … 2176 2184 browse=get(handles.browse_root,'UserData'); 2177 2185 varargin{1}=''; 2178 [image_name,idetect]=name_generator(filebase,1,1,browse.ext_ima,browse.nom_type_ima);%name of an image2179 if idetect==12186 image_name=name_generator(filebase,1,1,browse.ext_ima,browse.nom_type_ima);%name of an image 2187 if exist(image_name,'file') 2180 2188 varargin{1}=image_name; 2181 2189 end 2182 warndlg_uvmat('no mask available, use TOOL menu in the uvmat interface to create it','ERROR')2190 msgbox_uvmat('ERROR','no mask available, use TOOL menu in the uvmat interface to create it') 2183 2191 % makemask(varargin); %open the makemask interface 2184 2192 else
Note: See TracChangeset
for help on using the changeset viewer.