- Timestamp:
- Nov 6, 2025, 11:06:13 PM (5 weeks ago)
- File:
-
- 1 edited
-
trunk/src/series/bed_scan.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/bed_scan.m
r1184 r1185 101 101 FileExt=Param.InputTable{1,5}; 102 102 i_series=Param.IndexRange.first_i:Param.IndexRange.incr_i:Param.IndexRange.last_i; 103 j_series=Param.IndexRange.first_j:Param.IndexRange.incr_j:Param.IndexRange.last_j;104 103 nbfield_i=numel(i_series); 105 nb field_j=numel(j_series);104 nb_scan=400;% nbre of planes for a scan 106 105 107 106 %% directory for output files 108 107 DirOut=fullfile(RootPath,[Param.OutputSubDir Param.OutputDirExt]); 109 108 110 %% get the set of input file names (cell array filecell), and file indices 111 %[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 112 % filecell{iview,fileindex}: cell array representing the list of file names 113 % iview: line in the table corresponding to a given file series 114 % fileindex: file index within the file series, 115 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 116 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 117 %nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 118 % nbfield_i=size(i1_series{1},2); %nb of fields for the i index 119 % 120 % nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 109 %% get the set of input file names and frame indices 121 110 CheckVirtual=false; 122 111 if isfield(Param,'FileSeries')% virtual file indexing used (e.g. multitif images) 123 112 CheckVirtual=true; 124 113 end 114 125 115 126 116 %%%%%%%%%%%% END STANDARD PART %%%%%%%%%%%%fullfile( … … 131 121 CalibFolder=fullfile(RootRoot,'EXP_INIT',CamName); 132 122 File_init=fullfile(CalibFolder,'images.png.bed','Z_init.nc'); 133 Data_init=nc2struct(File_init); 123 [Data_init,~,~,errormsg]=nc2struct(File_init); 124 if isempty(errormsg) 125 disp([File_init ' loaded']) 126 else 127 disp(errormsg) 128 return 129 end 130 %% get the time from the ImaDoc xml file 131 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 132 [XmlData,warnmsg]=imadoc2struct(XmlFileName); 133 if isempty(warnmsg) 134 Time=mean(XmlData.Time(i_series+1,2:nb_scan+1),2);% time averaged on the j index (laser scan) 135 else 136 disp(warnmsg) 137 Time=zeros(size(i_series));% time not defined 138 end 139 140 134 141 %% set of y positions 135 142 136 nb_scan=400;% nbre of planes for a scan 137 if nbfield_j<400 138 nb_scan=nbfield_j; 139 end 143 140 144 %ycalib=[-51 -1 49];% calibration planes 141 145 y_scan=-51+0.25*(1:nb_scan);% transverse position given by the translating system: first view at y=-51, view 400 at y=+49 … … 206 210 % main loop 207 211 for ifield=1:nbfield_i 208 for img=1:nbfield_j% loop on positions 212 ifield 213 for img=1:nb_scan % loop on y positions 209 214 if CheckVirtual 210 [FileName,FrameIndex]=index2filename(Param.FileSeries,i_series(ifield), j_series(img),nbfield_j);215 [FileName,FrameIndex]=index2filename(Param.FileSeries,i_series(ifield),img,nb_scan); 211 216 InputFile=fullfile(RootPath,SubDir,FileName); 212 217 else 213 InputFile=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,FileIndex,i field,[],img);218 InputFile=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,FileIndex,i_series(ifield),[],img); 214 219 FrameIndex=1; 215 220 end … … 252 257 Data.ListVarName={'coord_x','y_scan','Z','dZ'}; 253 258 Data.VarDimName={'coord_x','y_scan',{'y_scan','coord_x'},{'y_scan','coord_x'}}; 259 Data.ListGlobalAttribute={'Time'}; 260 Data.Time=Time(ifield); 254 261 Data.VarAttribute{1}.Role='coord_x'; 255 262 Data.VarAttribute{1}.unit='cm'; … … 262 269 Data.coord_x=coord_x; 263 270 Data.y_scan=y_scan; 264 struct2nc(fullfile(DirOut,['dZ_' num2str(i field) '.nc']),Data)271 struct2nc(fullfile(DirOut,['dZ_' num2str(i_series(ifield)) '.nc']),Data) 265 272 end 266 273
Note: See TracChangeset
for help on using the changeset viewer.
