Changeset 354 for trunk/src/read_field.m


Ignore:
Timestamp:
Dec 30, 2011, 5:00:25 PM (12 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_field.m

    r334 r354  
    2929function [Field,ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num)
    3030Field=[];
    31 ParamOut=[];
     31if ~exist('num','var')
     32    num=1;
     33end
     34if ~exist('ParamIn','var')
     35    ParamIn=[];
     36end
     37ParamOut=ParamIn;%default
    3238errormsg='';
    3339if isfield(ParamIn,'VelType')
     
    3844switch FileType
    3945    case {'civx','civdata','netcdf'}  %read the first nc field
    40         ParamOut.FieldName=ParamIn.FieldName;
     46%         ParamOut.FieldName=ParamIn.FieldName;
    4147        GUIName='get_field'; %default name of the GUI get_field
    4248        if isfield(ParamIn,'GUIName')
     
    140146        end
    141147       
    142     case 'movie'
     148    case 'video'
    143149        try
    144150            A=read(ObjectName,num);
    145             FieldName='image';
    146151        catch ME
    147             errormsg=ME.message;
     152            errormsg=ME.message
    148153            return
    149154        end
    150     case 'avi'
    151         try
    152             mov=aviread(ObjectName,num);
    153         catch ME
    154             errormsg=ME.message;
    155             return
    156         end
    157         A=frame2im(mov(1));
    158         FieldName='image';
     155        FieldName='image';
     156%     case 'avi'
     157%         try
     158%             mov=aviread(ObjectName,num);
     159%         catch ME
     160%             errormsg=ME.message;
     161%             return
     162%         end
     163%         A=frame2im(mov(1));
     164%         FieldName='image';
    159165    case 'vol'
    160166        A=imread(ObjectName);
Note: See TracChangeset for help on using the changeset viewer.