Changeset 183
- Timestamp:
- Jan 26, 2011, 5:03:40 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r182 r183 1724 1724 end 1725 1725 end 1726 %test_interp=get(handles.test_interp,'Value');1727 1728 1726 if isfield(sparam,'PatchBin') 1729 1727 if ~exist(sparam.PatchBin,'file') … … 1731 1729 end 1732 1730 end 1733 % if test_interp && isfield(sparam,'PatchNewBin')1734 % if ~exist(sparam.PatchNewBin,'file')1735 % sparam.PatchNewBin=fullfile(path_UVMAT,sparam.PatchNewBin);1736 % end1737 % end1738 1731 if isfield(sparam,'FixBin') 1739 1732 if ~exist(sparam.FixBin,'file') … … 1746 1739 batch_mode=sparam.BatchMode; 1747 1740 end 1748 else1749 % MaxCivProcesses=50;1750 % if isfield(sparam,'MaxCivProcesses')1751 % MaxCivProcesses=str2double(sparam.MaxCivProcesses);1752 % end1753 1741 end 1754 1742 … … 1756 1744 %% get civ1 parameters: 1757 1745 display('files OK, processing...') 1758 %get civ parameters1759 1746 if box_test(1)==1 1760 1747 par_civ1=read_param_civ1(handles,filecell.ima1.civ1{1,1}); … … 1863 1850 cmd=''; 1864 1851 if isunix % check: necessaire aussi en RUN? 1865 %fid=fopen([filename '.cmx'],'w')1866 1852 cmd='#!/bin/bash \n'; 1867 1853 cmd=[cmd '#$ -cwd \n']; … … 1874 1860 civAllxml=set(civAllxml,1,'name','CivDoc'); 1875 1861 end 1876 %filename_cur=filecell.nc.civ1{ifile,j};%output netcdf file1877 1862 [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extention) 1878 1863 flname=fullfile(Rootbat,Filebat); 1879 %filename_cmx(end-1:end+6)='civ1.cmx';%name of cmx file1880 1864 if batch 1881 % [Rootbat,Filebat,extbat]=fileparts(filename_cmx);1882 1865 filename_bat=fullfile(Rootbat,['job_' Filebat]); 1883 1866 else … … 1890 1873 par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j}; 1891 1874 par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j}; 1892 %namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];1893 1875 par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j))); 1894 1876 par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2); … … 1943 1925 i_cmd=i_cmd+1; 1944 1926 if isequal(civAll,0) 1945 cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n']; 1927 if(isunix) 1928 cmd=[cmd 'cp -f ' flname '.civ1.cmx ' flname '.cmx\n']; 1929 else 1930 flname=regexprep(flname,'\\','\\\\'); 1931 cmd=[cmd 'copy /Y "' flname '.civ1.cmx" "' flname '.cmx"\n']; 1932 end 1933 cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n'] 1946 1934 else 1947 1935 civAllCmd=[civAllCmd ' civ1 ']; … … 2054 2042 filename_cmx=filecell.nc.civ2{ifile,j};%output netcdf file 2055 2043 filename_cmx([end-1:end+1])=[ 'cmx'];%name of cmx file 2056 % filename_cmx=[filename_cmx 'x'];2057 2044 end 2058 2045 2059 2046 if box_test(4)==1 2060 2047 par_civ2.filename_ima_a=filecell.ima1.civ2{ifile,j}; 2061 %par_civ2.filename_ima_a([end-3:end])=[];%remove .png extension2062 2048 par_civ2.filename_ima_b=filecell.ima2.civ2{ifile,j}; 2063 %par_civ2.filename_ima_b([end-3:end])=[];%remove .png extension2064 2049 [Rootbat,Filebat]=fileparts(filecell.nc.civ2{ifile,j});%output netcdf file (without extention) 2065 %namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];2066 2050 par_civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j))); 2067 2051 par_civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2); … … 2115 2099 end 2116 2100 end 2117 %endTESTgrid2118 2101 i_cmd=i_cmd+1; 2119 2102 flname=fullfile(Rootbat,Filebat); … … 2234 2217 if isequal(civAll,1) 2235 2218 save(civAllxml,[filename_cmx([1:end-4]) '.xml']); 2236 %cmd=char({cmd;[CivBin ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]});2237 2219 cmd=[cmd CivBin ' -f ' filename_cmx(1:end-4) '.xml ' civAllCmd '\n']; 2238 2220 end … … 2245 2227 fprintf(fid,cmd); 2246 2228 fclose(fid); 2247 %dlmwrite(filename_bat,cmd,'');%write commands in filename_bat2248 2229 if batch 2249 2230 switch batch_mode 2250 2231 case 'sge' 2251 2232 pvalue=num2str((1-ind_answer)*500); 2252 %namelog=[filename_bat '.patch.log'];2253 2233 display(['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]); 2254 2234 eval( ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]); … … 2258 2238 if(isunix) 2259 2239 cmd_str=['. ' filename_bat]; 2260 % cmd_str=['!at -qb now -f ' filename_bat ' &']; %ou at -qb now -f bad idea...2261 2240 else %case of Windows 2262 2241 cmd_str=['@call "' regexprep(filename_bat,'\\','\\\\') '"']; -
trunk/src/mouse_up.m
r156 r183 116 116 set(hh_set_object.YObject,'String',num2str(ObjectData.Coord(:,2),4)); 117 117 set(hh_set_object.ZObject,'String',num2str(ObjectData.Coord(:,3),4)); 118 if strcmp(ObjectData.Style,'rectangle')||strcmp(ObjectData.Style,'ellipse') 119 set(hh_set_object.XMax,'String',num2str(ObjectData.RangeX,4)); 120 set(hh_set_object.YMax,'String',num2str(ObjectData.RangeY,4)); 121 end 118 122 if NbDefPoint<=2 || isequal(get(currentfig,'SelectionType'),'alt') ||... 119 123 strcmp(AxeData.Drawing,'translate') || strcmp(AxeData.Drawing,'deform');%stop drawing -
trunk/src/plot_object.m
r177 r183 47 47 ObjectData=ObjectDataIn;% TODO: modify take into account rotation of axis 48 48 else 49 return % no object representation yet available49 return % object representation only available in a plane 50 50 end 51 51 if ~isfield(ObjectData,'Style')||isempty(ObjectData.Style)||~ischar(ObjectData.Style) -
trunk/src/read_field.m
r182 r183 27 27 % .ColorVar: variable used for vector color 28 28 % .Npx, .Npy: nbre of pixels along x and y (used for .vol input files) 29 function [Field,ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn )29 function [Field,ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num) 30 30 Field=[]; 31 31 ParamOut=[]; … … 124 124 case 'movie' 125 125 try 126 A=read(ObjectName,num _i1);126 A=read(ObjectName,num); 127 127 FieldName='image'; 128 128 catch … … 132 132 case 'avi' 133 133 try 134 mov=aviread(ObjectName,num _i1);134 mov=aviread(ObjectName,num); 135 135 catch 136 136 errormsg=lasterr; … … 146 146 FieldName='image'; 147 147 case 'multimage' 148 A=imread(ObjectName,num _i1);148 A=imread(ObjectName,num); 149 149 FieldName='image'; 150 150 case 'image' … … 187 187 188 188 189 -
trunk/src/set_object.m
r182 r183 84 84 end 85 85 set(hObject,'KeyPressFcn',{'keyboard_callback',handles})%set keyboard action function (allow action on uvmat when set_object is in front) 86 %set(handles.MenuCoord,'ListboxTop',1)87 % if ~exist('PlotHandles','var')88 % PlotHandles=[];89 % end90 86 enable_plot=0;%default: does not allow plot of object and projection 91 % SetData.PlotHandles=PlotHandles;92 % set(hObject,'UserData',SetData)93 87 94 88 % fill the interface as set in the input data: … … 99 93 if isfield(data,'Name') 100 94 set(handles.TITLE,'String',data.Name) 101 % set(hObject,'name',data.Name)102 95 end 103 96 if ~isfield(data,'NbDim')||~isequal(data.NbDim,3)%2D case … … 125 118 ObjectStyle_Callback(hObject, eventdata, handles) 126 119 if isfield(data,'ProjMenu') 127 set(handles.ProjMode,'String',data.ProjMenu); 120 set(handles.ProjMode,'String',data.ProjMenu);%overset the standard menu 128 121 end 129 122 if isfield(data,'ProjMode') … … 244 237 set(handles.CoordUnit,'String',data.CoordUnit) 245 238 end 246 % if isfield(data,'CoordType')&& isequal(data.CoordType,'px')247 % % if isequal(data.CoordType,'phys')248 % % set(handles.MenuCoord,'Value',1)249 % % elseif isequal(data.CoordType,'px')250 % set(handles.MenuCoord,'Value',2)251 % % end252 % end253 239 end 254 240 if enable_plot … … 267 253 end 268 254 255 %------------------------------------------------------------------------ 269 256 % --- Outputs from this function are returned to the command line. 270 257 function varargout = set_object_OutputFcn(hObject, eventdata, handles) 271 % varargout cell array for returning output args (see VARARGOUT); 272 % hObject handle to figure 273 % eventdata reserved - to be defined in a future version of MATLAB 274 % handles structure with handles and user data (see GUIDATA) 275 258 %------------------------------------------------------------------------ 276 259 % Get default command line output from handles structure 277 260 varargout{1} = handles.output; … … 281 264 % --- Executes on selection change in ObjectStyle. 282 265 function ObjectStyle_Callback(hObject, eventdata, handles) 266 %------------------------------------------------------------------------ 283 267 style_prev=get(handles.ObjectStyle,'UserData');%previous object style 284 268 str=get(handles.ObjectStyle,'String'); … … 286 270 style=str{val}; 287 271 % make correspondance between different object styles 288 % if ~isequal(str{val},style_prev)289 272 Xcolumn=get(handles.XObject,'String'); 290 273 Ycolumn=get(handles.YObject,'String'); … … 333 316 set(handles.ZObject,'String',z_new) 334 317 end 335 % end 318 336 319 switch style 337 320 case {'points','line','polyline','plane'} … … 542 525 s.ProjMode='none'; 543 526 end 544 %Display title545 % title=set_title(s.Style,s.ProjMode);%update the title546 % if ~isempty(huvmat)547 % hhuvmat=guidata(huvmat);548 % end549 % menu=get(handles.TITLE,'String');550 % for iline=1:length(menu)551 % if isequal(menu{iline},title)552 % set(handles.TITLE,'Value',iline)553 % break554 % end555 % end556 %TITLE_Callback(hObject, eventdata, handles)557 527 teststyle=0; 558 528 … … 585 555 586 556 ProjMode_Callback(hObject, eventdata, handles);%visualize the appropriate edit boxes 587 % if isfield(s,'CoordType')588 % if isequal(s.CoordType,'phys')589 % set(handles.MenuCoord,'Value',1)590 % elseif isequal(s.CoordType,'px')591 % set(handles.MenuCoord,'Value',2)592 % else593 % warndlg('unknown CoordType (px or phys) in set_object.m')594 % end595 % end596 557 if isfield(s,'XMax') 597 558 set(handles.XMax,'String',s.XMax) -
trunk/src/update_obj.m
r180 r183 12 12 % .Object{IndexObj}.DisplayHandle_uvmat: handles of the object plot on uvmat, =[] if it does not exist 13 13 % .Object{IndexObj}.DisplayHandle_view_field: handles of the object plot on view_field, =[] if it does not exist 14 %IndexObj: object index of UvData.Object correspopnding to the updated object 15 %ObjectData: structure containing the input object properties to be attributed to the object #IndexObj 16 % .Style: style of the object: 'line', 'rectangle'... 17 %PlotHandles: structure containing the handles of the plotting parameter buttons on the uvmat or view_field interface 14 %IndexObj_1: index of the object used for the uvmat plot 15 %IndexObj_2: index of the object used for the view_field plot 18 16 %------------------------------------- 19 17 … … 26 24 %% representation of the different objects in the plots uvmat and view_field 27 25 %plot uvmat 28 for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_1 29 hobject=[]; 30 if isfield(Object_out{iobj},'DisplayHandle_uvmat') && ~isempty(Object_out{iobj}.DisplayHandle_uvmat) && ishandle(Object_out{iobj}.DisplayHandle_uvmat) 31 hobject=Object_out{iobj}.DisplayHandle_uvmat;%graphic handle of object #iobj in the uvmat plot 32 end 33 Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation of Object_out{iobj} on Object_out{IndexObj_1} 26 for iobj=1:length(Object_out) %change the view of all existing objects on the updated current object #IndexObj_1 27 hobject=[]; 28 if isfield(Object_out{iobj},'DisplayHandle_uvmat') && ~isempty(Object_out{iobj}.DisplayHandle_uvmat) && ishandle(Object_out{iobj}.DisplayHandle_uvmat) 29 hobject=Object_out{iobj}.DisplayHandle_uvmat;%graphic handle of object #iobj in the uvmat plot 34 30 end 31 Object_out{iobj}.DisplayHandle_uvmat=plot_object(Object_out{iobj},Object_out{IndexObj_1},hobject,'m');%update the object representation of Object_out{iobj} on Object_out{IndexObj_1} 32 end 35 33 % plot view_field 36 34 if ~isempty(IndexObj_2) 37 for iobj=1:length(Object_out) %change the view of all existing objects on the updated currentobject #IndexObj_235 for iobj=1:length(Object_out) %change the view of all existing objects on the updated object #IndexObj_2 38 36 hobject=[]; 39 37 if isfield(Object_out{iobj},'DisplayHandle_view_field') && ~isempty(Object_out{iobj}.DisplayHandle_view_field) && ishandle(Object_out{iobj}.DisplayHandle_view_field) -
trunk/src/uvmat.m
r180 r183 2159 2159 ParamIn.VelType=VelType; 2160 2160 ParamIn.GUIName='get_field'; 2161 [Field{1},ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn); 2161 [Field{1},ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num_i1); 2162 if ~isempty(errormsg) 2163 errormsg=['error in reading ' filename ': ' errormsg]; 2164 return 2165 end 2162 2166 if isfield(ParamOut,'Npx')&& isfield(ParamOut,'Npy') 2163 2167 set(handles.npx,'String',num2str(ParamOut.Npx));% display image size on the interface … … 2244 2248 ParamIn.VelType=VelType_1; 2245 2249 ParamIn.GUIName='get_field_1'; 2246 [Field{2},ParamOut_1,errormsg] = read_field(Name,FileType_1,ParamIn); 2250 [Field{2},ParamOut_1,errormsg] = read_field(Name,FileType_1,ParamIn,num_i1); 2251 if ~isempty(errormsg) 2252 errormsg=['error in reading ' filename_1 ': ' errormsg]; 2253 return 2254 end 2247 2255 UvData.Field_1=Field{2}; %store the second field for possible use at next RUN 2248 2256 end … … 4248 4256 if ~isempty(hview_field) 4249 4257 delete(hview_field) 4258 end 4259 hset_object=findobj(allchild(0),'Tag','set_object'); 4260 if ~isempty(hset_object) 4261 delete(hset_object) 4250 4262 end 4251 4263 else
Note: See TracChangeset
for help on using the changeset viewer.