Changeset 1180 for trunk/src/get_file_info.m
- Timestamp:
- Mar 27, 2025, 5:59:21 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_info.m
r1178 r1180 1 %'get_file_info': determine info about a file (image, multimage, civdata,...) . 1 %'get_file_info': determine info about a file (image, multimage, civdata,...) . 2 2 %------------------------------------------------------------------------ 3 3 % [FileInfo,VideoObject]=get_file_info(fileinput) … … 19 19 % ='cine_phantom': images from fast camera Phantom 20 20 % ='bin': binary file without specific organisation 21 % ='netcdf': netcdf file 21 % ='netcdf': netcdf file 22 22 % ='civdata': netcdf files provided by civ_series 23 23 % ='civx': netcdf files provided by the obsolete program civx (in fortran) … … 69 69 return %input file does not exist. 70 70 end 71 [ tild,tild,FileExt]=fileparts(fileinput);%get the file extension FileExt71 [~,~,FileExt]=fileparts(fileinput);%get the file extension FileExt 72 72 73 73 switch FileExt … … 128 128 FileInfo.TimeName='video'; 129 129 case '.hcc' 130 %cd 'TelopsToolbox_20230707(r20340)' 131 installToolboxIRCAM 130 installToolboxIRCAM 132 131 [~,InfoArray]=readIRCam(fileinput,'HeadersOnly',true); 133 FileInfo.FileType='telopsIR'; 134 FileInfo.Height=InfoArray(1).Height; 135 FileInfo.Width=InfoArray(1).Width; 136 FileInfo.FrameRate=InfoArray(1).AcquisitionFrameRate; 137 FileInfo.NumberOfFrames=numel(InfoArray); 138 FileInfo.TimeName='video'; 132 FileInfo.FileType='telopsIR'; 133 FileInfo.Height=InfoArray(1).Height; 134 FileInfo.Width=InfoArray(1).Width; 135 FileInfo.FrameRate=InfoArray(1).AcquisitionFrameRate; 136 FileInfo.NumberOfFrames=numel(InfoArray); 137 FileInfo.TimeName='video'; 138 Path=fileparts(fileinput);% look for the xml file to document theb file series 139 [RootPath,SubDir,DirExt]=fileparts(Path); 140 if ~isempty(DirExt) 141 disp(['ERROR: change the name of the folder containing the image files: no file extension ' DirExt]) 142 FileInfo.FileType='error'; 143 return 144 end 145 XmlFile=fullfile(RootPath,[SubDir '.xml']); 146 CheckWriteImaDoc=true; 147 if exist(XmlFile,'file') 148 [XmlData,~,errormsg]=xml2struct(XmlFile); 149 if ~isempty(errormsg) 150 disp(errormsg) 151 FileInfo.FileType='error'; 152 return 153 elseif isfield(XmlData,'FileSeries') 154 CheckWriteImaDoc=false; 155 end 156 end 157 if CheckWriteImaDoc 158 DirContent=dir(Path); 159 NbFiles=0; 160 FileSeries.Convention='telopsIR'; 161 for ilist=1:numel(DirContent) 162 FName=DirContent(ilist).name; 163 if ~isempty(regexp(FName,'.hcc$', 'once')) 164 NbFiles=NbFiles+1; 165 FileSeries.FileName{NbFiles,1}=FName; 166 end 167 end 168 FileSeries.NbFramePerFile=FileInfo.NumberOfFrames; 169 [checkupdate,xmlfile,errormsg]=update_imadoc(RootPath,SubDir,'FileSeries',FileSeries); 170 end 171 139 172 otherwise 140 173 if ~isempty(FileExt)% exclude empty extension … … 160 193 FileInfo.error=ME.message; 161 194 end 195 162 196 else 163 197 error_nc=0; … … 205 239 end 206 240 FileInfo.ListDimName=Data.ListDimName; 207 % FileInfo.NumberOfFrames=Data.DimValue;241 % FileInfo.NumberOfFrames=Data.DimValue; 208 242 end 209 243 else … … 218 252 INFO=mmfileinfo (fileinput); 219 253 if ~isempty(INFO.Video.Format) 220 221 254 VideoObject=mmreader(fileinput); 222 255 FileInfo=get(VideoObject);
Note: See TracChangeset
for help on using the changeset viewer.