- Timestamp:
- Sep 7, 2018, 8:51:09 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_cells.m
r1057 r1058 17 17 % _image : B/W image, (behaves like scalar) 18 18 % _vector_x,_y,_z: indices of variables giving the vector components x, y, z 19 % _warnflag: index of warnflag 19 % _warnflag: index of warnflag 20 % _histo: index of variable used as histogram 20 21 % .DimIndex 21 22 % .ProjModeRequest= 'interp_lin', 'interp_tps' indicate whether lin interpolation or derivatives (tps) is needed to calculate the requested field … … 118 119 end 119 120 ind_discrete=find(strcmp('discrete',Role)); 120 ind_coord_x= find(strcmp('coord_x',Role));121 ind_coord_x=[find(strcmp('coord_x',Role)) find(strcmp('histo',Role))]; 121 122 ind_coord_y=find(strcmp('coord_y',Role)); 122 123 ind_coord_z=find(strcmp('coord_z',Role)); 124 ind_histo=find(strcmp('histo',Role)); 123 125 ind_coord_tps=find(strcmp('coord_tps',Role)); 124 126 check_string=cellfun(@ischar,Data.VarDimName)==1; … … 477 479 Cell1DPlot{icell}.YIndex_discrete=[]; 478 480 DimCell_x=Data.VarDimName{ind_coord_x(icell)}; 479 for ivar= ind_coord_y481 for ivar=[ind_coord_y ind_histo] 480 482 DimCell=Data.VarDimName{ivar}; 481 483 if numel(DimCell_x)==1 && strcmp(DimCell_x{1},DimCell{1}) -
trunk/src/plot_field.m
r1048 r1058 585 585 TextDisplay=0; 586 586 for icell=1:numel(CellInfo) 587 if isfield(CellInfo{icell},'VarIndex_histo') 587 if isfield(CellInfo{icell},'VarIndex_histo')% case of histogram plot 588 588 TextDisplay=1; 589 589 VarName=data.ListVarName{CellInfo{icell}.CoordIndex}; -
trunk/src/proj_field.m
r1057 r1058 509 509 if isfield(FieldData,'VarAttribute')&& numel(FieldData.VarAttribute)>=ivar 510 510 VarAttribute_var=FieldData.VarAttribute{ivar}; 511 VarAttribute_var.Role='coord_x'; 511 512 end 512 513 % VarAttribute_var.Role='coord_x';% the variable is now used as an absissa -
trunk/src/read_field.m
r1045 r1058 265 265 A=imread(FileName); 266 266 case 'rdvision' 267 [A,FileInfo,timestamps ]=read_rdvision(FileName,num);267 [A,FileInfo,timestamps,errormsg]=read_rdvision(FileName,num); 268 268 case 'image_DaVis' 269 269 Input=readimx(FileName); -
trunk/src/read_rdvision.m
r1047 r1058 125 125 % binrepertoire='2017-01-19T22.12.182'% EXP14 %%%%%%%%%%%%%%%%%%%%%%%%% 126 126 binfile=fullfile(RootPath,binrepertoire,sprintf('%s%.5d.bin',bin_file,data(ii).file_idx)); 127 if ~exist(binfile,'file') 128 errormsg=[binfile ' does not exist']; 129 return 130 else 127 131 fid=fopen(binfile,'rb'); 128 132 fseek(fid,data(ii).offset,-1); 129 133 A(:,:,i)=reshape(fread(fid,w*h,classname),w,h)'; 130 134 fclose(fid); 135 end 131 136 end 132 137 -
trunk/src/series/merge_proj.m
r1033 r1058 533 533 end 534 534 end 535 % if isempty(FFName)536 % FFName='FF';537 % end538 % MergeData.(FFName)(NbAver~=0)=0;% flag to 1 undefined summed data539 % MergeData.(FFName)(NbAver==0)=1;% flag to 1 undefined summed data540 535 end 541 536 end -
trunk/src/series/merge_proj_polar.m
r1027 r1058 100 100 HeadData.ListVarName= {'radius','azimuth'} ; 101 101 HeadData.VarDimName={'radius','azimuth'}; 102 HeadData.VarAttribute={'coord_y','coord_x'} ; 102 HeadData.VarAttribute{1}.Role='coord_y'; 103 HeadData.VarAttribute{2}.Role='coord_x'; 103 104 HeadData.radius=radius_shifted; 104 105 HeadData.azimuth=azimuth_arclength; … … 373 374 ProjData{iview}.ListVarName= [ProjData{iview}.ListVarName ListVarName]; 374 375 ProjData{iview}.VarDimName={'radius','azimuth'}; 375 ProjData{iview}.VarAttribute=[{'coord_x'} {'coord_y'} VarAttribute]; 376 % ProjData{iview}.VarAttribute{1}.Role='coord_y'; 377 % ProjData{iview}.VarAttribute{2}.Role='coord_x'; 378 ProjData{iview}.VarAttribute=[ProjData{iview}.VarAttribute VarAttribute]; 376 379 for ivar=1:numel(ListVarName) 377 380 ProjData{iview}.VarDimName{ivar+2}={'radius','azimuth'}; … … 457 460 disp([ num2str(ellapsed_time/(60*NbField),3) ' minutes per iteration']) 458 461 462 % %'merge_field': concatene fields 463 % %------------------------------------------------------------------------ 464 % function [MergeData,errormsg]=merge_field(Data) 465 % %% default output 466 % if isempty(Data)||~iscell(Data) 467 % MergeData=[]; 468 % return 469 % end 470 % errormsg=''; 471 % MergeData=Data{1};% merged field= first field by default, reproduces the global attributes of the first field 472 % NbView=length(Data); 473 % if NbView==1% if there is only one field, just reproduce it in MergeData 474 % return 475 % end 476 % 477 % %% group the variables (fields of 'Data') in cells of variables with the same dimensions 478 % [CellInfo,NbDim,errormsg]=find_field_cells(Data{1}); 479 % if ~isempty(errormsg) 480 % return 481 % end 482 % 483 % %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 484 % for icell=1:length(CellInfo) 485 % if NbDim(icell)~=1 % skip field cells which are of dim 1 486 % switch CellInfo{icell}.CoordType 487 % case 'scattered' %case of input fields with unstructured coordinates: just concatene data 488 % for ivar=CellInfo{icell}.VarIndex % indices of the selected variables in the list FieldData.ListVarName 489 % VarName=Data{1}.ListVarName{ivar}; 490 % for iview=2:NbView 491 % MergeData.(VarName)=[MergeData.(VarName); Data{iview}.(VarName)]; 492 % end 493 % end 494 % case 'grid' %case of fields defined on a structured grid 495 % FFName=''; 496 % if isfield(CellInfo{icell},'VarIndex_errorflag') && ~isempty(CellInfo{icell}.VarIndex_errorflag) 497 % FFName=Data{1}.ListVarName{CellInfo{icell}.VarIndex_errorflag};% name of errorflag variable 498 % MergeData.ListVarName(CellInfo{icell}.VarIndex_errorflag)=[];%remove error flag variable in MergeData (will use NaN instead) 499 % MergeData.VarDimName(CellInfo{icell}.VarIndex_errorflag)=[]; 500 % MergeData.VarAttribute(CellInfo{icell}.VarIndex_errorflag)=[]; 501 % end 502 % % select good data on each view 503 % for ivar=CellInfo{icell}.VarIndex % indices of the selected variables in the list FieldData.ListVarName 504 % VarName=Data{1}.ListVarName{ivar}; 505 % for iview=1:NbView 506 % if isempty(FFName) 507 % check_bad=isnan(Data{iview}.(VarName));%=0 for NaN data values, 1 else 508 % else 509 % check_bad=isnan(Data{iview}.(VarName)) | Data{iview}.(FFName)~=0;%=0 for NaN or error flagged data values, 1 else 510 % end 511 % Data{iview}.(VarName)(check_bad)=0; %set to zero NaN or data marked by error flag 512 % if iview==1 513 % %MergeData.(VarName)=Data{1}.(VarName);% initiate MergeData with the first field 514 % MergeData.(VarName)(check_bad)=0; %set to zero NaN or data marked by error flag 515 % NbAver=~check_bad;% initiate NbAver: the nbre of good data for each point 516 % elseif size(Data{iview}.(VarName))~=size(MergeData.(VarName)) 517 % errormsg='sizes of the input matrices do not agree, need to interpolate on a common grid using a projection object'; 518 % return 519 % else 520 % MergeData.(VarName)=MergeData.(VarName) +double(Data{iview}.(VarName));%add data 521 % NbAver=NbAver + ~check_bad;% add 1 for good data, 0 else 522 % end 523 % end 524 % MergeData.(VarName)(NbAver~=0)=MergeData.(VarName)(NbAver~=0)./NbAver(NbAver~=0);% take average of defined data at each point 525 % MergeData.(VarName)(NbAver==0)=NaN;% set to NaN the points with no good data 526 % end 527 % end 528 % 529 % end 530 % end 531 532 459 533 %'merge_field': concatene fields 460 534 %------------------------------------------------------------------------ … … 469 543 NbView=length(Data); 470 544 if NbView==1% if there is only one field, just reproduce it in MergeData 471 return 545 return 472 546 end 473 547 … … 514 588 errormsg='sizes of the input matrices do not agree, need to interpolate on a common grid using a projection object'; 515 589 return 516 else 590 else 517 591 MergeData.(VarName)=MergeData.(VarName) +double(Data{iview}.(VarName));%add data 518 592 NbAver=NbAver + ~check_bad;% add 1 for good data, 0 else … … 523 597 end 524 598 end 525 % if isempty(FFName) 526 % FFName='FF'; 527 % end 528 % MergeData.(FFName)(NbAver~=0)=0;% flag to 1 undefined summed data 529 % MergeData.(FFName)(NbAver==0)=1;% flag to 1 undefined summed data 530 end 531 end 532 533 534 599 end 600 end -
trunk/src/series/sub_background.m
r1033 r1058 140 140 141 141 %% setting of parameters specific to sub_background 142 nbaver_init=23; %default number of images used for the sliding background: to be adjusted later to include an integer number of bursts 143 if nbfield_i~=1 142 CheckVolume='No'; 143 nbaver_init=23; %default number of images used for the sliding background: to be adjusted later to include an integer number of bursts 144 if nbfield_i~=1 144 145 nbaver=floor(nbaver_init/nbfield_j); % number of bursts used for the sliding background, 145 146 if isequal(mod(nbaver,2),0)% if nbaver is even … … 148 149 nbaver_init=nbaver*nbfield_j;%propose by default an integer number of bursts 149 150 end 150 151 BrightnessRankThreshold=0.1; 152 CheckSubmedian='No'; 153 SaturationCoeff=0; 154 if isfield(Param,'ActionInput') 155 if isfield(Param.ActionInput,'CheckVolume') && Param.ActionInput.CheckVolume 156 CheckVolume='Yes'; 157 end 158 if isfield(Param.ActionInput,'SlidingSequenceLength') 159 nbaver_init=Param.ActionInput.SlidingSequenceLength; 160 end 161 if isfield(Param.ActionInput,'BrightnessRankThreshold') 162 BrightnessRankThreshold=Param.ActionInput.BrightnessRankThreshold; 163 end 164 if isfield(Param.ActionInput,'CheckSubmedian') && Param.ActionInput.CheckSubmedian 165 CheckSubmedian='Yes'; 166 end 167 if isfield(Param.ActionInput,'SaturationCoeff') 168 SaturationCoeff=Param.ActionInput.SaturationCoeff; 169 end 170 end 151 171 prompt = {'volume scan mode (Yes/No)';... 152 172 'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';... 153 173 'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles';... 154 174 'set to 0 image levels below median(Yes/No)';... 155 'image rescaling coefficient( high valuesreduce the influence of bright particles), =0 for no rescaling' };175 'image rescaling coefficient(=2 to reduce the influence of bright particles), =0 for no rescaling' }; 156 176 dlg_title = 'get (slice by slice) a sliding background and substract to each image'; 157 177 num_lines= 5; 158 def = { 'No';num2str(nbaver_init);'0.1';'No';'2'};178 def = { CheckVolume;num2str(nbaver_init);num2str(BrightnessRankThreshold);CheckSubmedian;num2str(SaturationCoeff)}; 159 179 answer = inputdlg(prompt,dlg_title,num_lines,def); 160 180 if isempty(answer) -
trunk/src/uvmat.m
r1057 r1058 2637 2637 Mask.NbSlice_j=1; 2638 2638 if isempty(j1_series) 2639 if isempty(i1_series) 2640 MaskNomType='*'; 2641 else 2639 2642 Mask.NbSlice_i=i1_series(1,2,end); 2643 end 2640 2644 else 2641 2645 Mask.NbSlice_j=j1_series(1,end,2); … … 2667 2671 MaskIndex_i=str2num(get(handles.z_index,'String')); 2668 2672 else 2669 MaskIndex_i=mod(str2num(get(handles.i1,'String')),Mask.NbSlice_i); 2670 end 2673 MaskIndex_i=mod(str2num(get(handles.i1,'String'))-1,Mask.NbSlice_i)+1; 2674 end 2675 MaskIndex_z=MaskIndex_i;%default 2671 2676 if Mask.NbSlice_j>1 2672 2677 MaskIndex_j=str2num(get(handles.j1,'String')); 2678 MaskIndex_z=MaskIndex_j; 2673 2679 else 2674 2680 MaskIndex_j=1; … … 2702 2708 return 2703 2709 end 2704 MaskField.ZIndex=MaskIndex_ i;2710 MaskField.ZIndex=MaskIndex_z; 2705 2711 %px to phys or other transform on field 2706 2712 menu_transform=get(handles.TransformName,'String');
Note: See TracChangeset
for help on using the changeset viewer.