Changeset 1032
- Timestamp:
- Mar 22, 2018, 9:27:17 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_info.m
r1027 r1032 65 65 FileInfo.Height=size(Image,2); 66 66 FileInfo.Width=size(Image,1); 67 FileInfo.TimeName='timestamp'; 68 DateString=Input.Attributes{60}.Value 69 TimeString=Input.Attributes{59}.Value 67 70 catch ME 68 msgbox_uvmat('ERROR', ME.message)71 msgbox_uvmat('ERROR',[ME.message;'reading image from DaVis is possible only with Matlab version 2013 or earlier']) 69 72 return 70 73 end … … 83 86 FileInfo.Width=BitmapInfoHeader.biWidth; 84 87 FileInfo.BitDepth=BitmapInfoHeader.biBitCount; 88 FileInfo.TimeName='video'; 85 89 otherwise 86 90 if ~isempty(FileExt)% exclude empty extension … … 149 153 FileInfo.BitDepth=FileInfo.BitsPerPixel/3; 150 154 FileInfo.ColorType='truecolor'; 155 FileInfo.TimeName='video'; 151 156 FileInfo.FileName=fileinput; 152 157 nbfield=numel(fieldnames(FileInfo)); 153 FileInfo=orderfields(FileInfo,[nbfield nbfield- 3 nbfield-1 nbfield-2 (1:nbfield-4)]); %reorder the fields of fileInfo for clarity158 FileInfo=orderfields(FileInfo,[nbfield nbfield-4 nbfield-3 nbfield-1 nbfield-2 (1:nbfield-5)]); %reorder the fields of fileInfo for clarity 154 159 if ~isfield(FileInfo,'NumberOfFrames') 155 160 FileInfo.NumberOfFrames=floor(FileInfo.Duration*FileInfo.FrameRate); -
trunk/src/read_field.m
r1027 r1032 273 273 Input=readimx(FileName); 274 274 A=Input.Frames{num}.Components{1}.Planes{1}'; 275 %timestamps=double(Input.Attributes{1}.Value(2))/1000000; 276 timestamps=str2num(Input.Frames{1}.Attributes{12}.Value(1:end-3))/1000000; 275 277 case 'cine_phantom' 276 278 [A,FileInfo] = read_cine_phantom(FileName,num ); … … 281 283 %% case of image 282 284 if ~isempty(A) 283 if strcmp(FileType,'rdvision') 285 if strcmp(FileType,'rdvision')||strcmp(FileType,'image_DaVis') 284 286 Field.Time=timestamps; 285 287 end -
trunk/src/read_rdvision.m
r1027 r1032 67 67 FileInfo.FrameRate=str2double(s.sequenceSettings.framepersecond); 68 68 FileInfo.ColorType='grayscale'; 69 FileInfo.TimeName='timestamp'; 69 70 else 70 71 FileInfo.FileType=''; -
trunk/src/series/sub_background.m
r1027 r1032 107 107 108 108 %% check the validity of input file types 109 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom' };%allowed input file types(images)109 ImageTypeOptions={'image','multimage','mmreader','video','cine_phantom','image_DaVis'};%allowed input file types(images) 110 110 FileInfo=get_file_info(FirstFileName); 111 111 FileType=FileInfo.FileType; … … 348 348 imwrite(C,newname,'BitDepth',16); % save the new image 349 349 else 350 if ~isfield(FileInfo{1},'BitDepth') 351 FileInfo{1}.BitDepth=16; 352 end 350 353 if isequal(FileInfo{1}.BitDepth,16) 351 354 C=uint16(Acor); … … 379 382 end 380 383 filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},NomType{1},i1_series{1}(ifile),[],j1); 381 Aread=read_image(filename,FileType{1},MovieObject{1}, i1_series{1}(ifile));384 Aread=read_image(filename,FileType{1},MovieObject{1},frame_index{1}(ifile)); 382 385 if ndims(Aread)==3;%color images 383 386 Aread=sum(double(Aread),3);% take the sum of color components -
trunk/src/series/turb_stat.m
r1031 r1032 180 180 InputFields{1}=Param.InputFields; 181 181 end 182 if isempty(InputFields{1}.FieldName) 183 disp('ERROR: input fields U, V and posibly curl and div must be entered by get_field...') 184 return 185 end 182 186 183 187 nbfiles=0; … … 187 191 DataOut.ListGlobalAttribute= {'Conventions'}; 188 192 DataOut.Conventions= 'uvmat'; 189 DataOut.ListVarName={'coord_y', 'coord_x' ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','C ounter'};193 DataOut.ListVarName={'coord_y', 'coord_x' ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'}; 190 194 DataOut.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},... 191 {'coord_y','coord_x'},{'coord_y','coord_x'} };195 {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'}}; 192 196 DataOut.UMean=0; 193 197 DataOut.VMean=0; … … 198 202 DataOut.uvMean=0; 199 203 DataOut.Counter=0; 204 DataOut.CurlMean=0; 205 DataOut.DivMean=0; 206 DataOut.Curl2Mean=0; 207 DataOut.Div2Mean=0; 200 208 U2Mean=0; 201 209 V2Mean=0; … … 215 223 216 224 %%%%%%%%%%%% MAIN RUNNING OPERATIONS %%%%%%%%%%%% 217 if index==1 % first field225 if index==1 %initiate the output data structure in the first field 218 226 219 227 DataOut.coord_y=Field.coord_y; 220 228 DataOut.coord_x=Field.coord_x; 221 Uprev=Field.U; 229 Uprev=Field.U;% store the current field for next iteration 222 230 Vprev=Field.V; 223 231 if isfield(Field,'FF') 224 FFprev=Field.FF; 232 FFprev=Field.FF;% possible flag for false data 225 233 else 226 FFprev=true(size(Field.U)); 234 %FFprev=true(size(Field.U)); 235 FFprev=isnan(Field.U); 227 236 end 228 237 end … … 242 251 Vprev=Field.V; 243 252 FFprev=FF; 253 if isfield(Field,'curl') && isfield(Field,'div') 254 Field.curl(FF)=0;% set to 0 the nan values 255 Field.div(FF)=0; 256 DataOut.CurlMean=DataOut.CurlMean+Field.curl; 257 DataOut.DivMean=DataOut.DivMean+Field.div; 258 DataOut.Curl2Mean=DataOut.Curl2Mean+Field.curl.*Field.curl; 259 DataOut.Div2Mean=DataOut.Div2Mean+Field.div.*Field.div; 260 end 244 261 end 245 262 %%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%% … … 258 275 DataOut.u2Mean_1=U2Mean_1-DataOut.UMean.*DataOut.UMean; % normalize the mean 259 276 DataOut.v2Mean_1=V2Mean_1-DataOut.VMean.*DataOut.VMean; % normalize the mean 260 277 DataOut.CurlMean=DataOut.CurlMean./DataOut.Counter; 278 DataOut.DivMean=DataOut.DivMean./DataOut.Counter; 279 DataOut.Curl2Mean=DataOut.Curl2Mean./DataOut.Counter-DataOut.CurlMean.*DataOut.CurlMean; 280 DataOut.Div2Mean=DataOut.Div2Mean./DataOut.Counter-DataOut.DivMean.*DataOut.DivMean; 261 281 262 282 %% calculate the profiles -
trunk/src/uvmat.m
r1031 r1032 2062 2062 XmlData.Time=[0;ones(size(i1_series,3)-1,1)]*(0:1/FileInfo.FrameRate:(FileInfo.NumberOfFrames)/FileInfo.FrameRate); 2063 2063 end 2064 if strcmp(FileInfo.FileType,'rdvision') 2065 TimeName='timestamp'; 2066 else 2067 TimeName='video'; 2068 end 2064 % if strcmp(FileInfo.FileType,'rdvision') 2065 % TimeName='timestamp'; 2066 % else 2067 % TimeName='video'; 2068 % end 2069 end 2070 if isfield(FileInfo,'TimeName') 2071 TimeName=FileInfo.TimeName; 2069 2072 end 2070 2073 if isfield(FileInfo,'ColorType') … … 3341 3344 frame_index=num_j1;% frame index from a set of indexed movies 3342 3345 end 3346 if isempty(frame_index) 3347 frame_index=1; 3348 end 3343 3349 case 'multimage' 3344 3350 FieldName='image'; … … 3369 3375 end 3370 3376 case {'image','image_DaVis'} 3371 FieldName='image'; 3377 FieldName='image'; 3378 frame_index=num_j1;%frame index for image pairs 3372 3379 end 3373 3380 if isstruct (ParamIn)
Note: See TracChangeset
for help on using the changeset viewer.