Ignore:
Timestamp:
May 21, 2025, 6:14:05 PM (13 days ago)
Author:
sommeria
Message:

image rescale included in civ_series input

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_file_info.m

    r1180 r1181  
    1 %'get_file_info': determine info about a file (image, multimage, civdata,...) .
     1%'gext_file_info': determine info about a file (image, multimage, civdata,...) .
    22%------------------------------------------------------------------------
    33% [FileInfo,VideoObject]=get_file_info(fileinput)
     
    55% OUTPUT:
    66% FileInfo: structure containing info on the file (case of images or video), in particular
    7 %      .FileType: type of file, needed as input of read_field.m
    8 %               ='figure': Matlab figure
     7%     .FileName: confirms the file name, ='' if the file is not detected 
     8%     .FileType: type of file, needed as input of read_field.m
     9%               ='': unknown format
     10%               ='bin': binary file without specific organisation
     11%               ='dat': text file for data
     12%               ='figure': Matlab figure file, ext .fig
    913%               ='mat': Matlab data file
     14%               ='netcdf': generic netcdf file
    1015%               ='xml': xml file
    1116%               ='xls': Excel file
    12 %               ='dat': text file for data,
     17%               ='civdata': netcdf files provided by civ_series
     18%               ='pivdata_fluidimage': PIV data from software 'fluidimage'
     19%   different image and movie formats:
    1320%               ='image': image format recognised by Matlab
    1421%               ='multimage': image format recognised by Matlab with  multiple frames
     
    1623%               ='mmreader': video from old versions of Matlab (<2009)
    1724%               ='rdvision': images in binary format from company rdvision
    18 %               ='image_DaVis': images from softwar DaVis (company LaVision)
     25%               ='image_DaVis': images from softwar DaVis (company LaVision), requires specific conditions of Matlab version and computer system
    1926%               ='cine_phantom': images from fast camera Phantom
    20 %               ='bin': binary file without specific organisation
    21 %               ='netcdf': netcdf file
    22 %               ='civdata': netcdf files provided by civ_series
    23 %               ='civx': netcdf files provided by the obsolete program civx (in fortran)
    24 %               ='pivdata_fluidimage': PIV data from software 'fluidimage'
     27%               ='telopsIR': Infrared images from  company Telops
    2528%      .FieldType='image' for all kinds of images and movies, =FileType  else
    26 %      .FileIndexing='on'/'off', for data files (when series of indexed files are  expected)
     29%      .FileIndexing='on'/'off', = 'on' for series of indexed files or frames to scan
    2730%      .Height: image height in pixels
    2831%      .Width:  image width in pixels
     
    3033%      .ColorType: 'greyscale' or 'color'
    3134%      .NumberOfFrames: defined for images or movies
    32 %      .FrameRate: nbre of frames per second, =[] for images
     35%      .FrameRate: nbre of frames per second, =[] if not documented
    3336% VideoObject: in case of video
    3437%
     
    5760
    5861VideoObject=[];
    59 FileInfo.FileType='';% input file does not exist
     62FileInfo.FileName='';% file doe not exist, defautlt
     63FileInfo.FileType='';% input file type not detected
    6064FileInfo.FieldType=''; %default output
    6165if ~ischar(fileinput)
    6266    return
    6367end
    64 % check the existence (not possible for OpenDAP data)
     68
     69%% check the existence (not possible for OpenDAP data)
    6570if ~isempty(regexp(fileinput,'^http://','once'))|| exist(fileinput,'file')
    6671    FileInfo.FileName=fileinput;
    67     FileInfo.FileType='txt'; %default
     72%     FileInfo.FileType='txt'; %default
    6873else
    6974    return %input file does not exist.
     
    7176[~,~,FileExt]=fileparts(fileinput);%get the file extension FileExt
    7277
     78%% look according to file extension
    7379switch FileExt
    74     case '.fig'
     80    case '.fig'% Matlab figure assumed
    7581        FileInfo.FileType='figure';
    76     case '.mat'
     82    case '.mat'% Matlab data format
    7783        FileInfo.FileType='mat';
     84    case {'.txt','.log','.stdout','.stderr','.sh'}
     85        FileInfo.FileType='txt';
    7886    case {'.xml','.xls','.dat','.bin'}
    7987        FileInfo.FileType=regexprep(FileExt,'^.','');% eliminate the dot of the extension;
    80     case {'.seq','.sqb'}
     88    case {'.seq','.sqb'}% data from rdvision
    8189        [~,FileInfo]=read_rdvision(fileinput,[]);
    82     case '.im7'
     90    case '.im7'% data from LaVision (DaVis), requires specific conditions of Matlab version and computer system
    8391        try
    8492            Input=readimx(fileinput);
     
    98106            end
    99107        catch ME
    100             msgbox_uvmat('ERROR',{ME.message;'reading image from DaVis is possible only with Matlab version 2013 or earlier'})
     108            msgbox_uvmat('ERROR',{ME.message;'reading image from DaVis is not possible with this Matlab version and system'})
    101109            return
    102110        end
    103     case '.h5'
     111    case '.h5'% format hdf5, used for specific case of PIV data from 'Fluidimage'
    104112        hinfo=h5info(fileinput);
    105113        FileInfo.CivStage=0;
     
    127135        FileInfo.BitDepth=BitmapInfoHeader.biBitCount;
    128136        FileInfo.TimeName='video';
    129     case '.hcc'
     137    case '.hcc' % infrared camera Telops
    130138        installToolboxIRCAM
    131139        [~,InfoArray]=readIRCam(fileinput,'HeadersOnly',true);
     
    273281end
    274282
    275 if ismember (FileInfo.FileType,{'mat','image','image_DaVis','multimage','mmreader','cine_phantom','video','netcdf','civdata'})
    276     FileInfo.FileIndexing='on'; % allow to detect file index for scanning series
    277 else
    278     FileInfo.FileIndexing='off';
    279 end
    280283FileInfo.FieldType=FileInfo.FileType;%default
    281284switch FileInfo.FileType
    282285    case {'image','multimage','video','mmreader','rdvision','image_DaVis','cine_phantom','telopsIR'}
    283286        FileInfo.FieldType='image';
    284     case {'civx','civdata','pivdata_fluidimage'}
     287    case {'civdata','pivdata_fluidimage'}
    285288        FileInfo.FieldType='civdata';
    286289end
    287290
     291if strcmp(FileInfo.FieldType,'image') || ismember (FileInfo.FileType,{'mat','netcdf','civdata'})
     292    FileInfo.FileIndexing='on'; % allow to detect file index for scanning series
     293else
     294    FileInfo.FileIndexing='off';
     295end
     296
     297
Note: See TracChangeset for help on using the changeset viewer.