Ignore:
Timestamp:
Jun 17, 2012, 10:52:04 PM (12 years ago)
Author:
sommeria
Message:

merg_i_j transformed to the new standards.
Various improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/ima_levels.m

    r454 r457  
    11%'ima_levels': rescale the image intensity to reduce strong luminosity peaks (their blinking effects often perturbs PIV))
    2 % this function can be used as a template for applying a transform (here 'levels.m') on each image of a series
     2% this function can be used as a template for applying a transform (here 'levels.m') to each image of a series
    33%------------------------------------------------------------------------
    44% function GUI_input=ima_levels(Param)
    55%
    66%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     7%
     8% This function is used in four modes by the GUI series:
     9%           1) config GUI: with no input argument, the function determine the suitable GUI configuration
     10%           2) interactive input: the function is used to interactively introduce input parameters, and then stops
     11%           3) RUN: the function itself runs, when an appropriate input  structure Param has been introduced.
     12%           4) BATCH: the function itself proceeds in BATCH mode, using an xml file 'Param' as input.
     13%
    714%OUTPUT
    815% GUI_input=list of options in the GUI series.fig needed for the function
     
    5057end
    5158
    52 %% get input parameters, file names and indices
     59%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
     60%% select different modes,  RUN, parameter input, BATCH
    5361% BATCH  case: read the xml file for batch case
    54 if ischar(Param) && ~isempty(find(regexp(Param,'.xml$')))
    55     Param=xml2struct(Param);
    56     checkrun=0;
    57 % RUN case: parameters introduced as the input structure Param 
    58 else
     62if ischar(Param)
     63    if strcmp(Param,'input?')
     64        checkrun=1;% will inly search input parameters (preparation of BATCH mode)
     65    else
     66        Param=xml2struct(Param);
     67        checkrun=0;
     68    end
     69% RUN case: parameters introduced as the input structure Param
     70else
    5971    hseries=guidata(Param.hseries);%handles of the GUI series
    6072    WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series
    61     checkrun=1; % indicate the RUN option is used
    62 end
    63 
    64 % get the set of input file names (cell array filecell), and the lists of
    65 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     73    checkrun=2; % indicate the RUN option is used
     74end
    6675
    6776%% root input file(s) and type
     
    7281FileExt=Param.InputTable(:,5);
    7382
     83% get the set of input file names (cell array filecell), and the lists of
     84% input file or frame indices i1_series,i2_series,j1_series,j2_series
     85[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     86% filecell{iview,fileindex}: cell array representing the list of file names
     87%        iview: line in the table corresponding to a given file series
     88%        fileindex: file index within  the file series,
     89% 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
     90% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
     91% set of frame indices used for movie or multimage input
    7492% numbers of slices and file indices
     93
    7594NbSlice=1;%default
    7695if isfield(Param.IndexRange,'NbSlice')
     
    7897end
    7998nbview=numel(i1_series);%number of input file series (lines in InputTable)
    80 nbfield_j=size(i1_series{1},1); %nb of consecutive fields for the j index (bursts or volume slices)
    81 nbfield_i=size(i1_series{1},2); %nb of consecutive fields for the i index
    82 nbfield=nbfield_j*nbfield_i; %total number of files or frames
     99nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
     100nbfield_i=size(i1_series{1},2); %nb of fields for the i index
     101nbfield=nbfield_j*nbfield_i; %total number of fields
    83102nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
    84103nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
     
    86105%determine the file type on each line from the first input file
    87106ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
     107
    88108[FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
    89109CheckImage{1}=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
Note: See TracChangeset for help on using the changeset viewer.